diff --git a/.github/workflows/ci-cd-pims-dev.yml b/.github/workflows/ci-cd-pims-dev.yml
index 17baf742df..41e6abef29 100644
--- a/.github/workflows/ci-cd-pims-dev.yml
+++ b/.github/workflows/ci-cd-pims-dev.yml
@@ -123,7 +123,9 @@ jobs:
- name: call scripts to upgrade database
shell: bash
run: |
- oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=dev -p SERVER_NAME=sqldevtst.th.gov.bc.ca -p DB_NAME=PIMS_DEV -p NAMESPACE=3cd915-dev | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
+ JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=dev -p SERVER_NAME=sqldevtst.th.gov.bc.ca -p DB_NAME=PIMS_DEV -p NAMESPACE=3cd915-dev | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
+ oc wait --for=condition=complete job/$JOB_NAME --timeout=120s
+ oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
sync-keycloak:
name: Sync Keycloak
diff --git a/.github/workflows/depoy-prod-start.yml b/.github/workflows/deploy-prod-start.yml
similarity index 92%
rename from .github/workflows/depoy-prod-start.yml
rename to .github/workflows/deploy-prod-start.yml
index 0ef2cb883d..f20753fcb4 100644
--- a/.github/workflows/depoy-prod-start.yml
+++ b/.github/workflows/deploy-prod-start.yml
@@ -74,7 +74,7 @@ jobs:
[[ -z ${{github.event.inputs.OVERRIDE_VERSION}} ]] && RELEASE_VERSION=${{steps.previoustag.outputs.tag}}-master || RELEASE_VERSION=${{github.event.inputs.OVERRIDE_VERSION}}-master
RELEASE_TAG=$RELEASE_VERSION ./openshift/4.0/player.sh deploy api $DESTINATION -apply
RELEASE_TAG=$RELEASE_VERSION ./openshift/4.0/player.sh deploy app $DESTINATION -apply
-
+
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
# 2) greps the generated name from the previous step.
@@ -96,7 +96,9 @@ jobs:
- name: call scripts to upgrade database
shell: bash
run: |
- oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=master -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_PRD -p NAMESPACE=3cd915-prod | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
+ JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=master -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_PRD -p NAMESPACE=3cd915-prod | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
+ oc wait --for=condition=complete job/$JOB_NAME --timeout=120s
+ oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
## Call the mayan sync task three times, once for each mayan sync endpoint. The task will wait for the job to complete before exiting.
## Note: this depends on the mayan-sync configmap for the target namespace being up to date.
@@ -144,4 +146,4 @@ jobs:
- name: Start keycloak sync
run: dotnet run
- working-directory: ${{env.sync-directory}}
\ No newline at end of file
+ working-directory: ${{env.sync-directory}}
diff --git a/.github/workflows/retag-dev-to-test.yml b/.github/workflows/retag-dev-to-test.yml
index 690a7b8e52..7644bc666d 100644
--- a/.github/workflows/retag-dev-to-test.yml
+++ b/.github/workflows/retag-dev-to-test.yml
@@ -85,7 +85,9 @@ jobs:
- name: call scripts to upgrade database
shell: bash
run: |
- oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-test -p GIT_BRANCH=dev -p SERVER_NAME=sqldevtst.th.gov.bc.ca -p DB_NAME=PIMS_TST -p NAMESPACE=3cd915-dev | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
+ JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-test -p GIT_BRANCH=dev -p SERVER_NAME=sqldevtst.th.gov.bc.ca -p DB_NAME=PIMS_TST -p NAMESPACE=3cd915-dev | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
+ oc wait --for=condition=complete job/$JOB_NAME --timeout=120s
+ oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
sync-keycloak:
@@ -133,8 +135,8 @@ jobs:
run: |
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan/metadatatype -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
- oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
-
+ oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
+
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
diff --git a/.github/workflows/retag-test-to-uat.yml b/.github/workflows/retag-test-to-uat.yml
index 45a8bf0695..bfeed65e8e 100644
--- a/.github/workflows/retag-test-to-uat.yml
+++ b/.github/workflows/retag-test-to-uat.yml
@@ -63,7 +63,7 @@ jobs:
run: |
./openshift/4.0/player.sh deploy api $DESTINATION -apply
./openshift/4.0/player.sh deploy app $DESTINATION -apply
-
+
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
# 2) greps the generated name from the previous step.
@@ -85,7 +85,9 @@ jobs:
- name: call scripts to upgrade database
shell: bash
run: |
- oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-uat -p GIT_BRANCH=test -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_UAT -p NAMESPACE=3cd915-test | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
+ JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-uat -p GIT_BRANCH=test -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_UAT -p NAMESPACE=3cd915-test | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
+ oc wait --for=condition=complete job/$JOB_NAME --timeout=120s
+ oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
## Call the mayan sync task three times, once for each mayan sync endpoint. The task will wait for the job to complete before exiting.
## Note: this depends on the mayan-sync configmap for the target namespace being up to date.
@@ -133,7 +135,28 @@ jobs:
- name: Start keycloak sync
run: dotnet run
- working-directory: ${{env.sync-directory}}
+ working-directory: ${{env.sync-directory}}
+
+ tag-release-image:
+ name: Release Tag
+ needs: [deploy]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-tools
+ - name: tag uat image such that it can be promoted to prod
+ shell: bash
+ run: |
+ VERSION=$(make version)
+ oc tag pims-app:uat pims-app:v${VERSION}-master
+ oc tag pims-api:uat pims-api:v${VERSION}-master
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
diff --git a/.github/workflows/uat_hotfix.yml b/.github/workflows/uat_hotfix.yml
index d9e82f9ca8..a680917447 100644
--- a/.github/workflows/uat_hotfix.yml
+++ b/.github/workflows/uat_hotfix.yml
@@ -171,6 +171,27 @@ jobs:
run: dotnet run
working-directory: ${{env.sync-directory}}
+ tag-release-image:
+ name: Release Tag
+ needs: [deploy]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-tools
+ - name: tag uat image such that it can be promoted to prod
+ shell: bash
+ run: |
+ VERSION=$(make version)
+ oc tag pims-app:uat pims-app:v${VERSION}-master
+ oc tag pims-api:uat pims-api:v${VERSION}-master
+
ci-cd-end-notification:
if: always()
name: CI-CD End Notification to Teams Channel
diff --git a/.github/workflows/uat_pre_release_hotfix.yml b/.github/workflows/uat_pre_release_hotfix.yml
index b38fcf3bbd..dfc93b63cc 100644
--- a/.github/workflows/uat_pre_release_hotfix.yml
+++ b/.github/workflows/uat_pre_release_hotfix.yml
@@ -198,6 +198,27 @@ jobs:
run: dotnet run
working-directory: ${{env.sync-directory}}
+ tag-release-image:
+ name: Release Tag
+ needs: [deploy]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-tools
+ - name: tag uat image such that it can be promoted to prod
+ shell: bash
+ run: |
+ VERSION=$(make version)
+ oc tag pims-app:uat pims-app:v${VERSION}-master
+ oc tag pims-api:uat pims-api:v${VERSION}-master
+
ci-cd-end-notification:
if: always()
name: CI-CD End Notification to Teams Channel
diff --git a/Makefile b/Makefile
index e51a844a4c..6663367b27 100644
--- a/Makefile
+++ b/Makefile
@@ -217,7 +217,11 @@ clean: ## Removes all local containers, images, volumes, etc
@docker volume rm -f psp-api-db-data
restart-mayan:
- @docker-compose --profile mayan up --build -d
+ @docker-compose --profile mayan up --build --force-recreate -d
+
+mayan-up: ## Calls the docker compose up for the mayan images
+ @echo "$(P) Create or start mayan-edms system"
+ @docker-compose --profile mayan up -d
logs: ## Shows logs for running containers (n=service name)
@docker-compose logs -f $(n)
@@ -311,10 +315,6 @@ env: ## Generate env files
@echo "$(P) Generate/Regenerate env files required for application (generated passwords only match if database .env file does not already exist)"
@./tools/cicd/scripts/gen-env-files.sh;
-mayan-up: ## Calls the docker compose up for the mayan images
- @echo "$(P) Create or start mayan-edms system"
- @cd tools/mayan-edms; docker-compose --profile all up -d
-
generate-tsapi: ## Generates the pims API typescript files
@echo "$(P) Generating pims api Ts files..."
@cd tools/TsModelGenerator; dotnet build; dotnet run;
diff --git a/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.dtproj b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.dtproj
new file mode 100644
index 0000000000..d79447a31f
--- /dev/null
+++ b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.dtproj
@@ -0,0 +1,385 @@
+
+
+ Project
+ 16.0.5270.0
+ 9.0.1.0
+ $base64$PFNvdXJjZUNvbnRyb2xJbmZvIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOmRkbDI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yIiB4bWxuczpkZGwyXzI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yLzIiIHhtbG5zOmRkbDEwMF8xMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDA4L2VuZ2luZS8xMDAvMTAwIiB4bWxuczpkZGwyMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAiIHhtbG5zOmRkbDIwMF8yMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAvMjAwIiB4bWxuczpkZGwzMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAiIHhtbG5zOmRkbDMwMF8zMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAvMzAwIiB4bWxuczpkZGw0MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAiIHhtbG5zOmRkbDQwMF80MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAvNDAwIiB4bWxuczpkZGw1MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAiIHhtbG5zOmRkbDUwMF81MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAvNTAwIiB4bWxuczpkd2Q9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vRGF0YVdhcmVob3VzZS9EZXNpZ25lci8xLjAiPg0KICA8RW5hYmxlZD5mYWxzZTwvRW5hYmxlZD4NCiAgPFByb2plY3ROYW1lPjwvUHJvamVjdE5hbWU+DQogIDxBdXhQYXRoPjwvQXV4UGF0aD4NCiAgPExvY2FsUGF0aD48L0xvY2FsUGF0aD4NCiAgPFByb3ZpZGVyPjwvUHJvdmlkZXI+DQo8L1NvdXJjZUNvbnRyb2xJbmZvPg==
+
+ LISDB_PIMS_HISTORICAL_NUMBERS.database
+ LISDB_PIMS_HISTORICAL_NUMBERS.database
+
+
+
+
+
+
+
+ {653563c5-bf66-4819-8ef2-3767c2fd1c86}
+ LISDB_PIMS_HISTORICAL_NUMBERS
+ 0
+ 0
+ 0
+
+
+ 2024-05-30T13:11:11.602005-07:00
+ ARIMA-DELL\smart
+ ARIMA-DELL
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ {806442FF-3728-462C-9F7D-F38801B60975}
+ Package
+ 1
+ 0
+ 44
+
+
+ {59DCA95F-8073-4668-929B-0F74AC3FDE5C}
+ 8
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=sqldevtst.th.gov.bc.ca;Initial Catalog=LIS_Tst;Provider=SQLOLEDB.1;Integrated Security=SSPI;Auto Translate=False;Application Name=SSIS-Package-{DBB4D96E-81A2-46B7-A647-2DCDB2E8F3BB}sqldevtst.th.gov.bc.ca.LIS_Dev;
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 1
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 5
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ LIS_Tst
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ sqldevtst.th.gov.bc.ca
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=sqldevtst.th.gov.bc.ca;Initial Catalog=PIMS_TST;Provider=SQLOLEDB.1;Integrated Security=SSPI;Auto Translate=False;Application Name=SSIS-Package-{CDB87A68-CDAF-43B6-83B1-6BD4EAC1295A}sqldevtst.th.gov.bc.ca.PIMS_DEV;
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 1
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 5
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ PIMS_TST
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ sqldevtst.th.gov.bc.ca
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 18
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Development
+
+ bin
+
+
+
+
+ SQLServer2022
+ false
+
+
+
+
+
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-05-31T14:07:18.2602631Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.dtproj.user b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.dtproj.user
new file mode 100644
index 0000000000..acaa9936e8
--- /dev/null
+++ b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.dtproj.user
@@ -0,0 +1,27 @@
+
+
+
+
+ Development
+
+
+ false
+
+
+ ssistst.th.gov.bc.ca
+ /SSISDB/PIMS_TST/LISDB_PIMS_HISTORICAL_NUMBERS
+
+
+ false
+ true
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-05-31T14:07:18.2627556Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.sln b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.sln
new file mode 100644
index 0000000000..ca4c8db9a4
--- /dev/null
+++ b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.34729.46
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{C9674DCB-5085-4A16-B785-4C70DD1589BD}") = "LISDB_PIMS_HISTORICAL_NUMBERS", "LISDB_PIMS_HISTORICAL_NUMBERS.dtproj", "{0AA9F02B-0289-4166-88BB-EB17F41FAB09}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Development|Default = Development|Default
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0AA9F02B-0289-4166-88BB-EB17F41FAB09}.Development|Default.ActiveCfg = Development
+ {0AA9F02B-0289-4166-88BB-EB17F41FAB09}.Development|Default.Build.0 = Development
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {F57A8BB8-2688-4772-9016-0B6382A944B6}
+ EndGlobalSection
+EndGlobal
diff --git a/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS_LOAD.dtsx b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS_LOAD.dtsx
new file mode 100644
index 0000000000..8a6314d222
--- /dev/null
+++ b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/LISDB_PIMS_HISTORICAL_NUMBERS_LOAD.dtsx
@@ -0,0 +1,2062 @@
+
+
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [etl].[ETL_ERROR_LOG]
+
+ SELECT * FROM etl.ERROR_LOG
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ INSERT INTO dbo.PIMS_HISTORICAL_FILE_NUMBER (PROPERTY_ID, DATA_SOURCE_TYPE_CODE,HISTORICAL_FILE_NUMBER_TYPE_CODE,HISTORICAL_FILE_NUMBER )
+VALUES
+(?,?,?,?);
+ 1252
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 17
+
+
+
+
+ 65
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ SELECT
+
+DISTINCT
+fsub.PID
+ , CAST(main.TFA_File_Number AS NVARCHAR) AS HISTORICAL_FILE_NUMBER
+ , 'LISNO' AS HISTORICAL_FILE_NUMBER_TYPE_CODE
+ , 'LIS' AS DATA_SOURCE_TYPE_CODE
+FROM t_fileSub fsub JOIN
+ t_fileSubLookup lkup ON lkup.FileSubLookup_Id = fsub.FileSubLookup_Id JOIN
+ t_fileMain main ON main.FileMain_SKey = lkup.FileMain_SKey
+WHERE fsub.PID IS NOT NULL
+ AND main.TFA_File_Number IS NOT NULL
+order by fsub.PID
+
+ 1252
+ false
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+ select * from [dbo].[PIMS_HISTORICAL_FILE_NUMBER]
+ select * from (select * from [dbo].[PIMS_HISTORICAL_FILE_NUMBER]) [refTable]
+where [refTable].[PROPERTY_ID] = ? and [refTable].[HISTORICAL_FILE_NUMBER] = ? and [refTable].[HISTORICAL_FILE_NUMBER_TYPE_CODE] = ? and [refTable].[DATA_SOURCE_TYPE_CODE] = ?
+ 0
+ 0
+ 1
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="APP_CREATE_TIMESTAMP" dataType="DT_DBTIMESTAMP" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_CREATE_USER_DIRECTORY" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_CREATE_USER_GUID" dataType="DT_GUID" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_CREATE_USERID" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_LAST_UPDATE_TIMESTAMP" dataType="DT_DBTIMESTAMP" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_LAST_UPDATE_USER_DIRECTORY" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_LAST_UPDATE_USER_GUID" dataType="DT_GUID" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_LAST_UPDATE_USERID" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/><referenceColumn name="CONCURRENCY_CONTROL_NUMBER" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="DATA_SOURCE_TYPE_CODE" dataType="DT_WSTR" length="20" precision="0" scale="0" codePage="0"/><referenceColumn name="DB_CREATE_TIMESTAMP" dataType="DT_DBTIMESTAMP" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="DB_CREATE_USERID" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/><referenceColumn name="DB_LAST_UPDATE_TIMESTAMP" dataType="DT_DBTIMESTAMP" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="DB_LAST_UPDATE_USERID" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/><referenceColumn name="HISTORICAL_FILE_NUMBER" dataType="DT_WSTR" length="500" precision="0" scale="0" codePage="0"/><referenceColumn name="HISTORICAL_FILE_NUMBER_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="HISTORICAL_FILE_NUMBER_TYPE_CODE" dataType="DT_WSTR" length="20" precision="0" scale="0" codePage="0"/><referenceColumn name="IS_DISABLED" dataType="DT_BOOL" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="OTHER_HIST_FILE_NUMBER_TYPE_CODE" dataType="DT_WSTR" length="200" precision="0" scale="0" codePage="0"/><referenceColumn name="PROPERTY_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\STEP 1 - INSERT INTO PIMS_HISTORICAL_NUMBERS\Merge Join.Outputs[Merge Join Output].Columns[PROPERTY_ID]};#{Package\STEP 1 - INSERT INTO PIMS_HISTORICAL_NUMBERS\Data Conversiom Fields.Outputs[Data Conversion Output].Columns[Copy of HISTORICAL_FILE_NUMBER]};#{Package\STEP 1 - INSERT INTO PIMS_HISTORICAL_NUMBERS\Data Conversiom Fields.Outputs[Data Conversion Output].Columns[Copy of HISTORICAL_FILE_NUMBER_TYPE_CODE]};#{Package\STEP 1 - INSERT INTO PIMS_HISTORICAL_NUMBERS\Data Conversiom Fields.Outputs[Data Conversion Output].Columns[Copy of DATA_SOURCE_TYPE_CODE]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ PROPERTY_ID
+
+
+
+
+
+ HISTORICAL_FILE_NUMBER
+
+
+
+
+
+ HISTORICAL_FILE_NUMBER_TYPE_CODE
+
+
+
+
+
+ DATA_SOURCE_TYPE_CODE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 2
+ 1
+ true
+ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ SELECT PID, PROPERTY_ID FROM dbo.PIMS_PROPERTY WHERE PID IS NOT NULL
+ORDER BY PID
+
+ 1252
+ false
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ -1
+
+
+
+
+
+
+ 0
+ 1
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ -1
+
+
+
+
+
+
+ 0
+ 1
+
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+ [dbo].[PIMS_HISTORICAL_FILE_NUMBER]
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+]]>
+
\ No newline at end of file
diff --git a/etl/LISDB_PIMS_HISTORICAL_NUMBERS/Project.params b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/Project.params
new file mode 100644
index 0000000000..680ffe30da
--- /dev/null
+++ b/etl/LISDB_PIMS_HISTORICAL_NUMBERS/Project.params
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtproj b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtproj
new file mode 100644
index 0000000000..ac42403379
--- /dev/null
+++ b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtproj
@@ -0,0 +1,406 @@
+
+
+ Project
+ 16.0.5270.0
+ 9.0.1.0
+ $base64$PFNvdXJjZUNvbnRyb2xJbmZvIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOmRkbDI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yIiB4bWxuczpkZGwyXzI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yLzIiIHhtbG5zOmRkbDEwMF8xMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDA4L2VuZ2luZS8xMDAvMTAwIiB4bWxuczpkZGwyMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAiIHhtbG5zOmRkbDIwMF8yMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAvMjAwIiB4bWxuczpkZGwzMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAiIHhtbG5zOmRkbDMwMF8zMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAvMzAwIiB4bWxuczpkZGw0MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAiIHhtbG5zOmRkbDQwMF80MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAvNDAwIiB4bWxuczpkZGw1MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAiIHhtbG5zOmRkbDUwMF81MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAvNTAwIiB4bWxuczpkd2Q9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vRGF0YVdhcmVob3VzZS9EZXNpZ25lci8xLjAiPg0KICA8RW5hYmxlZD5mYWxzZTwvRW5hYmxlZD4NCiAgPFByb2plY3ROYW1lPjwvUHJvamVjdE5hbWU+DQogIDxBdXhQYXRoPjwvQXV4UGF0aD4NCiAgPExvY2FsUGF0aD48L0xvY2FsUGF0aD4NCiAgPFByb3ZpZGVyPjwvUHJvdmlkZXI+DQo8L1NvdXJjZUNvbnRyb2xJbmZvPg==
+
+ PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.database
+ PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.database
+
+
+
+
+
+
+
+ {c123d220-f059-44f7-8dbf-d2160b8caf3b}
+ PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs
+ 0
+ 0
+ 0
+
+
+ 2024-08-06T13:47:35.3605786-07:00
+ ARIMA-DELL\smart
+ ARIMA-DELL
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+ {754BCC57-FDF1-4C9C-ADB4-0F7F72DA3C31}
+ Package
+ 1
+ 0
+ 11
+
+
+ {BD0E280C-49FC-4CF0-8385-B647C5BD6967}
+ 8
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=localhost, 5433;User ID=admin;Initial Catalog=pims;Provider=SQLOLEDB.1;Persist Security Info=True;Auto Translate=False;Application Name=SSIS-Package-{E5F0FFF5-5031-43E1-81EA-778431C1FB45}sqldevtst.th.gov.bc.ca.PIMS_DEV;
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 1
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 5
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ pims
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ localhost, 5433
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ admin
+ 18
+
+
+
+
+
+
+ {2C2EC646-A20A-4D74-96CE-BA75A55BE80D}
+ Package1
+ 1
+ 0
+ 16
+
+
+ {EFFF3A5E-5124-46C8-9580-2A8C8C3B2D8B}
+ 8
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=localhost,5433;User ID=admin;Initial Catalog=pims;Provider=SQLOLEDB.1;Persist Security Info=True;Auto Translate=False;Application Name=SSIS-Package1-{81F8CB25-1234-4D17-8A7B-41B43637ED66}sqldevtst.th.gov.bc.ca.PIMS_DEV;
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 1
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 5
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ pims
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ localhost,5433
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ admin
+ 18
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Development
+
+ bin
+
+
+
+
+ SQLServer2022
+ false
+
+
+
+
+
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-08-06T21:23:40.8637408Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtproj.user b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtproj.user
new file mode 100644
index 0000000000..726fe34889
--- /dev/null
+++ b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtproj.user
@@ -0,0 +1,27 @@
+
+
+
+
+ Development
+
+
+ false
+
+
+ ssistst.th.gov.bc.ca
+ /SSISDB/PIMS_TST/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs
+
+
+ false
+ true
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-08-06T21:23:40.864741Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtsx b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtsx
new file mode 100644
index 0000000000..6a2c27eac4
--- /dev/null
+++ b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtsx
@@ -0,0 +1,311 @@
+
+
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
\ No newline at end of file
diff --git a/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.sln b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.sln
new file mode 100644
index 0000000000..bf893c28c6
--- /dev/null
+++ b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.34729.46
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{C9674DCB-5085-4A16-B785-4C70DD1589BD}") = "PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs", "PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs.dtproj", "{CC2C02AD-C5BE-401E-84A8-E6FE4C4F3C6F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Development|Default = Development|Default
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CC2C02AD-C5BE-401E-84A8-E6FE4C4F3C6F}.Development|Default.ActiveCfg = Development
+ {CC2C02AD-C5BE-401E-84A8-E6FE4C4F3C6F}.Development|Default.Build.0 = Development
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {EAEE040D-0140-4DF4-B040-43B62E31004A}
+ EndGlobalSection
+EndGlobal
diff --git a/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PRE_ETL_CREATE_TEMP_Tables.dtsx b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PRE_ETL_CREATE_TEMP_Tables.dtsx
new file mode 100644
index 0000000000..a23ae97e3c
--- /dev/null
+++ b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/PRE_ETL_CREATE_TEMP_Tables.dtsx
@@ -0,0 +1,325 @@
+
+
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
\ No newline at end of file
diff --git a/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/Project.params b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/Project.params
new file mode 100644
index 0000000000..680ffe30da
--- /dev/null
+++ b/etl/PIMS_PROPERTY_FIX_DUPLICATE_ADDRESSIDs/Project.params
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs b/source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs
index 224326dee4..40a74327fe 100644
--- a/source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs
+++ b/source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs
@@ -288,7 +288,7 @@ public IActionResult AddCompensationRequisition([FromRoute] long id, [FromBody]
DateTime.Now);
_logger.LogInformation($"Dispatching to service: {_acquisitionService.GetType()}");
- var compensationReqEntity = _mapper.Map(compensationRequisition);
+ var compensationReqEntity = _mapper.Map(compensationRequisition);
var newCompensationRequisition = _acquisitionService.AddCompensationRequisition(id, compensationReqEntity);
return new JsonResult(_mapper.Map(newCompensationRequisition));
diff --git a/source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs b/source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs
index 8038503313..de49ec3b35 100644
--- a/source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs
+++ b/source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs
@@ -1,9 +1,11 @@
using System;
+using System.Collections.Generic;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Helpers.Exceptions;
+using Pims.Api.Models.Concepts.AcquisitionFile;
using Pims.Api.Models.Concepts.CompensationRequisition;
using Pims.Api.Policies;
using Pims.Api.Services;
@@ -89,6 +91,27 @@ public IActionResult UpdateCompensationRequisition([FromRoute] long id, [FromBod
return new JsonResult(_mapper.Map(compensation));
}
+ [HttpGet("{id:long}/properties")]
+ [HasPermission(Permissions.CompensationRequisitionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
+ [SwaggerOperation(Tags = new[] { "compensation-requisition" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetCompensationRequisitionProperties([FromRoute] long id)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(CompensationRequisitionController),
+ nameof(GetCompensationRequisitionProperties),
+ User.GetUsername(),
+ DateTime.Now);
+ _logger.LogInformation("Dispatching to service: {Service}", _compensationRequisitionService.GetType());
+
+ var compensationReqProperties = _compensationRequisitionService.GetProperties(id);
+
+ return new JsonResult(_mapper.Map>(compensationReqProperties));
+ }
+
///
/// Deletes the compensation with the matching id.
///
diff --git a/source/backend/api/Areas/Contacts/Models/Search/ContactSummaryModel.cs b/source/backend/api/Areas/Contacts/Models/Search/ContactSummaryModel.cs
index 8ed98791a1..532f45e02b 100644
--- a/source/backend/api/Areas/Contacts/Models/Search/ContactSummaryModel.cs
+++ b/source/backend/api/Areas/Contacts/Models/Search/ContactSummaryModel.cs
@@ -16,14 +16,14 @@ public class ContactSummaryModel
///
public long? PersonId { get; set; }
- public PersonModel Person { get; set; }
+ public Pims.Api.Models.Concepts.Person.PersonModel Person { get; set; }
///
/// get/set - The primary key to identify the organization.
///
public long? OrganizationId { get; set; }
- public OrganizationModel Organization { get; set; }
+ public Pims.Api.Models.Concepts.Organization.OrganizationModel Organization { get; set; }
///
/// get/set - The concurrency row version.
diff --git a/source/backend/api/Areas/DocumentGeneration/DocumentGenerationRequest.cs b/source/backend/api/Areas/DocumentGeneration/DocumentGenerationRequest.cs
index 6fcc9b93f1..c719f22e2d 100644
--- a/source/backend/api/Areas/DocumentGeneration/DocumentGenerationRequest.cs
+++ b/source/backend/api/Areas/DocumentGeneration/DocumentGenerationRequest.cs
@@ -17,7 +17,7 @@ public class DocumentGenerationRequest
///
/// get/set - The template type to use for generation.
///
- public FormDocumentType TemplateType { get; set; }
+ public FormTypes TemplateType { get; set; }
///
/// get/set - the type the document template should be converted to when returned from cdogs.
diff --git a/source/backend/api/Areas/HistoricalNumber/HistoricalNumberController.cs b/source/backend/api/Areas/HistoricalNumber/HistoricalNumberController.cs
index 80ee157f35..22a0ebfcac 100644
--- a/source/backend/api/Areas/HistoricalNumber/HistoricalNumberController.cs
+++ b/source/backend/api/Areas/HistoricalNumber/HistoricalNumberController.cs
@@ -7,6 +7,7 @@
using Pims.Api.Models.Concepts.Property;
using Pims.Api.Policies;
using Pims.Api.Services;
+using Pims.Core.Exceptions;
using Pims.Core.Extensions;
using Pims.Core.Json;
using Pims.Dal.Security;
@@ -86,10 +87,17 @@ public IActionResult UpdateHistoricalNumbers(long propertyId, IEnumerable>(historicalNumbers);
- var updatedEntities = _propertyService.UpdateHistoricalFileNumbers(propertyId, historicalEntities);
+ try
+ {
+ var historicalEntities = _mapper.Map>(historicalNumbers);
+ var updatedEntities = _propertyService.UpdateHistoricalFileNumbers(propertyId, historicalEntities);
- return new JsonResult(_mapper.Map>(updatedEntities));
+ return new JsonResult(_mapper.Map>(updatedEntities));
+ }
+ catch (DuplicateEntityException e)
+ {
+ return Conflict(e.Message);
+ }
}
#endregion
}
diff --git a/source/backend/api/Areas/Leases/Controllers/LeaseController.cs b/source/backend/api/Areas/Leases/Controllers/LeaseController.cs
index a6099ced7f..b87b883309 100644
--- a/source/backend/api/Areas/Leases/Controllers/LeaseController.cs
+++ b/source/backend/api/Areas/Leases/Controllers/LeaseController.cs
@@ -6,7 +6,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Helpers.Exceptions;
-using Pims.Api.Models.Concepts.AcquisitionFile;
using Pims.Api.Models.Concepts.File;
using Pims.Api.Models.Concepts.Lease;
using Pims.Api.Policies;
@@ -140,7 +139,7 @@ public IActionResult UpdateLease(LeaseModel leaseModel, [FromQuery] string[] use
User.GetUsername(),
DateTime.Now);
- var leaseEntity = _mapper.Map(leaseModel);
+ var leaseEntity = _mapper.Map(leaseModel);
var userOverrides = userOverrideCodes.Select(x => UserOverrideCode.Parse(x));
var updatedLease = _leaseService.Update(leaseEntity, userOverrides);
@@ -174,9 +173,9 @@ public IActionResult GetLeaseChecklistItems([FromRoute] long id)
[ProducesResponseType(typeof(LeaseModel), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
[TypeFilter(typeof(NullJsonResultFilter))]
- public IActionResult UpdateLeaseChecklist([FromRoute]long id, [FromBody] IList checklistItems)
+ public IActionResult UpdateLeaseChecklist([FromRoute] long id, [FromBody] IList checklistItems)
{
- if(checklistItems.Any(x => x.FileId != id))
+ if (checklistItems.Any(x => x.FileId != id))
{
throw new BadRequestException("All checklist items file id must match the Lease's id");
}
diff --git a/source/backend/api/Areas/Leases/Controllers/LeasePaymentController.cs b/source/backend/api/Areas/Leases/Controllers/LeasePaymentController.cs
index 419592edce..bc48bd0ea9 100644
--- a/source/backend/api/Areas/Leases/Controllers/LeasePaymentController.cs
+++ b/source/backend/api/Areas/Leases/Controllers/LeasePaymentController.cs
@@ -64,7 +64,7 @@ public IActionResult AddPayment(long leaseId, [FromBody] PaymentModel paymentMod
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
- nameof(LeaseTermController),
+ nameof(LeasePaymentController),
nameof(AddPayment),
User.GetUsername(),
DateTime.Now);
@@ -89,7 +89,7 @@ public IActionResult UpdatePayment(long leaseId, long paymentId, [FromBody] Paym
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
- nameof(LeaseTermController),
+ nameof(LeasePaymentController),
nameof(UpdatePayment),
User.GetUsername(),
DateTime.Now);
@@ -114,7 +114,7 @@ public IActionResult DeletePayment(long leaseId, PaymentModel paymentModel)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
- nameof(LeaseTermController),
+ nameof(LeasePaymentController),
nameof(DeletePayment),
User.GetUsername(),
DateTime.Now);
diff --git a/source/backend/api/Areas/Leases/Controllers/LeaseTermController.cs b/source/backend/api/Areas/Leases/Controllers/LeasePeriodController.cs
similarity index 52%
rename from source/backend/api/Areas/Leases/Controllers/LeaseTermController.cs
rename to source/backend/api/Areas/Leases/Controllers/LeasePeriodController.cs
index e9f4bacfd7..d33d8504a1 100644
--- a/source/backend/api/Areas/Leases/Controllers/LeaseTermController.cs
+++ b/source/backend/api/Areas/Leases/Controllers/LeasePeriodController.cs
@@ -16,7 +16,7 @@
namespace Pims.Api.Areas.Lease.Controllers
{
///
- /// LeaseTermController class, provides endpoints for interacting with lease property terms.
+ /// LeasePeriodController class, provides endpoints for interacting with lease property periods.
///
[Authorize]
[ApiController]
@@ -24,10 +24,10 @@ namespace Pims.Api.Areas.Lease.Controllers
[Area("leases")]
[Route("v{version:apiVersion}/[area]")]
[Route("[area]")]
- public class LeaseTermController : ControllerBase
+ public class LeasePeriodController : ControllerBase
{
#region Variables
- private readonly ILeaseTermService _leaseTermService;
+ private readonly ILeasePeriodService _LeasePeriodService;
private readonly IMapper _mapper;
private readonly ILogger _logger;
#endregion
@@ -35,15 +35,15 @@ public class LeaseTermController : ControllerBase
#region Constructors
///
- /// Creates a new instance of a LeaseTermController class, initializes it with the specified arguments.
+ /// Creates a new instance of a LeasePeriodController class, initializes it with the specified arguments.
///
- ///
+ ///
///
///
///
- public LeaseTermController(ILeaseTermService leaseTermService, IMapper mapper, ILogger logger)
+ public LeasePeriodController(ILeasePeriodService LeasePeriodService, IMapper mapper, ILogger logger)
{
- _leaseTermService = leaseTermService;
+ _LeasePeriodService = LeasePeriodService;
_mapper = mapper;
_logger = logger;
}
@@ -52,102 +52,102 @@ public LeaseTermController(ILeaseTermService leaseTermService, IMapper mapper, I
#region Endpoints
///
- /// Update the specified term on the passed lease.
+ /// Update the specified period on the passed lease.
///
///
- [HttpGet("{leaseId:long}/terms")]
+ [HttpGet("{leaseId:long}/periods")]
[HasPermission(Permissions.LeaseView)]
[Produces("application/json")]
- [ProducesResponseType(typeof(IEnumerable), 200)]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
[TypeFilter(typeof(NullJsonResultFilter))]
- public IActionResult GetTerms(long leaseId)
+ public IActionResult GetPeriods(long leaseId)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
- nameof(LeaseTermController),
- nameof(GetTerms),
+ nameof(LeasePeriodController),
+ nameof(GetPeriods),
User.GetUsername(),
DateTime.Now);
- var terms = _leaseTermService.GetTerms(leaseId);
+ var periods = _LeasePeriodService.GetPeriods(leaseId);
- return new JsonResult(_mapper.Map>(terms));
+ return new JsonResult(_mapper.Map>(periods));
}
///
- /// Update the specified term on the passed lease.
+ /// Update the specified period on the passed lease.
///
///
- [HttpPost("{leaseId:long}/terms")]
+ [HttpPost("{leaseId:long}/periods")]
[HasPermission(Permissions.LeaseAdd)]
[Produces("application/json")]
- [ProducesResponseType(typeof(LeaseTermModel), 200)]
+ [ProducesResponseType(typeof(LeasePeriodModel), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
[TypeFilter(typeof(NullJsonResultFilter))]
- public IActionResult AddTerm(long leaseId, [FromBody] LeaseTermModel termModel)
+ public IActionResult AddPeriod(long leaseId, [FromBody] LeasePeriodModel periodModel)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
- nameof(LeaseTermController),
- nameof(AddTerm),
+ nameof(LeasePeriodController),
+ nameof(AddPeriod),
User.GetUsername(),
DateTime.Now);
- var termEntity = _mapper.Map(termModel);
- var updatedLease = _leaseTermService.AddTerm(leaseId, termEntity);
+ var periodEntity = _mapper.Map(periodModel);
+ var updatedLease = _LeasePeriodService.AddPeriod(leaseId, periodEntity);
- return new JsonResult(_mapper.Map(updatedLease));
+ return new JsonResult(_mapper.Map(updatedLease));
}
///
- /// Update the specified term on the passed lease.
+ /// Update the specified period on the passed lease.
///
///
- [HttpPut("{leaseId:long}/terms/{termId:long}")]
+ [HttpPut("{leaseId:long}/periods/{periodId:long}")]
[HasPermission(Permissions.LeaseEdit)]
[Produces("application/json")]
- [ProducesResponseType(typeof(LeaseTermModel), 200)]
+ [ProducesResponseType(typeof(LeasePeriodModel), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
[TypeFilter(typeof(NullJsonResultFilter))]
- public IActionResult UpdateTerm(long leaseId, long termId, [FromBody] LeaseTermModel termModel)
+ public IActionResult UpdatePeriod(long leaseId, long periodId, [FromBody] LeasePeriodModel periodModel)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
- nameof(LeaseTermController),
- nameof(UpdateTerm),
+ nameof(LeasePeriodController),
+ nameof(UpdatePeriod),
User.GetUsername(),
DateTime.Now);
- var termEntity = _mapper.Map(termModel);
- var updatedLease = _leaseTermService.UpdateTerm(leaseId, termId, termEntity);
+ var periodEntity = _mapper.Map(periodModel);
+ var updatedLease = _LeasePeriodService.UpdatePeriod(leaseId, periodId, periodEntity);
- return new JsonResult(_mapper.Map(updatedLease));
+ return new JsonResult(_mapper.Map(updatedLease));
}
///
- /// Delete the specified term on the passed lease.
+ /// Delete the specified period on the passed lease.
///
///
- [HttpDelete("{leaseId:long}/terms")]
+ [HttpDelete("{leaseId:long}/periods")]
[HasPermission(Permissions.LeaseEdit)]
[Produces("application/json")]
- [ProducesResponseType(typeof(LeaseTermModel), 200)]
+ [ProducesResponseType(typeof(LeasePeriodModel), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
[TypeFilter(typeof(NullJsonResultFilter))]
- public IActionResult DeleteTerm(long leaseId, LeaseTermModel termModel)
+ public IActionResult DeletePeriod(long leaseId, LeasePeriodModel periodModel)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
- nameof(LeaseTermController),
- nameof(DeleteTerm),
+ nameof(LeasePeriodController),
+ nameof(DeletePeriod),
User.GetUsername(),
DateTime.Now);
- var termEntity = _mapper.Map(termModel);
- var updatedLease = _leaseTermService.DeleteTerm(leaseId, termEntity);
+ var periodEntity = _mapper.Map(periodModel);
+ var updatedLease = _LeasePeriodService.DeletePeriod(leaseId, periodEntity);
- return new JsonResult(_mapper.Map(updatedLease));
+ return new JsonResult(_mapper.Map(updatedLease));
}
#endregion
}
diff --git a/source/backend/api/Areas/Leases/Controllers/LeaseRenewalController.cs b/source/backend/api/Areas/Leases/Controllers/LeaseRenewalController.cs
new file mode 100644
index 0000000000..1db5a597f4
--- /dev/null
+++ b/source/backend/api/Areas/Leases/Controllers/LeaseRenewalController.cs
@@ -0,0 +1,79 @@
+
+using System;
+using System.Collections.Generic;
+using MapsterMapper;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using Pims.Api.Models.Concepts.Lease;
+using Pims.Api.Policies;
+using Pims.Api.Services;
+using Pims.Core.Extensions;
+using Pims.Core.Json;
+using Pims.Dal.Security;
+using Swashbuckle.AspNetCore.Annotations;
+
+namespace Pims.Api.Areas.Lease.Controllers
+{
+ ///
+ /// LeaseRenewalController class, provides endpoints for interacting with lease renewals.
+ ///
+ [Authorize]
+ [ApiController]
+ [ApiVersion("1.0")]
+ [Area("leases")]
+ [Route("v{version:apiVersion}/[area]")]
+ [Route("[area]")]
+ public class LeaseRenewalController : ControllerBase
+ {
+ #region Variables
+ private readonly ILeaseService _leaseService;
+ private readonly IMapper _mapper;
+ private readonly ILogger _logger;
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Creates a new instance of a LeaseRenewalController class, initializes it with the specified arguments.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public LeaseRenewalController(ILeaseService leaseService, IMapper mapper, ILogger logger)
+ {
+ _leaseService = leaseService;
+ _mapper = mapper;
+ _logger = logger;
+ }
+ #endregion
+
+ #region Endpoints
+
+ ///
+ /// Get the renewals on the passed lease id.
+ ///
+ ///
+ [HttpGet("{leaseId:long}/renewals")]
+ [HasPermission(Permissions.LeaseView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
+ [SwaggerOperation(Tags = new[] { "lease" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetRenewals(long leaseId)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(LeaseRenewalController),
+ nameof(GetRenewals),
+ User.GetUsername(),
+ DateTime.Now);
+
+ var leaseRenewals = _leaseService.GetRenewalsByLeaseId(leaseId);
+
+ return new JsonResult(_mapper.Map>(leaseRenewals));
+ }
+ #endregion
+ }
+}
diff --git a/source/backend/api/Areas/Organizations/Controllers/OrganizationController.cs b/source/backend/api/Areas/Organizations/Controllers/OrganizationController.cs
index 81c40c85b5..8fa008249d 100644
--- a/source/backend/api/Areas/Organizations/Controllers/OrganizationController.cs
+++ b/source/backend/api/Areas/Organizations/Controllers/OrganizationController.cs
@@ -94,11 +94,14 @@ public IActionResult AddOrganization([FromBody] OrganizationModel model, bool us
{
// Business rule - support country free-form value if country code is "Other". Ignore field otherwise.
var otherCountry = _lookupRepository.GetAllCountries().FirstOrDefault(x => x.Code == Dal.Entities.CountryCodes.Other);
- foreach (var organizationAddress in model?.OrganizationAddresses)
+ if (model?.OrganizationAddresses != null)
{
- if (otherCountry != null && organizationAddress?.Address != null && organizationAddress.Address.CountryId != otherCountry.CountryId)
+ foreach (var organizationAddress in model?.OrganizationAddresses)
{
- organizationAddress.Address.CountryOther = null;
+ if (otherCountry != null && organizationAddress?.Address != null && organizationAddress.Address.CountryId != otherCountry.CountryId)
+ {
+ organizationAddress.Address.CountryOther = null;
+ }
}
}
diff --git a/source/backend/api/Areas/Persons/Controllers/PersonController.cs b/source/backend/api/Areas/Persons/Controllers/PersonController.cs
index 2b59a19144..3e853a41b9 100644
--- a/source/backend/api/Areas/Persons/Controllers/PersonController.cs
+++ b/source/backend/api/Areas/Persons/Controllers/PersonController.cs
@@ -94,11 +94,14 @@ public IActionResult AddPerson([FromBody] PersonModel model, bool userOverride =
{
// Business rule - support country free-form value if country code is "Other". Ignore field otherwise.
var otherCountry = _lookupRepository.GetAllCountries().FirstOrDefault(x => x.Code == Dal.Entities.CountryCodes.Other);
- foreach (var personAddress in model?.PersonAddresses)
+ if (model?.PersonAddresses != null)
{
- if (otherCountry != null && personAddress != null && personAddress.Address.CountryId != otherCountry.CountryId)
+ foreach (var personAddress in model?.PersonAddresses)
{
- personAddress.Address.CountryOther = null;
+ if (otherCountry != null && personAddress != null && personAddress.Address.CountryId != otherCountry.CountryId)
+ {
+ personAddress.Address.CountryOther = null;
+ }
}
}
diff --git a/source/backend/api/Areas/Reports/Controllers/LeaseController.cs b/source/backend/api/Areas/Reports/Controllers/LeaseController.cs
index ca69b47137..b3ac6b3cef 100644
--- a/source/backend/api/Areas/Reports/Controllers/LeaseController.cs
+++ b/source/backend/api/Areas/Reports/Controllers/LeaseController.cs
@@ -19,6 +19,7 @@
using Pims.Core.Extensions;
using Pims.Dal.Entities;
using Pims.Dal.Entities.Models;
+using Pims.Dal.Helpers.Extensions;
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
@@ -184,11 +185,11 @@ public IActionResult ExportLeasePayments(int fiscalYearStart)
DateTime startDate = fiscalYearStart.ToFiscalYearDate();
var allPayments = _leasePaymentService.GetAllByDateRange(startDate, startDate.AddYears(1).AddDays(-1)); // Add years will give you the equivalent month, except for 29th/ 28th of leap years which is not the case here.
- var paymentItems = _mapper.Map>(allPayments);
+ var paymentItems = _mapper.Map>(allPayments.OrderBy(p => p?.LeasePeriod?.Lease?.RegionCode).ThenBy(p => p?.LeasePeriod?.Lease?.LFileNo).ThenByDescending(p => p.PaymentReceivedDate));
return acceptHeader.ToString() switch
{
- ContentTypes.CONTENTTYPECSV => ReportHelper.GenerateCsv(paymentItems.OrderBy(p => p.Region).ThenBy(p => p.LFileNumber).ThenByDescending(p => p.PaymentReceivedDate)),
+ ContentTypes.CONTENTTYPECSV => ReportHelper.GenerateCsv(paymentItems),
_ => ReportHelper.GenerateExcel(paymentItems, $"LeaseLicense_Payments")
};
}
@@ -196,7 +197,7 @@ public IActionResult ExportLeasePayments(int fiscalYearStart)
#endregion
///
- /// Create duplicate lease rows for every unique property lease, tenant, and term.
+ /// Create duplicate lease rows for every unique property lease, tenant, and period.
///
///
///
@@ -204,9 +205,11 @@ public IActionResult ExportLeasePayments(int fiscalYearStart)
public IEnumerable GetCrossJoinLeases(Lease.Models.Search.LeaseFilterModel filter, bool all = false)
{
var page = _leaseService.GetPage((LeaseFilter)filter, all);
- var allLeases = page.Items.SelectMany(l => l.PimsLeaseTerms.DefaultIfEmpty(), (lease, term) => (lease, term))
- .SelectMany(lt => lt.lease.PimsPropertyLeases.DefaultIfEmpty(), (leaseTerm, property) => (leaseTerm.term, leaseTerm.lease, property))
- .SelectMany(ltp => ltp.lease.PimsLeaseTenants.DefaultIfEmpty(), (leaseTermProperty, tenant) => (leaseTermProperty.term, leaseTermProperty.lease, leaseTermProperty.property, tenant));
+
+ var allLeases = page.Items
+ .SelectMany(l => l.PimsLeasePeriods.DefaultIfEmpty(), (lease, period) => (lease, period))
+ .SelectMany(lt => lt.lease.PimsPropertyLeases.DefaultIfEmpty(), (leasePeriod, property) => (leasePeriod.period, leasePeriod.lease, property))
+ .SelectMany(ltp => ltp.lease.PimsLeaseTenants.DefaultIfEmpty(), (leasePeriodProperty, tenant) => (leasePeriodProperty.period, leasePeriodProperty.lease, leasePeriodProperty.property, tenant));
var flatLeases = _mapper.Map>(allLeases);
return flatLeases;
}
diff --git a/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs b/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
index bc0eac6126..8a33fc0178 100644
--- a/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
+++ b/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
@@ -11,21 +11,22 @@ public class LeaseMap : IRegister
{
public void Register(TypeAdapterConfig config)
{
- config.NewConfig<(Entity.PimsLeaseTerm term, Entity.PimsLease lease, Entity.PimsPropertyLease property, Entity.PimsLeaseTenant tenant), Model.LeaseModel>()
+ config.NewConfig<(Entity.PimsLeasePeriod period, Entity.PimsLease lease, Entity.PimsPropertyLease property, Entity.PimsLeaseTenant tenant ), Model.LeaseModel>()
.AfterMapping((src, dest) =>
{
MapLease(src, dest);
});
}
- private static void MapLease((Entity.PimsLeaseTerm term, Entity.PimsLease lease, Entity.PimsPropertyLease property, Entity.PimsLeaseTenant tenant) src, Model.LeaseModel dest)
+ private static void MapLease((Entity.PimsLeasePeriod period, Entity.PimsLease lease, Entity.PimsPropertyLease property, Entity.PimsLeaseTenant tenant) src, Model.LeaseModel dest)
{
+ var leaseExpiryDate = src.lease.GetExpiryDate();
dest.LFileNo = src.lease.LFileNo;
dest.MotiRegion = src.lease.RegionCodeNavigation?.RegionName;
dest.StartDate = src.lease.OrigStartDate.FilterSqlMinDate().ToNullableDateOnly();
- dest.EndDate = src.lease.OrigExpiryDate?.FilterSqlMinDate().ToNullableDateOnly();
- dest.CurrentTermStartDate = src.lease.GetCurrentTermStartDate()?.FilterSqlMinDate().ToNullableDateOnly();
- dest.CurrentTermEndDate = src.lease.GetCurrentTermEndDate()?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.EndDate = leaseExpiryDate.ToNullableDateOnly();
+ dest.CurrentPeriodStartDate = src.lease.GetCurrentPeriodStartDate()?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.CurrentTermEndDate = src.lease.GetCurrentPeriodEndDate()?.FilterSqlMinDate().ToNullableDateOnly();
dest.ProgramName = src.lease.LeaseProgramTypeCodeNavigation?.GetTypeDescriptionOther(src.lease.OtherLeaseProgramType);
dest.PurposeType = src.lease.LeasePurposeTypeCodeNavigation?.GetTypeDescriptionOther(src.lease.OtherLeasePurposeType);
dest.StatusType = src.lease.LeaseStatusTypeCodeNavigation?.Description;
@@ -36,16 +37,18 @@ private static void MapLease((Entity.PimsLeaseTerm term, Entity.PimsLease lease,
dest.InspectionNotes = src.lease.InspectionNotes;
dest.InspectionDate = src.lease.InspectionDate?.FilterSqlMinDate();
dest.LeaseNotes = src.lease.LeaseNotes;
- dest.IsExpired = (src.lease.GetExpiryDate() < DateTime.Now).BoolToYesNo();
- dest.LeaseAmount = src.term?.PaymentAmount;
- dest.TermStartDate = src.term?.TermStartDate.FilterSqlMinDate().ToNullableDateOnly();
- dest.TermExpiryDate = src.term?.TermExpiryDate?.FilterSqlMinDate().ToNullableDateOnly();
- dest.TermRenewalDate = src.term?.TermRenewalDate?.FilterSqlMinDate().ToNullableDateOnly();
- dest.LeasePaymentFrequencyType = src.term?.LeasePmtFreqTypeCodeNavigation?.Description;
+ dest.IsExpired = (leaseExpiryDate < DateTime.Now).BoolToYesNo();
+ dest.LeaseAmount = src.period?.PaymentAmount;
+ dest.PeriodStartDate = src.period?.PeriodStartDate.FilterSqlMinDate().ToNullableDateOnly();
+ dest.PeriodExpiryDate = src.period?.PeriodExpiryDate?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.PeriodRenewalDate = src.period?.PeriodRenewalDate?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.LeasePaymentFrequencyType = src.period?.LeasePmtFreqTypeCodeNavigation?.Description;
dest.CivicAddress = src.property?.Property?.Address?.FormatAddress(true);
dest.Pid = src.property?.Property?.Pid;
dest.Pin = src.property?.Property?.Pin;
dest.TenantName = src.tenant?.GetTenantName();
+ dest.FinancialGain = src.lease.IsFinancialGain.BoolToYesNoUnknown();
+ dest.PublicBenefit = src.lease.IsPublicBenefit.BoolToYesNoUnknown();
}
}
}
diff --git a/source/backend/api/Areas/Reports/Mapping/Property/PropertyMap.cs b/source/backend/api/Areas/Reports/Mapping/Property/PropertyMap.cs
index 5574ff19b0..27e4736066 100644
--- a/source/backend/api/Areas/Reports/Mapping/Property/PropertyMap.cs
+++ b/source/backend/api/Areas/Reports/Mapping/Property/PropertyMap.cs
@@ -25,6 +25,24 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.LandArea, src => src.LandArea)
.Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription)
.Map(dest => dest.Zoning, src => src.Zoning);
+
+ config.NewConfig()
+ .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeCode)
+ .Map(dest => dest.ClassificationId, src => src.PropertyClassificationTypeCode)
+ .Map(dest => dest.Name, src => src.Name)
+ .Map(dest => dest.Description, src => src.Description)
+ .Map(dest => dest.Address, src => $"{src.StreetAddress1} {src.StreetAddress2} {src.StreetAddress3}")
+ .Map(dest => dest.Municipality, src => src.MunicipalityName)
+ .Map(dest => dest.Postal, src => src.PostalCode)
+ .Map(dest => dest.Latitude, src => src.Location.Coordinate.Y)
+ .Map(dest => dest.Longitude, src => src.Location.Coordinate.X)
+ .Map(dest => dest.IsSensitive, src => src.IsSensitive)
+
+ .Map(dest => dest.PID, src => src.PidPadded)
+ .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);
}
}
}
diff --git a/source/backend/api/Areas/Reports/Models/Lease/AggregatedLeaseModel.cs b/source/backend/api/Areas/Reports/Models/Lease/AggregatedLeaseModel.cs
index 974101bb47..ef6c0a61eb 100644
--- a/source/backend/api/Areas/Reports/Models/Lease/AggregatedLeaseModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Lease/AggregatedLeaseModel.cs
@@ -25,15 +25,15 @@ public AggregatedLeaseModel(IEnumerable leases, int fiscalYear, strin
DateTime fiscalYearStartDate = fiscalYear.ToFiscalYearDate();
DateTime fiscalYearEndDate = fiscalYearStartDate.AddYears(1);
- var terms = leases.SelectMany(l => l.PimsLeaseTerms).Where(t => t.TermStartDate <= fiscalYearEndDate
- && (t.TermExpiryDate >= fiscalYearStartDate || t.TermExpiryDate == null));
- var payments = terms.SelectMany(t => t.PimsLeasePayments).Where(p => p.PaymentReceivedDate <= fiscalYearEndDate && (p.PaymentReceivedDate >= fiscalYearStartDate));
+ var periods = leases.SelectMany(l => l.PimsLeasePeriods).Where(t => t.PeriodStartDate <= fiscalYearEndDate
+ && (t.PeriodExpiryDate >= fiscalYearStartDate || t.PeriodExpiryDate == null));
+ var payments = periods.SelectMany(t => t.PimsLeasePayments).Where(p => p.PaymentReceivedDate <= fiscalYearEndDate && (p.PaymentReceivedDate >= fiscalYearStartDate));
this.Region = region;
this.Program = program;
- AgreementCount = leases.Count(l => l.PimsLeaseTerms.Any(t => t.TermStartDate <= fiscalYearEndDate && (t.TermExpiryDate >= fiscalYearStartDate || t.TermExpiryDate == null)));
+ AgreementCount = leases.Count(l => l.PimsLeasePeriods.Any(t => t.PeriodStartDate <= fiscalYearEndDate && (t.PeriodExpiryDate >= fiscalYearStartDate || t.PeriodExpiryDate == null)));
ActualTotal = payments.Aggregate((decimal)0, (sum, payment) => sum + payment.PaymentAmountPreTax);
- ExpectedTotal = terms.Aggregate((decimal)0, (sum, term) => sum + term.PaymentAmount ?? 0);
+ ExpectedTotal = periods.Aggregate((decimal)0, (sum, period) => sum + period.PaymentAmount ?? 0);
ActualsByMonth = new decimal[12];
foreach (var (value, index) in ActualsByMonth.Select((value, index) => (value, index)))
{
diff --git a/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs b/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
index 57637c6589..c62d65d113 100644
--- a/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
@@ -27,7 +27,7 @@ public class LeaseModel
[DisplayName("Current Term Start Date")]
[CsvHelper.Configuration.Attributes.Name("Current Term Start Date")]
- public DateOnly? CurrentTermStartDate { get; set; }
+ public DateOnly? CurrentPeriodStartDate { get; set; }
[DisplayName("Current Term End Date")]
[CsvHelper.Configuration.Attributes.Name("Current Term End Date")]
@@ -79,15 +79,15 @@ public class LeaseModel
[DisplayName("Term Start Date")]
[CsvHelper.Configuration.Attributes.Name("Term Start Date")]
- public DateOnly? TermStartDate { get; set; }
+ public DateOnly? PeriodStartDate { get; set; }
[DisplayName("Term Renewal Date")]
[CsvHelper.Configuration.Attributes.Name("Term Renewal Date")]
- public DateOnly? TermRenewalDate { get; set; }
+ public DateOnly? PeriodRenewalDate { get; set; }
[DisplayName("Term Expiry Date")]
[CsvHelper.Configuration.Attributes.Name("Term Expiry Date")]
- public DateOnly? TermExpiryDate { get; set; }
+ public DateOnly? PeriodExpiryDate { get; set; }
[DisplayName("Lease Payment Frequency")]
[CsvHelper.Configuration.Attributes.Name("Lease Payment Frequency")]
@@ -112,6 +112,14 @@ public class LeaseModel
[DisplayName("Is Expired?")]
[CsvHelper.Configuration.Attributes.Name("Is Expired?")]
public string IsExpired { get; set; }
+
+ [DisplayName("Financial Gain?")]
+ [CsvHelper.Configuration.Attributes.Name("Financial Gain?")]
+ public string FinancialGain { get; set; }
+
+ [DisplayName("Public Benefit?")]
+ [CsvHelper.Configuration.Attributes.Name("Public Benefit?")]
+ public string PublicBenefit { get; set; }
#endregion
}
}
diff --git a/source/backend/api/Areas/Reports/Models/Property/PropertyModel.cs b/source/backend/api/Areas/Reports/Models/Property/PropertyModel.cs
index 250a2d4d03..3541a46d7f 100644
--- a/source/backend/api/Areas/Reports/Models/Property/PropertyModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Property/PropertyModel.cs
@@ -26,16 +26,6 @@ public class PropertyModel
///
public string Description { get; set; }
- ///
- /// get/set - The parent organization acronym.
- ///
- public string Ministry { get; set; }
-
- ///
- /// get/set - The owning organization full name.
- ///
- public string Organization { get; set; }
-
///
/// get/set - The civic address of the property.
///
diff --git a/source/backend/api/Controllers/LookupController.cs b/source/backend/api/Controllers/LookupController.cs
index 27f1e112db..0737428051 100644
--- a/source/backend/api/Controllers/LookupController.cs
+++ b/source/backend/api/Controllers/LookupController.cs
@@ -90,7 +90,7 @@ public IActionResult GetAll()
var leasePurposeTypes = _mapper.Map(_lookupRepository.GetAllLeasePurposeTypes());
var leaseResponsibilityTypes = _mapper.Map(_lookupRepository.GetAllLeaseResponsibilityTypes());
var leaseStatusTypes = _mapper.Map(_lookupRepository.GetAllLeaseStatusTypes());
- var leaseTermStatusTypes = _mapper.Map(_lookupRepository.GetAllLeaseTermStatusTypes());
+ var leasePeriodStatusTypes = _mapper.Map(_lookupRepository.GetAllLeasePeriodStatusTypes());
var leaseTypes = _mapper.Map(_lookupRepository.GetAllLeaseTypes());
var organizationTypes = _mapper.Map(_lookupRepository.GetAllOrganizationTypes());
var propertyImprovementTypes = _mapper.Map(_lookupRepository.GetAllPropertyImprovementTypes());
@@ -126,7 +126,7 @@ public IActionResult GetAll()
var takeSiteContamTypes = _mapper.Map(_lookupRepository.GetAllTakeSiteContamTypes());
var landActTypes = _mapper.Map(_lookupRepository.GetAllLandActTypes());
var acqChecklistSectionTypes = _mapper.Map(_lookupRepository.GetAllAcquisitionChecklistSectionTypes());
- var acqChecklistItemStatusTypes = _mapper.Map(_lookupRepository.GetAllAcquisitionChecklistItemStatusTypes());
+ var checklistItemStatusTypes = _mapper.Map(_lookupRepository.GetAllChecklistItemStatusTypes());
var agreementTypes = _mapper.Map(_lookupRepository.GetAllAgreementTypes());
var agreementStatusTypes = _mapper.Map(_lookupRepository.GetAllAgreementStatusTypes());
var interestHolderInterestTypes = _mapper.Map(_lookupRepository.GetAllInterestHolderInterestTypes());
@@ -143,12 +143,11 @@ public IActionResult GetAll()
var dispositionInitiatingDocTypes = _mapper.Map(_lookupRepository.GetAllDispositionInitiatingDocTypes());
var dispositionTypes = _mapper.Map(_lookupRepository.GetAllDispositionTypes());
var dispositionOfferStatusTypes = _mapper.Map(_lookupRepository.GetAllDispositionOfferStatusTypes());
- var dispositionChecklistItemStatusTypes = _mapper.Map(_lookupRepository.GetAllDispositionChecklistItemStatusTypes());
var dispositionChecklistItemTypes = _mapper.Map(_lookupRepository.GetAllDispositionChecklistItemTypes());
var dispositionChecklistSectionTypes = _mapper.Map(_lookupRepository.GetAllDispositionChecklistSectionTypes());
var historicalNumberTypes = _mapper.Map(_lookupRepository.GetAllHistoricalNumberTypes());
- var leaseChecklistStatusTypes = _mapper.Map(_lookupRepository.GetAllLeaseChecklistItemStatusTypes());
var leaseChecklistSectionTypes = _mapper.Map(_lookupRepository.GetAllLeaseChecklistSectionTypes());
+ var leasePaymentCategoryTypes = _mapper.Map(_lookupRepository.GetAllLeasePaymentCategoryTypes());
var codes = new List
[NotMapped]
- public string Id { get => AcqChklstItemStatusTypeCode; set => AcqChklstItemStatusTypeCode = value; }
+ public string Id { get => ChklstItemStatusTypeCode; set => ChklstItemStatusTypeCode = value; }
#endregion
#region Constructors
///
- /// Create a new instance of a PimsAcqChklstItemStatusType class.
+ /// Create a new instance of a PimsChklstItemStatusType class.
///
///
- public PimsAcqChklstItemStatusType(string id)
+ public PimsChklstItemStatusType(string id)
: this()
{
Id = id;
}
- public PimsAcqChklstItemStatusType()
+ public PimsChklstItemStatusType()
{
}
#endregion
diff --git a/source/backend/entities/Partials/DispositionFileProperty.cs b/source/backend/entities/Partials/DispositionFileProperty.cs
index b65847334a..38976f8629 100644
--- a/source/backend/entities/Partials/DispositionFileProperty.cs
+++ b/source/backend/entities/Partials/DispositionFileProperty.cs
@@ -5,7 +5,7 @@ namespace Pims.Dal.Entities
///
/// PimsDispositionFileProperty class, provides an entity for the datamodel to manage the relationship between the Disposition Files Properties.
///
- public partial class PimsDispositionFileProperty : StandardIdentityBaseAppEntity, IBaseAppEntity
+ public partial class PimsDispositionFileProperty : StandardIdentityBaseAppEntity, IBaseAppEntity, IFilePropertyEntity
{
#region Properties
[NotMapped]
diff --git a/source/backend/entities/Partials/DspChklstItemStatusType.cs b/source/backend/entities/Partials/DspChklstItemStatusType.cs
deleted file mode 100644
index 1122fbb513..0000000000
--- a/source/backend/entities/Partials/DspChklstItemStatusType.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System.ComponentModel.DataAnnotations.Schema;
-
-namespace Pims.Dal.Entities
-{
- ///
- /// PimsDspChklstItemStatusType class, provides an entity for the datamodel to manage a list of disposition checklist item status types.
- ///
- public partial class PimsDspChklstItemStatusType : ITypeEntity
- {
- #region Properties
-
- ///
- /// get/set - Primary key to identify this record.
- ///
- [NotMapped]
- public string Id { get => DspChklstItemStatusTypeCode; set => DspChklstItemStatusTypeCode = value; }
-
- #endregion
-
- #region Constructors
-
- ///
- /// Create a new instance of a PimsDspChklstItemStatusType class.
- ///
- ///
- public PimsDspChklstItemStatusType(string id)
- : this()
- {
- Id = id;
- }
-
- public PimsDspChklstItemStatusType()
- {
- }
- #endregion
- }
-}
diff --git a/source/backend/entities/Partials/LeaseChklstItemStatusType.cs b/source/backend/entities/Partials/LeaseChklstItemStatusType.cs
deleted file mode 100644
index 2a6c3a7d9e..0000000000
--- a/source/backend/entities/Partials/LeaseChklstItemStatusType.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System.ComponentModel.DataAnnotations.Schema;
-
-namespace Pims.Dal.Entities
-{
- ///
- /// PimsLeaseChklstItemStatusType class, provides an entity for the datamodel to manage a list of lease checklist item status types.
- ///
- public partial class PimsLeaseChklstItemStatusType : ITypeEntity
- {
- ///
- /// get/set - Primary key to identify this record.
- ///
- [NotMapped]
- public string Id { get => LeaseChklstItemStatusTypeCode; set => LeaseChklstItemStatusTypeCode = value; }
-
- ///
- /// Create a new instance of a PimsLeaseChklstItemStatusType class.
- ///
- ///
- public PimsLeaseChklstItemStatusType(string id)
- : this()
- {
- Id = id;
- }
-
- public PimsLeaseChklstItemStatusType()
- {
- }
- }
-}
diff --git a/source/backend/entities/Partials/LeasePaymentCategoryType.cs b/source/backend/entities/Partials/LeasePaymentCategoryType.cs
new file mode 100644
index 0000000000..8c1334d882
--- /dev/null
+++ b/source/backend/entities/Partials/LeasePaymentCategoryType.cs
@@ -0,0 +1,36 @@
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Pims.Dal.Entities
+{
+ ///
+ /// PimsLeasePaymentCategoryType class, provides an entity for the datamodel to manage a list of lease payment category types.
+ ///
+ public partial class PimsLeasePaymentCategoryType : ITypeEntity
+ {
+ #region Properties
+
+ ///
+ /// get/set - Primary key to identify lease payment frequency type.
+ ///
+ [NotMapped]
+ public string Id { get => LeasePaymentCategoryTypeCode; set => LeasePaymentCategoryTypeCode = value; }
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Create a new instance of a LeasePaymentFrequencyType class.
+ ///
+ ///
+ public PimsLeasePaymentCategoryType(string id)
+ : this()
+ {
+ Id = id;
+ }
+
+ public PimsLeasePaymentCategoryType()
+ {
+ }
+ #endregion
+ }
+}
diff --git a/source/backend/entities/Partials/LeasePeriod.cs b/source/backend/entities/Partials/LeasePeriod.cs
new file mode 100644
index 0000000000..3b3ef01684
--- /dev/null
+++ b/source/backend/entities/Partials/LeasePeriod.cs
@@ -0,0 +1,15 @@
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Pims.Dal.Entities
+{
+ ///
+ /// PimsLeasePeriod class, provides an entity for the datamodel to manage lease periods.
+ ///
+ public partial class PimsLeasePeriod : StandardIdentityBaseAppEntity, IBaseAppEntity
+ {
+ #region Properties
+ [NotMapped]
+ public override long Internal_Id { get => this.LeasePeriodId; set => this.LeasePeriodId = value; }
+ #endregion
+ }
+}
diff --git a/source/backend/entities/Partials/LeaseTermStatusType.cs b/source/backend/entities/Partials/LeasePeriodStatusType.cs
similarity index 71%
rename from source/backend/entities/Partials/LeaseTermStatusType.cs
rename to source/backend/entities/Partials/LeasePeriodStatusType.cs
index c04848dceb..52b03b8d3d 100644
--- a/source/backend/entities/Partials/LeaseTermStatusType.cs
+++ b/source/backend/entities/Partials/LeasePeriodStatusType.cs
@@ -5,7 +5,7 @@ namespace Pims.Dal.Entities
///
/// InsuranceType class, provides an entity for the datamodel to manage a list of insurance types.
///
- public partial class PimsLeaseTermStatusType : ITypeEntity
+ public partial class PimsLeasePeriodStatusType : ITypeEntity
{
#region Properties
@@ -13,7 +13,7 @@ public partial class PimsLeaseTermStatusType : ITypeEntity
/// get/set - Primary key to identify insurance type.
///
[NotMapped]
- public string Id { get => LeaseTermStatusTypeCode; set => LeaseTermStatusTypeCode = value; }
+ public string Id { get => LeasePeriodStatusTypeCode; set => LeasePeriodStatusTypeCode = value; }
#endregion
#region Constructors
@@ -22,18 +22,18 @@ public partial class PimsLeaseTermStatusType : ITypeEntity
/// Create a new instance of a InsuranceType class.
///
///
- public PimsLeaseTermStatusType(string id)
+ public PimsLeasePeriodStatusType(string id)
: this()
{
Id = id;
}
- public PimsLeaseTermStatusType()
+ public PimsLeasePeriodStatusType()
{
}
#endregion
- public static class LeaseTermStatusTypes
+ public static class LeasePeriodStatusTypes
{
public const string EXER = "EXER";
public const string NEXER = "NEXER";
diff --git a/source/backend/entities/Partials/LeaseRenewal.cs b/source/backend/entities/Partials/LeaseRenewal.cs
new file mode 100644
index 0000000000..7787850256
--- /dev/null
+++ b/source/backend/entities/Partials/LeaseRenewal.cs
@@ -0,0 +1,16 @@
+
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Pims.Dal.Entities
+{
+ ///
+ /// Lease Renewal class, provides an entity for the datamodel to manage leases renewals.
+ ///
+ public partial class PimsLeaseRenewal : StandardIdentityBaseAppEntity, IBaseAppEntity
+ {
+ #region Properties
+ [NotMapped]
+ public override long Internal_Id { get => this.LeaseRenewalId; set => this.LeaseRenewalId = value; }
+ #endregion
+ }
+}
diff --git a/source/backend/entities/Partials/LeaseTerm.cs b/source/backend/entities/Partials/LeaseTerm.cs
deleted file mode 100644
index 22ade60d53..0000000000
--- a/source/backend/entities/Partials/LeaseTerm.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.ComponentModel.DataAnnotations.Schema;
-
-namespace Pims.Dal.Entities
-{
- ///
- /// PimsLeaseTerm class, provides an entity for the datamodel to manage lease terms.
- ///
- public partial class PimsLeaseTerm : StandardIdentityBaseAppEntity, IBaseAppEntity
- {
- #region Properties
- [NotMapped]
- public override long Internal_Id { get => this.LeaseTermId; set => this.LeaseTermId = value; }
- #endregion
- }
-}
diff --git a/source/backend/entities/Partials/PimsPropAcqFlCompReq.cs b/source/backend/entities/Partials/PimsPropAcqFlCompReq.cs
new file mode 100644
index 0000000000..427eff8e45
--- /dev/null
+++ b/source/backend/entities/Partials/PimsPropAcqFlCompReq.cs
@@ -0,0 +1,10 @@
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Pims.Dal.Entities
+{
+ public partial class PimsPropAcqFlCompReq : StandardIdentityBaseAppEntity, IBaseAppEntity
+ {
+ [NotMapped]
+ public override long Internal_Id { get => PropAcqFlCompReqId; set => PropAcqFlCompReqId = value; }
+ }
+}
diff --git a/source/backend/entities/Partials/PropertyAcquisitionFile.cs b/source/backend/entities/Partials/PropertyAcquisitionFile.cs
index c37412fc17..2c4bc53e08 100644
--- a/source/backend/entities/Partials/PropertyAcquisitionFile.cs
+++ b/source/backend/entities/Partials/PropertyAcquisitionFile.cs
@@ -5,7 +5,7 @@ namespace Pims.Dal.Entities
///
/// PimsPropertyAcquisitionFile class, provides an entity for the datamodel to manage the relationship between Properties and Acquisition Files.
///
- public partial class PimsPropertyAcquisitionFile : StandardIdentityBaseAppEntity, IBaseAppEntity
+ public partial class PimsPropertyAcquisitionFile : StandardIdentityBaseAppEntity, IBaseAppEntity, IFilePropertyEntity
{
#region Properties
[NotMapped]
diff --git a/source/backend/entities/Partials/PropertyLease.cs b/source/backend/entities/Partials/PropertyLease.cs
index 498ea5ce83..d6b3c643ef 100644
--- a/source/backend/entities/Partials/PropertyLease.cs
+++ b/source/backend/entities/Partials/PropertyLease.cs
@@ -6,7 +6,7 @@ namespace Pims.Dal.Entities
///
/// PimsPropertyLease class, provides the many-to-many relationship between leases and properties.
///
- public partial class PimsPropertyLease : StandardIdentityBaseAppEntity, IBaseAppEntity
+ public partial class PimsPropertyLease : StandardIdentityBaseAppEntity, IBaseAppEntity, IFilePropertyEntity
{
#region Properties
[NotMapped]
diff --git a/source/backend/entities/Partials/PropertyResearchFile.cs b/source/backend/entities/Partials/PropertyResearchFile.cs
index 2500c9de6b..6a31aa66c4 100644
--- a/source/backend/entities/Partials/PropertyResearchFile.cs
+++ b/source/backend/entities/Partials/PropertyResearchFile.cs
@@ -5,7 +5,7 @@ namespace Pims.Dal.Entities
///
/// PimsPropertyResearchFile class, provides an entity for the datamodel to manage the relationship between Properties and Research Files.
///
- public partial class PimsPropertyResearchFile : StandardIdentityBaseAppEntity, IBaseAppEntity
+ public partial class PimsPropertyResearchFile : StandardIdentityBaseAppEntity, IBaseAppEntity, IFilePropertyEntity
{
#region Properties
[NotMapped]
diff --git a/source/backend/entities/Partials/base/IBaseTypeEntity{T_Id,T_DisplayOrder}.cs b/source/backend/entities/Partials/base/IBaseTypeEntity{T_Id,T_DisplayOrder}.cs
index 9e0ebb0b5e..15b8ec65a1 100644
--- a/source/backend/entities/Partials/base/IBaseTypeEntity{T_Id,T_DisplayOrder}.cs
+++ b/source/backend/entities/Partials/base/IBaseTypeEntity{T_Id,T_DisplayOrder}.cs
@@ -1,5 +1,3 @@
-using System;
-
namespace Pims.Dal.Entities
{
public interface IBaseTypeEntity
diff --git a/source/backend/entities/Partials/base/IFilePropertyEntity.cs b/source/backend/entities/Partials/base/IFilePropertyEntity.cs
new file mode 100644
index 0000000000..72d38e1873
--- /dev/null
+++ b/source/backend/entities/Partials/base/IFilePropertyEntity.cs
@@ -0,0 +1,25 @@
+using NetTopologySuite.Geometries;
+
+namespace Pims.Dal.Entities
+{
+ ///
+ /// An interface for entities that have an associated PimsProperty (ie - LeaseProperty, ResearchProperty, AcquisitionProperty, DispositionProperty, etc).
+ ///
+ public interface IFilePropertyEntity
+ {
+ ///
+ /// get/set - The property entity for this relationship.
+ ///
+ PimsProperty Property { get; set; }
+
+ ///
+ /// get/set - The property id.
+ ///
+ long PropertyId { get; set; }
+
+ ///
+ /// Geo-spatial location (pin) of property.
+ ///
+ public Geometry Location { get; set; }
+ }
+}
diff --git a/source/backend/entities/PimsBaseContext.cs b/source/backend/entities/PimsBaseContext.cs
index de2139e44d..64a6752c9c 100644
--- a/source/backend/entities/PimsBaseContext.cs
+++ b/source/backend/entities/PimsBaseContext.cs
@@ -22,8 +22,6 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsAccessRequestStatusTypes { get; set; }
- public virtual DbSet PimsAcqChklstItemStatusTypes { get; set; }
-
public virtual DbSet PimsAcqChklstItemTypes { get; set; }
public virtual DbSet PimsAcqChklstSectionTypes { get; set; }
@@ -90,6 +88,8 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsChartOfAccountsCodeHists { get; set; }
+ public virtual DbSet PimsChklstItemStatusTypes { get; set; }
+
public virtual DbSet PimsClaims { get; set; }
public virtual DbSet PimsClaimHists { get; set; }
@@ -192,8 +192,6 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsDocumentTypHists { get; set; }
- public virtual DbSet PimsDspChklstItemStatusTypes { get; set; }
-
public virtual DbSet PimsDspChklstItemTypes { get; set; }
public virtual DbSet PimsDspChklstSectionTypes { get; set; }
@@ -270,8 +268,6 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsLeaseChecklistItemHists { get; set; }
- public virtual DbSet PimsLeaseChklstItemStatusTypes { get; set; }
-
public virtual DbSet PimsLeaseChklstItemTypes { get; set; }
public virtual DbSet PimsLeaseChklstSectionTypes { get; set; }
@@ -298,18 +294,30 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsLeasePayments { get; set; }
+ public virtual DbSet PimsLeasePaymentCategoryTypes { get; set; }
+
public virtual DbSet PimsLeasePaymentHists { get; set; }
public virtual DbSet PimsLeasePaymentMethodTypes { get; set; }
public virtual DbSet PimsLeasePaymentStatusTypes { get; set; }
+ public virtual DbSet PimsLeasePeriods { get; set; }
+
+ public virtual DbSet PimsLeasePeriodHists { get; set; }
+
+ public virtual DbSet PimsLeasePeriodStatusTypes { get; set; }
+
public virtual DbSet PimsLeasePmtFreqTypes { get; set; }
public virtual DbSet PimsLeaseProgramTypes { get; set; }
public virtual DbSet PimsLeasePurposeTypes { get; set; }
+ public virtual DbSet PimsLeaseRenewals { get; set; }
+
+ public virtual DbSet PimsLeaseRenewalHists { get; set; }
+
public virtual DbSet PimsLeaseResponsibilityTypes { get; set; }
public virtual DbSet PimsLeaseStatusTypes { get; set; }
@@ -318,12 +326,6 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsLeaseTenantHists { get; set; }
- public virtual DbSet PimsLeaseTerms { get; set; }
-
- public virtual DbSet PimsLeaseTermHists { get; set; }
-
- public virtual DbSet PimsLeaseTermStatusTypes { get; set; }
-
public virtual DbSet PimsLessorTypes { get; set; }
public virtual DbSet PimsLetterTypes { get; set; }
@@ -392,6 +394,10 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsProjectStatusTypes { get; set; }
+ public virtual DbSet PimsPropAcqFlCompReqs { get; set; }
+
+ public virtual DbSet PimsPropAcqFlCompReqHists { get; set; }
+
public virtual DbSet PimsPropActInvolvedParties { get; set; }
public virtual DbSet PimsPropActInvolvedPartyHists { get; set; }
@@ -708,28 +714,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
});
- modelBuilder.Entity(entity =>
- {
- entity.HasKey(e => e.AcqChklstItemStatusTypeCode).HasName("ACQCST_PK");
-
- entity.ToTable("PIMS_ACQ_CHKLST_ITEM_STATUS_TYPE", tb =>
- {
- tb.HasComment("Tables that contains the codes and associated descriptions of the acquisition checklist item status types.");
- tb.HasTrigger("PIMS_ACQCST_I_S_I_TR");
- tb.HasTrigger("PIMS_ACQCST_I_S_U_TR");
- });
-
- entity.Property(e => e.AcqChklstItemStatusTypeCode).HasComment("Codified version of the acquisition checklist item status type.");
- entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
- entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.Description).HasComment("Description of the acquisition checklist item status type.");
- entity.Property(e => e.DisplayOrder).HasComment("Display order of the codes.");
- entity.Property(e => e.IsDisabled).HasComment("Indicates if the code value is inactive.");
- });
-
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.AcqChklstItemTypeCode).HasName("ACQCIT_PK");
@@ -851,21 +835,22 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.AppLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.AppLastUpdateUserDirectory).HasDefaultValueSql("(user_name())");
entity.Property(e => e.AppLastUpdateUserid).HasDefaultValueSql("(user_name())");
+ entity.Property(e => e.ChklstItemStatusTypeCode).HasComment("Foreign key to the PIMS_CHKLST_ITEM_STATUS_TYPE table.");
entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
- entity.HasOne(d => d.AcqChklstItemStatusTypeCodeNavigation).WithMany(p => p.PimsAcquisitionChecklistItems)
- .OnDelete(DeleteBehavior.ClientSetNull)
- .HasConstraintName("PIM_ACQCST_PIM_ACQCKI_FK");
-
entity.HasOne(d => d.AcqChklstItemTypeCodeNavigation).WithMany(p => p.PimsAcquisitionChecklistItems).HasConstraintName("PIM_ACQCIT_PIM_ACQCKI_FK");
entity.HasOne(d => d.AcquisitionFile).WithMany(p => p.PimsAcquisitionChecklistItems)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_ACQNFL_PIM_ACQCKI_FK");
+
+ entity.HasOne(d => d.ChklstItemStatusTypeCodeNavigation).WithMany(p => p.PimsAcquisitionChecklistItems)
+ .OnDelete(DeleteBehavior.ClientSetNull)
+ .HasConstraintName("PIM_CHKLIS_PIM_ACQCKI_FK");
});
modelBuilder.Entity(entity =>
@@ -1518,6 +1503,38 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.ChklstItemStatusTypeCode).HasName("CHKLIS_PK");
+
+ entity.ToTable("PIMS_CHKLST_ITEM_STATUS_TYPE", tb =>
+ {
+ tb.HasComment("Common table that contains the codes and associated descriptions of the various checklist item status types.");
+ tb.HasTrigger("PIMS_CHKLIS_I_S_I_TR");
+ tb.HasTrigger("PIMS_CHKLIS_I_S_U_TR");
+ });
+
+ entity.Property(e => e.ChklstItemStatusTypeCode).HasComment("Codified version of the various checklist item status types.");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
+ entity.Property(e => e.Description).HasComment("Description of the various checklist item status type.");
+ entity.Property(e => e.DisplayOrder).HasComment("Display order of the codes.");
+ entity.Property(e => e.IsDisabled).HasComment("Indicates if the code value is inactive.");
+ });
+
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.ClaimId).HasName("CLMTYP_PK");
@@ -1977,6 +1994,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.AppLastUpdateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user that updated the record.");
+ entity.Property(e => e.ChklstItemStatusTypeCode).HasComment("Foreign key to the PIMS_CHKLST_ITEM_STATUS_TYPE table.");
entity.Property(e => e.ConcurrencyControlNumber)
.HasDefaultValue(1L)
.HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any");
@@ -1993,18 +2011,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created or last updated the record.");
entity.Property(e => e.DispositionFileId).HasComment("Foreign key of the disposition file.");
- entity.Property(e => e.DspChklstItemStatusTypeCode)
- .HasDefaultValue("INCOMP")
- .HasComment("Code value for the checklist item status.");
entity.Property(e => e.DspChklstItemTypeCode).HasComment("Code value for the checklist item.");
- entity.HasOne(d => d.DispositionFile).WithMany(p => p.PimsDispositionChecklistItems)
+ entity.HasOne(d => d.ChklstItemStatusTypeCodeNavigation).WithMany(p => p.PimsDispositionChecklistItems)
.OnDelete(DeleteBehavior.ClientSetNull)
- .HasConstraintName("PIM_DISPFL_PIM_DSPCKI_FK");
+ .HasConstraintName("PIM_CHKLIS_PIM_DSPCKI_FK");
- entity.HasOne(d => d.DspChklstItemStatusTypeCodeNavigation).WithMany(p => p.PimsDispositionChecklistItems)
+ entity.HasOne(d => d.DispositionFile).WithMany(p => p.PimsDispositionChecklistItems)
.OnDelete(DeleteBehavior.ClientSetNull)
- .HasConstraintName("PIM_DSPCST_PIM_DSPCKI_FK");
+ .HasConstraintName("PIM_DISPFL_PIM_DSPCKI_FK");
entity.HasOne(d => d.DspChklstItemTypeCodeNavigation).WithMany(p => p.PimsDispositionChecklistItems).HasConstraintName("PIM_DSPCIT_PIM_DSPCKI_FK");
});
@@ -2314,6 +2329,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created or last updated the record.");
entity.Property(e => e.DispositionFileId).HasComment("Primary key of the associated disposition file.");
+ entity.Property(e => e.Location).HasComment("Geospatial location (pin) of property");
entity.Property(e => e.PropertyId).HasComment("Primary key of the associated property.");
entity.Property(e => e.PropertyName).HasComment("Descriptive reference for the property associated with the disposition file.");
@@ -3052,38 +3068,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});
- modelBuilder.Entity(entity =>
- {
- entity.HasKey(e => e.DspChklstItemStatusTypeCode).HasName("DSPCST_PK");
-
- entity.ToTable("PIMS_DSP_CHKLST_ITEM_STATUS_TYPE", tb =>
- {
- tb.HasComment("Tables that contains the codes and associated descriptions of the disposition checklist item status types.");
- tb.HasTrigger("PIMS_DSPCST_I_S_I_TR");
- tb.HasTrigger("PIMS_DSPCST_I_S_U_TR");
- });
-
- entity.Property(e => e.DspChklstItemStatusTypeCode).HasComment("Codified version of the disposition checklist item status type.");
- entity.Property(e => e.ConcurrencyControlNumber)
- .HasDefaultValue(1L)
- .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any");
- entity.Property(e => e.DbCreateTimestamp)
- .HasDefaultValueSql("(getutcdate())")
- .HasComment("The date and time the record was created.");
- entity.Property(e => e.DbCreateUserid)
- .HasDefaultValueSql("(user_name())")
- .HasComment("The user or proxy account that created the record.");
- entity.Property(e => e.DbLastUpdateTimestamp)
- .HasDefaultValueSql("(getutcdate())")
- .HasComment("The date and time the record was created or last updated.");
- entity.Property(e => e.DbLastUpdateUserid)
- .HasDefaultValueSql("(user_name())")
- .HasComment("The user or proxy account that created or last updated the record.");
- entity.Property(e => e.Description).HasComment("Description of the disposition checklist item status type.");
- entity.Property(e => e.DisplayOrder).HasComment("Display order of the codes.");
- entity.Property(e => e.IsDisabled).HasComment("Indicates if the code value is inactive.");
- });
-
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.DspChklstItemTypeCode).HasName("DSPCIT_PK");
@@ -3810,8 +3794,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasComment("The user or proxy account that updated the record.");
entity.Property(e => e.ExpiryDate).HasComment("Date the insurance expires");
entity.Property(e => e.InsuranceTypeCode).HasComment("Foreign key indicating the type of insurance on the lease.");
- entity.Property(e => e.IsInsuranceInPlace)
- .HasComment("Indicator that insurance is in place. TRUE if insurance is in place, FALSE if insurance is not in place, and NULL if it is unknown if insurance is in place.");
+ entity.Property(e => e.IsInsuranceInPlace).HasComment("Indicator that insurance is in place. TRUE if insurance is in place, FALSE if insurance is not in place, and NULL if it is unknown if insurance is in place.");
entity.Property(e => e.LeaseId).HasComment("Foreign key to the PIMS_LEASE table.");
entity.Property(e => e.OtherInsuranceType).HasComment("Description of the non-standard insurance coverage type");
@@ -4082,6 +4065,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created or last updated the record.");
entity.Property(e => e.DocumentationReference).HasComment("Location of documents pertianing to the lease/license");
+ entity.Property(e => e.FeeDeterminationNote).HasComment("Note associated with fee determination.");
entity.Property(e => e.HasDigitalFile).HasComment("Indicator that digital file exists");
entity.Property(e => e.HasDigitalLicense).HasComment("Indicator that digital license exists");
entity.Property(e => e.HasPhysicalFile).HasComment("Indicator that phyical file exists");
@@ -4092,9 +4076,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasDefaultValue(false)
.HasComment("Is a commercial building");
entity.Property(e => e.IsExpired).HasComment("Incidcator that lease/license has expired");
+ entity.Property(e => e.IsFinancialGain).HasComment("Is there an associated financial gain with this lease? TRUE = Yes, FALSE = No, and NULL = Unknown. The default is NULL (Unknown).");
entity.Property(e => e.IsOtherImprovement)
.HasDefaultValue(false)
.HasComment("Is improvement of another description");
+ entity.Property(e => e.IsPublicBenefit).HasComment("Is there an associated public benefit with this lease? TRUE = Yes, FALSE = No, and NULL = Unknown. The default is NULL (Unknown).");
entity.Property(e => e.IsSubjectToRta)
.HasDefaultValue(false)
.HasComment("Is subject the Residential Tenancy Act");
@@ -4118,11 +4104,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.OtherLeaseLicenseType).HasComment("Description of a non-standard lease/license type");
entity.Property(e => e.OtherLeaseProgramType).HasComment("Description of a non-standard lease program type");
entity.Property(e => e.OtherLeasePurposeType).HasComment("Description of a non-standard lease purpose type");
+ entity.Property(e => e.PrimaryArbitrationCity).HasComment("The location in which primary arbtration of the lease occurred.");
entity.Property(e => e.ProjectId).HasComment("Foreign key to the PIMS_PROJECT table.");
entity.Property(e => e.PsFileNo).HasComment("Sourced from t_fileSubOverrideData.PSFile_No");
entity.Property(e => e.RegionCode).HasComment("Foreign key to the PIMS_REGION table.");
entity.Property(e => e.ResponsibilityEffectiveDate).HasComment("Date current responsibility came into effect for this lease");
entity.Property(e => e.ReturnNotes).HasComment("Notes accompanying lease");
+ entity.Property(e => e.TerminationDate).HasComment("Date that the lease was terminated.");
entity.Property(e => e.TerminationReason).HasComment("Reason for the termination of the lease. For example, \"The tenant is in violation of the terms of the agreement.\"");
entity.Property(e => e.TfaFileNo).HasComment("Sourced from t_fileMain.TFA_File_Number");
entity.Property(e => e.TfaFileNumber).HasComment("Sourced from t_fileMain.TFA_File_Number || - || t_fileSub.Subfile_Sequence_Code");
@@ -4210,6 +4198,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.AppLastUpdateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user account that updated the record.");
+ entity.Property(e => e.ChklstItemStatusTypeCode)
+ .HasDefaultValue("INCOMP")
+ .HasComment("Foreign key to the PIMS_CHKLST_ITEM_STATUS_TYPE table.");
entity.Property(e => e.ConcurrencyControlNumber)
.HasDefaultValue(1L)
.HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
@@ -4225,13 +4216,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.DbLastUpdateUserid)
.HasDefaultValueSql("(user_name())")
.HasComment("The user or proxy account that created or last updated the record.");
- entity.Property(e => e.LeaseChklstItemStatusTypeCode)
- .HasDefaultValue("INCOMP")
- .HasComment("Foreign key to the PIMS_LEASE_CHKLST_ITEM_STATUS_TYPE table.");
entity.Property(e => e.LeaseChklstItemTypeCode).HasComment("Foreign key to the PIMS_LEASE_CHKLST_ITEM_TYPE table.");
entity.Property(e => e.LeaseId).HasComment("Foreign key to the PIMS_LEASE table.");
- entity.HasOne(d => d.LeaseChklstItemStatusTypeCodeNavigation).WithMany(p => p.PimsLeaseChecklistItems)
+ entity.HasOne(d => d.ChklstItemStatusTypeCodeNavigation).WithMany(p => p.PimsLeaseChecklistItems)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_LCISTY_PIM_LCHKLI_FK");
@@ -4252,38 +4240,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});
- modelBuilder.Entity(entity =>
- {
- entity.HasKey(e => e.LeaseChklstItemStatusTypeCode).HasName("LCISTY_PK");
-
- entity.ToTable("PIMS_LEASE_CHKLST_ITEM_STATUS_TYPE", tb =>
- {
- tb.HasComment("Tables that contains the codes and associated descriptions of the lease & license checklist item status types.");
- tb.HasTrigger("PIMS_LCISTY_I_S_I_TR");
- tb.HasTrigger("PIMS_LCISTY_I_S_U_TR");
- });
-
- entity.Property(e => e.LeaseChklstItemStatusTypeCode).HasComment("Codified version of the lease & license checklist item status type.");
- entity.Property(e => e.ConcurrencyControlNumber)
- .HasDefaultValue(1L)
- .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
- entity.Property(e => e.DbCreateTimestamp)
- .HasDefaultValueSql("(getutcdate())")
- .HasComment("The date and time the record was created.");
- entity.Property(e => e.DbCreateUserid)
- .HasDefaultValueSql("(user_name())")
- .HasComment("The user or proxy account that created the record.");
- entity.Property(e => e.DbLastUpdateTimestamp)
- .HasDefaultValueSql("(getutcdate())")
- .HasComment("The date and time the record was created or last updated.");
- entity.Property(e => e.DbLastUpdateUserid)
- .HasDefaultValueSql("(user_name())")
- .HasComment("The user or proxy account that created or last updated the record.");
- entity.Property(e => e.Description).HasComment("Description of the lease & license checklist item status type.");
- entity.Property(e => e.DisplayOrder).HasComment("Display order of the codes.");
- entity.Property(e => e.IsDisabled).HasComment("Indicates if the code value is inactive.");
- });
-
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.LeaseChklstItemTypeCode).HasName("LCKITY_PK");
@@ -4573,18 +4529,49 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
tb.HasTrigger("PIMS_LSPYMT_I_S_U_TR");
});
- entity.Property(e => e.LeasePaymentId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_PAYMENT_ID_SEQ])");
- entity.Property(e => e.AppCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.AppCreateUserDirectory).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.AppLastUpdateUserDirectory).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppLastUpdateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
- entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
+ entity.Property(e => e.LeasePaymentId)
+ .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_PAYMENT_ID_SEQ])")
+ .HasComment("Generated surrogate primary key.");
+ entity.Property(e => e.AppCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user created the record.");
+ entity.Property(e => e.AppCreateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserGuid).HasComment("The GUID of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that created the record.");
+ entity.Property(e => e.AppLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user updated the record.");
+ entity.Property(e => e.AppLastUpdateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserGuid).HasComment("The GUID of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that updated the record.");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
+ entity.Property(e => e.LeasePaymentCategoryTypeCode).HasComment("Foreign key reference to the PIMS_LEASE_PAYMENT_CATEGORY_TYPE_CODE table.");
+ entity.Property(e => e.LeasePaymentMethodTypeCode).HasComment("Foreign key reference to the PIMS_LEASE_PAYMENT_METHOD_TYPE_CODE table.");
+ entity.Property(e => e.LeasePaymentStatusTypeCode).HasComment("Foreign key reference to the PIMS_LEASE_PAYMENT_STATUS_TYPE_CODE table.");
+ entity.Property(e => e.LeasePeriodId).HasComment("Foreign key reference to the PIMS_LEASE_PERIOD table.");
+ entity.Property(e => e.LeasePmtFreqTypeCode).HasComment("Foreign key reference to the PIMS_LEASE_PMT_FREQ_TYPE_CODE table.");
entity.Property(e => e.Note).HasComment("Notes regarding this payment");
entity.Property(e => e.PaymentAmountGst).HasComment("GST owing on payment if applicable");
entity.Property(e => e.PaymentAmountPreTax).HasComment("Principal amount of the payment before applicable taxes");
@@ -4592,15 +4579,51 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.PaymentAmountTotal).HasComment("Total amount of payment including principal plus all applicable taxes");
entity.Property(e => e.PaymentReceivedDate).HasComment("Date the payment was received or sent");
+ entity.HasOne(d => d.LeasePaymentCategoryTypeCodeNavigation).WithMany(p => p.PimsLeasePayments).HasConstraintName("PIM_LPCATT_PIM_LSPYMT_FK");
+
entity.HasOne(d => d.LeasePaymentMethodTypeCodeNavigation).WithMany(p => p.PimsLeasePayments)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_LSPMMT_PIM_LSPYMT_FK");
entity.HasOne(d => d.LeasePaymentStatusTypeCodeNavigation).WithMany(p => p.PimsLeasePayments).HasConstraintName("PIM_LPSTST_PIM_LSPYMT_FK");
- entity.HasOne(d => d.LeaseTerm).WithMany(p => p.PimsLeasePayments)
+ entity.HasOne(d => d.LeasePeriod).WithMany(p => p.PimsLeasePayments)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_LSTERM_PIM_LSPYMT_FK");
+
+ entity.HasOne(d => d.LeasePmtFreqTypeCodeNavigation).WithMany(p => p.PimsLeasePayments).HasConstraintName("PIM_LSPMTF_PIM_LSPYMT_FK");
+ });
+
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.LeasePaymentCategoryTypeCode).HasName("LPCATT_PK");
+
+ entity.ToTable("PIMS_LEASE_PAYMENT_CATEGORY_TYPE", tb =>
+ {
+ tb.HasComment("Describes the category of the lease payment (currently Base, Additional, or Variable).");
+ tb.HasTrigger("PIMS_LPCATT_I_S_I_TR");
+ tb.HasTrigger("PIMS_LPCATT_I_S_U_TR");
+ });
+
+ entity.Property(e => e.LeasePaymentCategoryTypeCode).HasComment("Payment category type code.");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
+ entity.Property(e => e.Description).HasComment("Payment category type description.");
+ entity.Property(e => e.DisplayOrder).HasComment("Display order of the descriptions");
+ entity.Property(e => e.IsDisabled).HasComment("Indicates that the record is disabled.");
});
modelBuilder.Entity(entity =>
@@ -4655,6 +4678,132 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.IsDisabled).HasComment("Is this code disabled?");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.LeasePeriodId).HasName("LSPERD_PK");
+
+ entity.ToTable("PIMS_LEASE_PERIOD", tb =>
+ {
+ tb.HasComment("Describes a duration period for the associated lease.");
+ tb.HasTrigger("PIMS_LSPERD_A_S_IUD_TR");
+ tb.HasTrigger("PIMS_LSPERD_I_S_I_TR");
+ tb.HasTrigger("PIMS_LSPERD_I_S_U_TR");
+ });
+
+ entity.Property(e => e.LeasePeriodId)
+ .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_PERIOD_ID_SEQ])")
+ .HasComment("Generated surrogate primary key.");
+ entity.Property(e => e.AddlRentAgreedPmt).HasComment("Indicates the agreed-to variable additional rent payment amount.");
+ entity.Property(e => e.AddlRentFreq).HasComment("Foreign key reference to the PIMS_LEASE_PMT_FREQ_TYPE table.");
+ entity.Property(e => e.AddlRentGstAmount).HasComment("GST dollar amount for the additional rent.");
+ entity.Property(e => e.AppCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user created the record.");
+ entity.Property(e => e.AppCreateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserGuid).HasComment("The GUID of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that created the record.");
+ entity.Property(e => e.AppLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user updated the record.");
+ entity.Property(e => e.AppLastUpdateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserGuid).HasComment("The GUID of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that updated the record.");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
+ entity.Property(e => e.GstAmount).HasComment("Calculated/entered GST portion of the payment. Can be overridden by the user.");
+ entity.Property(e => e.IsAddlRentSubjectToGst).HasComment("Is the variable additional rent payment subject to GST?");
+ entity.Property(e => e.IsFlexibleDuration).HasComment("Indicates whether the period duration is fixed (FALSE) or flexible (TRUE). Fixed (FALSE) is the default value.");
+ entity.Property(e => e.IsGstEligible).HasComment("Is the lease subject to GST?");
+ entity.Property(e => e.IsPeriodExercised).HasComment("Has the lease period been exercised?");
+ entity.Property(e => e.IsVariablePayment).HasComment("Indicates whether the payment type is predetermined (FALSE) or variable (TRUE). Predetermined (FALSE) is the default value.");
+ entity.Property(e => e.IsVblRentSubjectToGst).HasComment("Is the variable rent payment subject to GST?");
+ entity.Property(e => e.LeaseId).HasComment("Foreign key reference to the PIMS_LEASE table.");
+ entity.Property(e => e.LeasePeriodStatusTypeCode).HasComment("Foreign key reference to the PIMS_LEASE_PERIOD_STATUS_TYPE table.");
+ entity.Property(e => e.LeasePmtFreqTypeCode).HasComment("Foreign key reference to the PIMS_LEASE_PMT_FREQ_TYPE table.");
+ entity.Property(e => e.PaymentAmount).HasComment("Agreed-to payment amount (exclusive of GST)");
+ entity.Property(e => e.PaymentDueDate).HasComment("Anecdotal description of payment due date (e.g. 1st of month, end of month)");
+ entity.Property(e => e.PaymentNote).HasComment("Notes regarding payment status for the lease period");
+ entity.Property(e => e.PeriodExpiryDate).HasComment("Expiry date of the current period of the lease/licence");
+ entity.Property(e => e.PeriodRenewalDate).HasComment("Renewal date of the current period of the lease/licence");
+ entity.Property(e => e.PeriodStartDate).HasComment("Start date of the current period of the lease/licence");
+ entity.Property(e => e.VblRentAgreedPmt).HasComment("Indicates the agreed-to variable rent payment amount.");
+ entity.Property(e => e.VblRentFreq).HasComment("Foreign key reference to the PIMS_LEASE_PMT_FREQ_TYPE table.");
+ entity.Property(e => e.VblRentGstAmount).HasComment("GST dollar amount for the variable rent.");
+
+ entity.HasOne(d => d.AddlRentFreqNavigation).WithMany(p => p.PimsLeasePeriodAddlRentFreqNavigations).HasConstraintName("PIM_LSPMTF_ADDL_RENT_FREQ_FK");
+
+ entity.HasOne(d => d.Lease).WithMany(p => p.PimsLeasePeriods)
+ .OnDelete(DeleteBehavior.ClientSetNull)
+ .HasConstraintName("PIM_LEASE_PIM_LSTERM_FK");
+
+ entity.HasOne(d => d.LeasePeriodStatusTypeCodeNavigation).WithMany(p => p.PimsLeasePeriods).HasConstraintName("PIM_LTRMST_PIM_LSTERM_FK");
+
+ entity.HasOne(d => d.LeasePmtFreqTypeCodeNavigation).WithMany(p => p.PimsLeasePeriodLeasePmtFreqTypeCodeNavigations).HasConstraintName("PIM_LSPMTF_PIM_LSTERM_FK");
+
+ entity.HasOne(d => d.VblRentFreqNavigation).WithMany(p => p.PimsLeasePeriodVblRentFreqNavigations).HasConstraintName("PIM_LSPMTF_VBL_RENT_FREQ_FK");
+ });
+
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.LeasePeriodHistId).HasName("PIMS_LSPERD_H_PK");
+
+ entity.Property(e => e.LeasePeriodHistId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_PERIOD_H_ID_SEQ])");
+ entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
+ });
+
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.LeasePeriodStatusTypeCode).HasName("LSPRST_PK");
+
+ entity.ToTable("PIMS_LEASE_PERIOD_STATUS_TYPE", tb =>
+ {
+ tb.HasComment("Describes the status of the lease period.");
+ tb.HasTrigger("PIMS_LSPRST_I_S_I_TR");
+ tb.HasTrigger("PIMS_LSPRST_I_S_U_TR");
+ });
+
+ entity.Property(e => e.LeasePeriodStatusTypeCode).HasComment("Code value of the status of the lease period.");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
+ entity.Property(e => e.Description).HasComment("Description of the status of the lease period.");
+ entity.Property(e => e.DisplayOrder).HasComment("Display order of the descriptions.");
+ entity.Property(e => e.IsDisabled).HasComment("Indicates that the record is disabled.");
+ });
+
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.LeasePmtFreqTypeCode).HasName("LSPMTF_PK");
@@ -4667,12 +4816,24 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
});
entity.Property(e => e.LeasePmtFreqTypeCode).HasComment("Payment frequency type code");
- entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
- entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
entity.Property(e => e.Description).HasComment("Payment frequency type code description");
+ entity.Property(e => e.DisplayOrder).HasComment("Display order of the descriptions.");
+ entity.Property(e => e.IsDisabled).HasComment("Indicates that the record is disabled.");
});
modelBuilder.Entity(entity =>
@@ -4711,6 +4872,75 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.LeaseRenewalId).HasName("LSRNWL_PK");
+
+ entity.ToTable("PIMS_LEASE_RENEWAL", tb =>
+ {
+ tb.HasComment("Table containing lease renewal options.");
+ tb.HasTrigger("PIMS_LSRNWL_A_S_IUD_TR");
+ tb.HasTrigger("PIMS_LSRNWL_I_S_I_TR");
+ tb.HasTrigger("PIMS_LSRNWL_I_S_U_TR");
+ });
+
+ entity.Property(e => e.LeaseRenewalId)
+ .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_RENEWAL_ID_SEQ])")
+ .HasComment("Generated surrogate primary key");
+ entity.Property(e => e.AppCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user created the record.");
+ entity.Property(e => e.AppCreateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserGuid).HasComment("The GUID of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that created the record.");
+ entity.Property(e => e.AppLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user updated the record.");
+ entity.Property(e => e.AppLastUpdateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserGuid).HasComment("The GUID of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that updated the record.");
+ entity.Property(e => e.CommencementDt).HasComment("Date that the lease lease begins.");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
+ entity.Property(e => e.ExpiryDt).HasComment("Date that the lease lease ends.");
+ entity.Property(e => e.IsExercised).HasComment("Indicates if the lease renewal was exercised.");
+ entity.Property(e => e.LeaseId).HasComment("Foreign key to the PIMS_LEASE table.");
+ entity.Property(e => e.RenewalNote).HasComment("Notes pertaining to the lease reewal.");
+
+ entity.HasOne(d => d.Lease).WithMany(p => p.PimsLeaseRenewals)
+ .OnDelete(DeleteBehavior.ClientSetNull)
+ .HasConstraintName("PIM_LEASE_PIM_LSRNWL_FK");
+ });
+
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.LeaseRenewalHistId).HasName("PIMS_LSRNWL_H_PK");
+
+ entity.Property(e => e.LeaseRenewalHistId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_RENEWAL_H_ID_SEQ])");
+ entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
+ });
+
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.LeaseResponsibilityTypeCode).HasName("LRESPT_PK");
@@ -4806,78 +5036,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});
- modelBuilder.Entity(entity =>
- {
- entity.HasKey(e => e.LeaseTermId).HasName("LSTERM_PK");
-
- entity.ToTable("PIMS_LEASE_TERM", tb =>
- {
- tb.HasComment("Describes a term for the associated lease.");
- tb.HasTrigger("PIMS_LSTERM_A_S_IUD_TR");
- tb.HasTrigger("PIMS_LSTERM_I_S_I_TR");
- tb.HasTrigger("PIMS_LSTERM_I_S_U_TR");
- });
-
- entity.Property(e => e.LeaseTermId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_TERM_ID_SEQ])");
- entity.Property(e => e.AppCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.AppCreateUserDirectory).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.AppLastUpdateUserDirectory).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppLastUpdateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
- entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.GstAmount).HasComment("Calculated/entered GST portion of the payment. Can be overridden by the user.");
- entity.Property(e => e.IsGstEligible).HasComment("Is the lease subject to GST?");
- entity.Property(e => e.IsTermExercised).HasComment("Has the lease term been exercised?");
- entity.Property(e => e.LeasePmtFreqTypeCode).HasComment("Foreign key to payment frequency values");
- entity.Property(e => e.PaymentAmount).HasComment("Agreed-to payment amount (exclusive of GST)");
- entity.Property(e => e.PaymentDueDate).HasComment("Anecdotal description of payment due date (e.g. 1st of month, end of month)");
- entity.Property(e => e.PaymentNote).HasComment("Notes regarding payment status for the lease term");
- entity.Property(e => e.TermExpiryDate).HasComment("Expiry date of the current term of the lease/licence");
- entity.Property(e => e.TermRenewalDate).HasComment("Renewal date of the current term of the lease/licence");
- entity.Property(e => e.TermStartDate).HasComment("Start date of the current term of the lease/licence");
-
- entity.HasOne(d => d.Lease).WithMany(p => p.PimsLeaseTerms)
- .OnDelete(DeleteBehavior.ClientSetNull)
- .HasConstraintName("PIM_LEASE_PIM_LSTERM_FK");
-
- entity.HasOne(d => d.LeasePmtFreqTypeCodeNavigation).WithMany(p => p.PimsLeaseTerms).HasConstraintName("PIM_LSPMTF_PIM_LSTERM_FK");
-
- entity.HasOne(d => d.LeaseTermStatusTypeCodeNavigation).WithMany(p => p.PimsLeaseTerms).HasConstraintName("PIM_LTRMST_PIM_LSTERM_FK");
- });
-
- modelBuilder.Entity(entity =>
- {
- entity.HasKey(e => e.LeaseTermHistId).HasName("PIMS_LSTERM_H_PK");
-
- entity.Property(e => e.LeaseTermHistId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_LEASE_TERM_H_ID_SEQ])");
- entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
- });
-
- modelBuilder.Entity(entity =>
- {
- entity.HasKey(e => e.LeaseTermStatusTypeCode).HasName("LTRMST_PK");
-
- entity.ToTable("PIMS_LEASE_TERM_STATUS_TYPE", tb =>
- {
- tb.HasComment("Describes the status of the lease term");
- tb.HasTrigger("PIMS_LTRMST_I_S_I_TR");
- tb.HasTrigger("PIMS_LTRMST_I_S_U_TR");
- });
-
- entity.Property(e => e.LeaseTermStatusTypeCode).HasComment("Code value of the status of the lease term");
- entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
- entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.Description).HasComment("Description of the status of the lease term");
- });
-
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.LessorTypeCode).HasName("LSSRTY_PK");
@@ -5583,6 +5741,75 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.IsDisabled).HasComment("Indicates if the code value is inactive.");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.PropAcqFlCompReqId).HasName("PACMRQ_PK");
+
+ entity.ToTable("PIMS_PROP_ACQ_FL_COMP_REQ", tb =>
+ {
+ tb.HasTrigger("PIMS_PACMRQ_A_S_IUD_TR");
+ tb.HasTrigger("PIMS_PACMRQ_I_S_I_TR");
+ tb.HasTrigger("PIMS_PACMRQ_I_S_U_TR");
+ });
+
+ entity.Property(e => e.PropAcqFlCompReqId)
+ .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_PROP_ACQ_FL_COMP_REQ_ID_SEQ])")
+ .HasComment("Generated surrogate primary key.");
+ entity.Property(e => e.AppCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user created the record.");
+ entity.Property(e => e.AppCreateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserGuid).HasComment("The GUID of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that created the record.");
+ entity.Property(e => e.AppLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user updated the record.");
+ entity.Property(e => e.AppLastUpdateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserGuid).HasComment("The GUID of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that updated the record.");
+ entity.Property(e => e.CompensationRequisitionId).HasComment("Foreign key reference to the COMPENSATION_REQUISITION table.");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
+ entity.Property(e => e.PropertyAcquisitionFileId).HasComment("Foreign key reference to the PROPERTY_ACQUISITION_FILE table.");
+
+ entity.HasOne(d => d.CompensationRequisition).WithMany(p => p.PimsPropAcqFlCompReqs)
+ .OnDelete(DeleteBehavior.ClientSetNull)
+ .HasConstraintName("PIM_CMPREQ_PIM_PACMRQ_FK");
+
+ entity.HasOne(d => d.PropertyAcquisitionFile).WithMany(p => p.PimsPropAcqFlCompReqs)
+ .OnDelete(DeleteBehavior.ClientSetNull)
+ .HasConstraintName("PIM_PRACQF_PIM_PACMRQ_FK");
+ });
+
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.PropAcqFlCompReqHistId).HasName("PIMS_PACMRQ_H_PK");
+
+ entity.Property(e => e.PropAcqFlCompReqHistId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_PROP_ACQ_FL_COMP_REQ_H_ID_SEQ])");
+ entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
+ });
+
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.PropActInvolvedPartyId).HasName("PAINVP_PK");
@@ -6116,19 +6343,48 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
tb.HasTrigger("PIMS_PRACQF_I_S_U_TR");
});
- entity.Property(e => e.PropertyAcquisitionFileId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_PROPERTY_ACQUISITION_FILE_ID_SEQ])");
- entity.Property(e => e.AppCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.AppCreateUserDirectory).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.AppLastUpdateUserDirectory).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.AppLastUpdateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.ConcurrencyControlNumber).HasDefaultValue(1L);
- entity.Property(e => e.DbCreateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbCreateUserid).HasDefaultValueSql("(user_name())");
- entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
- entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
+ entity.Property(e => e.PropertyAcquisitionFileId)
+ .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_PROPERTY_ACQUISITION_FILE_ID_SEQ])")
+ .HasComment("Generated surrogate primary key.");
+ entity.Property(e => e.AcquisitionFileId).HasComment("Foreign key to the ACQUISTION_FILE table.");
+ entity.Property(e => e.AppCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user created the record.");
+ entity.Property(e => e.AppCreateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserGuid).HasComment("The GUID of the user account that created the record.");
+ entity.Property(e => e.AppCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that created the record.");
+ entity.Property(e => e.AppLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the user updated the record.");
+ entity.Property(e => e.AppLastUpdateUserDirectory)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The directory of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserGuid).HasComment("The GUID of the user account that updated the record.");
+ entity.Property(e => e.AppLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user account that updated the record.");
+ entity.Property(e => e.ConcurrencyControlNumber)
+ .HasDefaultValue(1L)
+ .HasComment("Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o");
+ entity.Property(e => e.DbCreateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created.");
+ entity.Property(e => e.DbCreateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created the record.");
+ entity.Property(e => e.DbLastUpdateTimestamp)
+ .HasDefaultValueSql("(getutcdate())")
+ .HasComment("The date and time the record was created or last updated.");
+ entity.Property(e => e.DbLastUpdateUserid)
+ .HasDefaultValueSql("(user_name())")
+ .HasComment("The user or proxy account that created or last updated the record.");
entity.Property(e => e.DisplayOrder).HasComment("Force the display order of the codes.");
+ entity.Property(e => e.Location).HasComment("Geospatial location (pin) of property");
+ entity.Property(e => e.PropertyId).HasComment("Foreign key to the PROPERTY table.");
entity.Property(e => e.PropertyName).HasComment("Descriptive reference for the property associated with the acquisition file.");
entity.HasOne(d => d.AcquisitionFile).WithMany(p => p.PimsPropertyAcquisitionFiles).HasConstraintName("PIM_ACQNFL_PIM_PRACQF_FK");
@@ -6495,6 +6751,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.DbLastUpdateTimestamp).HasDefaultValueSql("(getutcdate())");
entity.Property(e => e.DbLastUpdateUserid).HasDefaultValueSql("(user_name())");
entity.Property(e => e.LeaseArea).HasComment("Leased area measurement");
+ entity.Property(e => e.Location).HasComment("Geospatial location (pin) of property");
entity.Property(e => e.Name).HasComment("Property/lease name");
entity.HasOne(d => d.AreaUnitTypeCodeNavigation).WithMany(p => p.PimsPropertyLeases).HasConstraintName("PIM_ARUNIT_PIM_PROPLS_FK");
@@ -6716,6 +6973,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.DocumentReference).HasComment("URL / reference to a LAN Drive");
entity.Property(e => e.IsLegalOpinionObtained).HasComment("Indicates whether a legal opinion was obtained (0 = No, 1 = Yes, null = Unknown)");
entity.Property(e => e.IsLegalOpinionRequired).HasComment("Indicates whether a legal opinion is required (0 = No, 1 = Yes, null = Unknown)");
+ entity.Property(e => e.Location).HasComment("Geospatial location (pin) of property");
entity.Property(e => e.PropertyName).HasComment("Descriptive reference for the property being researched.");
entity.Property(e => e.ResearchSummary).HasComment("Summary of the property research.");
@@ -8442,13 +8700,22 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.HasSequence("PIMS_LEASE_PAYMENT_PERIOD_ID_SEQ")
.HasMin(1L)
.HasMax(2147483647L);
- modelBuilder.HasSequence("PIMS_LEASE_TENANT_H_ID_SEQ")
+ modelBuilder.HasSequence("PIMS_LEASE_PERIOD_H_ID_SEQ")
.HasMin(1L)
.HasMax(2147483647L);
- modelBuilder.HasSequence("PIMS_LEASE_TENANT_ID_SEQ")
+ modelBuilder.HasSequence("PIMS_LEASE_PERIOD_ID_SEQ")
+ .HasMin(1L)
+ .HasMax(2147483647L);
+ modelBuilder.HasSequence("PIMS_LEASE_RENEWAL_H_ID_SEQ")
+ .HasMin(1L)
+ .HasMax(2147483647L);
+ modelBuilder.HasSequence("PIMS_LEASE_RENEWAL_ID_SEQ")
.HasMin(1L)
.HasMax(2147483647L);
- modelBuilder.HasSequence("PIMS_LEASE_TERM_H_ID_SEQ")
+ modelBuilder.HasSequence("PIMS_LEASE_TENANT_H_ID_SEQ")
+ .HasMin(1L)
+ .HasMax(2147483647L);
+ modelBuilder.HasSequence("PIMS_LEASE_TENANT_ID_SEQ")
.HasMin(1L)
.HasMax(2147483647L);
modelBuilder.HasSequence("PIMS_LEASE_TERM_ID_SEQ")
@@ -8556,6 +8823,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.HasSequence("PIMS_PROJECT_WORKFLOW_MODEL_ID_SEQ")
.HasMin(1L)
.HasMax(2147483647L);
+ modelBuilder.HasSequence("PIMS_PROP_ACQ_FL_COMP_REQ_H_ID_SEQ")
+ .HasMin(1L)
+ .HasMax(2147483647L);
+ modelBuilder.HasSequence("PIMS_PROP_ACQ_FL_COMP_REQ_ID_SEQ")
+ .HasMin(1L)
+ .HasMax(2147483647L);
modelBuilder.HasSequence("PIMS_PROP_ACT_INVOLVED_PARTY_H_ID_SEQ")
.HasMin(1L)
.HasMax(2147483647L);
diff --git a/source/backend/entities/ef/PimsAcqChklstItemStatusType.cs b/source/backend/entities/ef/PimsAcqChklstItemStatusType.cs
deleted file mode 100644
index e5bbfa27f0..0000000000
--- a/source/backend/entities/ef/PimsAcqChklstItemStatusType.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-using Microsoft.EntityFrameworkCore;
-
-namespace Pims.Dal.Entities;
-
-///
-/// Tables that contains the codes and associated descriptions of the acquisition checklist item status types.
-///
-[Table("PIMS_ACQ_CHKLST_ITEM_STATUS_TYPE")]
-public partial class PimsAcqChklstItemStatusType
-{
- ///
- /// Codified version of the acquisition checklist item status type.
- ///
- [Key]
- [Column("ACQ_CHKLST_ITEM_STATUS_TYPE_CODE")]
- [StringLength(20)]
- public string AcqChklstItemStatusTypeCode { get; set; }
-
- ///
- /// Description of the acquisition checklist item status type.
- ///
- [Required]
- [Column("DESCRIPTION")]
- [StringLength(200)]
- public string Description { get; set; }
-
- ///
- /// Display order of the codes.
- ///
- [Column("DISPLAY_ORDER")]
- public int? DisplayOrder { get; set; }
-
- ///
- /// Indicates if the code value is inactive.
- ///
- [Column("IS_DISABLED")]
- public bool IsDisabled { get; set; }
-
- [Column("CONCURRENCY_CONTROL_NUMBER")]
- public long ConcurrencyControlNumber { get; set; }
-
- [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
- public DateTime DbCreateTimestamp { get; set; }
-
- [Required]
- [Column("DB_CREATE_USERID")]
- [StringLength(30)]
- public string DbCreateUserid { get; set; }
-
- [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
- public DateTime DbLastUpdateTimestamp { get; set; }
-
- [Required]
- [Column("DB_LAST_UPDATE_USERID")]
- [StringLength(30)]
- public string DbLastUpdateUserid { get; set; }
-
- [InverseProperty("AcqChklstItemStatusTypeCodeNavigation")]
- public virtual ICollection PimsAcquisitionChecklistItems { get; set; } = new List();
-}
diff --git a/source/backend/entities/ef/PimsAcquisitionChecklistItem.cs b/source/backend/entities/ef/PimsAcquisitionChecklistItem.cs
index e4c20c4a34..9749c6f670 100644
--- a/source/backend/entities/ef/PimsAcquisitionChecklistItem.cs
+++ b/source/backend/entities/ef/PimsAcquisitionChecklistItem.cs
@@ -8,9 +8,9 @@ namespace Pims.Dal.Entities;
[Table("PIMS_ACQUISITION_CHECKLIST_ITEM")]
[Index("AcquisitionFileId", Name = "ACQCKI_ACQUISITION_FILE_ID_IDX")]
-[Index("AcqChklstItemStatusTypeCode", Name = "ACQCKI_ACQ_CHKLST_ITEM_STATUS_TYPE_CODE_IDX")]
[Index("AcqChklstItemTypeCode", Name = "ACQCKI_ACQ_CHKLST_ITEM_TYPE_CODE_IDX")]
[Index("AcquisitionFileId", "AcqChklstItemTypeCode", Name = "ACQCKI_ACQ_FILE_CHKLST_ITEM_UK_IDX", IsUnique = true)]
+[Index("ChklstItemStatusTypeCode", Name = "ACQCKI_CHKLST_ITEM_STATUS_TYPE_CODE_IDX")]
public partial class PimsAcquisitionChecklistItem
{
[Key]
@@ -24,10 +24,13 @@ public partial class PimsAcquisitionChecklistItem
[StringLength(20)]
public string AcqChklstItemTypeCode { get; set; }
+ ///
+ /// Foreign key to the PIMS_CHKLST_ITEM_STATUS_TYPE table.
+ ///
[Required]
- [Column("ACQ_CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [Column("CHKLST_ITEM_STATUS_TYPE_CODE")]
[StringLength(20)]
- public string AcqChklstItemStatusTypeCode { get; set; }
+ public string ChklstItemStatusTypeCode { get; set; }
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
@@ -80,10 +83,6 @@ public partial class PimsAcquisitionChecklistItem
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
- [ForeignKey("AcqChklstItemStatusTypeCode")]
- [InverseProperty("PimsAcquisitionChecklistItems")]
- public virtual PimsAcqChklstItemStatusType AcqChklstItemStatusTypeCodeNavigation { get; set; }
-
[ForeignKey("AcqChklstItemTypeCode")]
[InverseProperty("PimsAcquisitionChecklistItems")]
public virtual PimsAcqChklstItemType AcqChklstItemTypeCodeNavigation { get; set; }
@@ -91,4 +90,8 @@ public partial class PimsAcquisitionChecklistItem
[ForeignKey("AcquisitionFileId")]
[InverseProperty("PimsAcquisitionChecklistItems")]
public virtual PimsAcquisitionFile AcquisitionFile { get; set; }
+
+ [ForeignKey("ChklstItemStatusTypeCode")]
+ [InverseProperty("PimsAcquisitionChecklistItems")]
+ public virtual PimsChklstItemStatusType ChklstItemStatusTypeCodeNavigation { get; set; }
}
diff --git a/source/backend/entities/ef/PimsAcquisitionChecklistItemHist.cs b/source/backend/entities/ef/PimsAcquisitionChecklistItemHist.cs
index 51d60f30f2..1612cc7dc8 100644
--- a/source/backend/entities/ef/PimsAcquisitionChecklistItemHist.cs
+++ b/source/backend/entities/ef/PimsAcquisitionChecklistItemHist.cs
@@ -31,9 +31,9 @@ public partial class PimsAcquisitionChecklistItemHist
public string AcqChklstItemTypeCode { get; set; }
[Required]
- [Column("ACQ_CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [Column("CHKLST_ITEM_STATUS_TYPE_CODE")]
[StringLength(20)]
- public string AcqChklstItemStatusTypeCode { get; set; }
+ public string ChklstItemStatusTypeCode { get; set; }
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
diff --git a/source/backend/entities/ef/PimsChklstItemStatusType.cs b/source/backend/entities/ef/PimsChklstItemStatusType.cs
new file mode 100644
index 0000000000..446bcb445f
--- /dev/null
+++ b/source/backend/entities/ef/PimsChklstItemStatusType.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+///
+/// Common table that contains the codes and associated descriptions of the various checklist item status types.
+///
+[Table("PIMS_CHKLST_ITEM_STATUS_TYPE")]
+public partial class PimsChklstItemStatusType
+{
+ ///
+ /// Codified version of the various checklist item status types.
+ ///
+ [Key]
+ [Column("CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [StringLength(20)]
+ public string ChklstItemStatusTypeCode { get; set; }
+
+ ///
+ /// Description of the various checklist item status type.
+ ///
+ [Required]
+ [Column("DESCRIPTION")]
+ [StringLength(200)]
+ public string Description { get; set; }
+
+ ///
+ /// Display order of the codes.
+ ///
+ [Column("DISPLAY_ORDER")]
+ public int? DisplayOrder { get; set; }
+
+ ///
+ /// Indicates if the code value is inactive.
+ ///
+ [Column("IS_DISABLED")]
+ public bool IsDisabled { get; set; }
+
+ ///
+ /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
+ ///
+ [Column("CONCURRENCY_CONTROL_NUMBER")]
+ public long ConcurrencyControlNumber { get; set; }
+
+ ///
+ /// The date and time the record was created.
+ ///
+ [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbCreateTimestamp { get; set; }
+
+ ///
+ /// The user or proxy account that created the record.
+ ///
+ [Required]
+ [Column("DB_CREATE_USERID")]
+ [StringLength(30)]
+ public string DbCreateUserid { get; set; }
+
+ ///
+ /// The date and time the record was created or last updated.
+ ///
+ [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbLastUpdateTimestamp { get; set; }
+
+ ///
+ /// The user or proxy account that created or last updated the record.
+ ///
+ [Required]
+ [Column("DB_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string DbLastUpdateUserid { get; set; }
+
+ [InverseProperty("ChklstItemStatusTypeCodeNavigation")]
+ public virtual ICollection PimsAcquisitionChecklistItems { get; set; } = new List();
+
+ [InverseProperty("ChklstItemStatusTypeCodeNavigation")]
+ public virtual ICollection PimsDispositionChecklistItems { get; set; } = new List();
+
+ [InverseProperty("ChklstItemStatusTypeCodeNavigation")]
+ public virtual ICollection PimsLeaseChecklistItems { get; set; } = new List();
+}
diff --git a/source/backend/entities/ef/PimsCompensationRequisition.cs b/source/backend/entities/ef/PimsCompensationRequisition.cs
index 2b1ce2be28..67219a917f 100644
--- a/source/backend/entities/ef/PimsCompensationRequisition.cs
+++ b/source/backend/entities/ef/PimsCompensationRequisition.cs
@@ -218,6 +218,9 @@ public partial class PimsCompensationRequisition
[InverseProperty("CompensationRequisition")]
public virtual ICollection PimsCompReqFinancials { get; set; } = new List();
+ [InverseProperty("CompensationRequisition")]
+ public virtual ICollection PimsPropAcqFlCompReqs { get; set; } = new List();
+
[ForeignKey("ResponsibilityId")]
[InverseProperty("PimsCompensationRequisitions")]
public virtual PimsResponsibilityCode Responsibility { get; set; }
diff --git a/source/backend/entities/ef/PimsDispositionChecklistItem.cs b/source/backend/entities/ef/PimsDispositionChecklistItem.cs
index ba2eb77ef4..29d062f2f3 100644
--- a/source/backend/entities/ef/PimsDispositionChecklistItem.cs
+++ b/source/backend/entities/ef/PimsDispositionChecklistItem.cs
@@ -7,9 +7,9 @@
namespace Pims.Dal.Entities;
[Table("PIMS_DISPOSITION_CHECKLIST_ITEM")]
+[Index("ChklstItemStatusTypeCode", Name = "DSPCKI_CHKLST_ITEM_STATUS_TYPE_CODE_IDX")]
[Index("DispositionFileId", Name = "DSPCKI_DISPOSITION_FILE_ID_IDX")]
[Index("DispositionFileId", "DspChklstItemTypeCode", Name = "DSPCKI_DISPOSITION_FILE_ID_UK_IDX", IsUnique = true)]
-[Index("DspChklstItemStatusTypeCode", Name = "DSPCKI_DSP_CHKLST_ITEM_STATUS_TYPE_CODE_IDX")]
[Index("DspChklstItemTypeCode", Name = "DSPCKI_DSP_CHKLST_ITEM_TYPE_CODE_IDX")]
public partial class PimsDispositionChecklistItem
{
@@ -34,12 +34,12 @@ public partial class PimsDispositionChecklistItem
public string DspChklstItemTypeCode { get; set; }
///
- /// Code value for the checklist item status.
+ /// Foreign key to the PIMS_CHKLST_ITEM_STATUS_TYPE table.
///
[Required]
- [Column("DSP_CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [Column("CHKLST_ITEM_STATUS_TYPE_CODE")]
[StringLength(20)]
- public string DspChklstItemStatusTypeCode { get; set; }
+ public string ChklstItemStatusTypeCode { get; set; }
///
/// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any
@@ -131,13 +131,13 @@ public partial class PimsDispositionChecklistItem
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
- [ForeignKey("DispositionFileId")]
+ [ForeignKey("ChklstItemStatusTypeCode")]
[InverseProperty("PimsDispositionChecklistItems")]
- public virtual PimsDispositionFile DispositionFile { get; set; }
+ public virtual PimsChklstItemStatusType ChklstItemStatusTypeCodeNavigation { get; set; }
- [ForeignKey("DspChklstItemStatusTypeCode")]
+ [ForeignKey("DispositionFileId")]
[InverseProperty("PimsDispositionChecklistItems")]
- public virtual PimsDspChklstItemStatusType DspChklstItemStatusTypeCodeNavigation { get; set; }
+ public virtual PimsDispositionFile DispositionFile { get; set; }
[ForeignKey("DspChklstItemTypeCode")]
[InverseProperty("PimsDispositionChecklistItems")]
diff --git a/source/backend/entities/ef/PimsDispositionChecklistItemHist.cs b/source/backend/entities/ef/PimsDispositionChecklistItemHist.cs
index 00a9b276f1..e5c7e5c7eb 100644
--- a/source/backend/entities/ef/PimsDispositionChecklistItemHist.cs
+++ b/source/backend/entities/ef/PimsDispositionChecklistItemHist.cs
@@ -31,9 +31,9 @@ public partial class PimsDispositionChecklistItemHist
public string DspChklstItemTypeCode { get; set; }
[Required]
- [Column("DSP_CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [Column("CHKLST_ITEM_STATUS_TYPE_CODE")]
[StringLength(20)]
- public string DspChklstItemStatusTypeCode { get; set; }
+ public string ChklstItemStatusTypeCode { get; set; }
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
diff --git a/source/backend/entities/ef/PimsDispositionFileProperty.cs b/source/backend/entities/ef/PimsDispositionFileProperty.cs
index 68a0ec1752..99fdd158df 100644
--- a/source/backend/entities/ef/PimsDispositionFileProperty.cs
+++ b/source/backend/entities/ef/PimsDispositionFileProperty.cs
@@ -3,6 +3,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
+using NetTopologySuite.Geometries;
namespace Pims.Dal.Entities;
@@ -131,6 +132,12 @@ public partial class PimsDispositionFileProperty
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+ ///
+ /// Geospatial location (pin) of property
+ ///
+ [Column("LOCATION", TypeName = "geometry")]
+ public Geometry Location { get; set; }
+
[ForeignKey("DispositionFileId")]
[InverseProperty("PimsDispositionFileProperties")]
public virtual PimsDispositionFile DispositionFile { get; set; }
diff --git a/source/backend/entities/ef/PimsLease.cs b/source/backend/entities/ef/PimsLease.cs
index 337e5dc4fb..ebbc8146f2 100644
--- a/source/backend/entities/ef/PimsLease.cs
+++ b/source/backend/entities/ef/PimsLease.cs
@@ -204,7 +204,7 @@ public partial class PimsLease
/// Original start date of the lease/license
///
[Column("ORIG_START_DATE", TypeName = "datetime")]
- public DateTime OrigStartDate { get; set; }
+ public DateTime? OrigStartDate { get; set; }
///
/// Original expiry date of the lease/license
@@ -388,6 +388,38 @@ public partial class PimsLease
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+ ///
+ /// Date that the lease was terminated.
+ ///
+ [Column("TERMINATION_DATE", TypeName = "datetime")]
+ public DateTime? TerminationDate { get; set; }
+
+ ///
+ /// Is there an associated public benefit with this lease? TRUE = Yes, FALSE = No, and NULL = Unknown. The default is NULL (Unknown).
+ ///
+ [Column("IS_PUBLIC_BENEFIT")]
+ public bool? IsPublicBenefit { get; set; }
+
+ ///
+ /// Is there an associated financial gain with this lease? TRUE = Yes, FALSE = No, and NULL = Unknown. The default is NULL (Unknown).
+ ///
+ [Column("IS_FINANCIAL_GAIN")]
+ public bool? IsFinancialGain { get; set; }
+
+ ///
+ /// Note associated with fee determination.
+ ///
+ [Column("FEE_DETERMINATION_NOTE")]
+ [StringLength(1000)]
+ public string FeeDeterminationNote { get; set; }
+
+ ///
+ /// The location in which primary arbtration of the lease occurred.
+ ///
+ [Column("PRIMARY_ARBITRATION_CITY")]
+ [StringLength(200)]
+ public string PrimaryArbitrationCity { get; set; }
+
[ForeignKey("LeaseCategoryTypeCode")]
[InverseProperty("PimsLeases")]
public virtual PimsLeaseCategoryType LeaseCategoryTypeCodeNavigation { get; set; }
@@ -436,10 +468,13 @@ public partial class PimsLease
public virtual ICollection PimsLeaseNotes { get; set; } = new List();
[InverseProperty("Lease")]
- public virtual ICollection PimsLeaseTenants { get; set; } = new List();
+ public virtual ICollection PimsLeasePeriods { get; set; } = new List();
[InverseProperty("Lease")]
- public virtual ICollection PimsLeaseTerms { get; set; } = new List();
+ public virtual ICollection PimsLeaseRenewals { get; set; } = new List();
+
+ [InverseProperty("Lease")]
+ public virtual ICollection PimsLeaseTenants { get; set; } = new List();
[InverseProperty("Lease")]
public virtual ICollection PimsPropertyImprovements { get; set; } = new List();
diff --git a/source/backend/entities/ef/PimsLeaseChecklistItem.cs b/source/backend/entities/ef/PimsLeaseChecklistItem.cs
index 2a4c30765f..4cb1b161ee 100644
--- a/source/backend/entities/ef/PimsLeaseChecklistItem.cs
+++ b/source/backend/entities/ef/PimsLeaseChecklistItem.cs
@@ -10,7 +10,7 @@ namespace Pims.Dal.Entities;
/// Table that contains the lease & license checklist items.
///
[Table("PIMS_LEASE_CHECKLIST_ITEM")]
-[Index("LeaseChklstItemStatusTypeCode", Name = "LCHKLI_LEASE_CHKLST_ITEM_STATUS_TYPE_CODE_IDX")]
+[Index("ChklstItemStatusTypeCode", Name = "LCHKLI_LEASE_CHKLST_ITEM_STATUS_TYPE_CODE_IDX")]
[Index("LeaseChklstItemTypeCode", Name = "LCHKLI_LEASE_CHKLST_ITEM_TYPE_CODE_IDX")]
[Index("LeaseId", Name = "LCHKLI_LEASE_ID_IDX")]
[Index("LeaseId", "LeaseChklstItemTypeCode", Name = "LCHKLI_LEASE_ID_UK", IsUnique = true)]
@@ -38,12 +38,12 @@ public partial class PimsLeaseChecklistItem
public string LeaseChklstItemTypeCode { get; set; }
///
- /// Foreign key to the PIMS_LEASE_CHKLST_ITEM_STATUS_TYPE table.
+ /// Foreign key to the PIMS_CHKLST_ITEM_STATUS_TYPE table.
///
[Required]
- [Column("LEASE_CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [Column("CHKLST_ITEM_STATUS_TYPE_CODE")]
[StringLength(20)]
- public string LeaseChklstItemStatusTypeCode { get; set; }
+ public string ChklstItemStatusTypeCode { get; set; }
///
/// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
@@ -135,13 +135,13 @@ public partial class PimsLeaseChecklistItem
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
- [ForeignKey("LeaseId")]
+ [ForeignKey("ChklstItemStatusTypeCode")]
[InverseProperty("PimsLeaseChecklistItems")]
- public virtual PimsLease Lease { get; set; }
+ public virtual PimsChklstItemStatusType ChklstItemStatusTypeCodeNavigation { get; set; }
- [ForeignKey("LeaseChklstItemStatusTypeCode")]
+ [ForeignKey("LeaseId")]
[InverseProperty("PimsLeaseChecklistItems")]
- public virtual PimsLeaseChklstItemStatusType LeaseChklstItemStatusTypeCodeNavigation { get; set; }
+ public virtual PimsLease Lease { get; set; }
[ForeignKey("LeaseChklstItemTypeCode")]
[InverseProperty("PimsLeaseChecklistItems")]
diff --git a/source/backend/entities/ef/PimsLeaseChecklistItemHist.cs b/source/backend/entities/ef/PimsLeaseChecklistItemHist.cs
index 43d84d43ca..8c76186e91 100644
--- a/source/backend/entities/ef/PimsLeaseChecklistItemHist.cs
+++ b/source/backend/entities/ef/PimsLeaseChecklistItemHist.cs
@@ -32,9 +32,9 @@ public partial class PimsLeaseChecklistItemHist
public string LeaseChklstItemTypeCode { get; set; }
[Required]
- [Column("LEASE_CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [Column("CHKLST_ITEM_STATUS_TYPE_CODE")]
[StringLength(20)]
- public string LeaseChklstItemStatusTypeCode { get; set; }
+ public string ChklstItemStatusTypeCode { get; set; }
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
diff --git a/source/backend/entities/ef/PimsLeaseHist.cs b/source/backend/entities/ef/PimsLeaseHist.cs
index ce0e5078ef..6ac3574fce 100644
--- a/source/backend/entities/ef/PimsLeaseHist.cs
+++ b/source/backend/entities/ef/PimsLeaseHist.cs
@@ -110,7 +110,7 @@ public partial class PimsLeaseHist
public string OtherLeasePurposeType { get; set; }
[Column("ORIG_START_DATE", TypeName = "datetime")]
- public DateTime OrigStartDate { get; set; }
+ public DateTime? OrigStartDate { get; set; }
[Column("ORIG_EXPIRY_DATE", TypeName = "datetime")]
public DateTime? OrigExpiryDate { get; set; }
@@ -206,4 +206,21 @@ public partial class PimsLeaseHist
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+
+ [Column("TERMINATION_DATE", TypeName = "datetime")]
+ public DateTime? TerminationDate { get; set; }
+
+ [Column("IS_PUBLIC_BENEFIT")]
+ public bool? IsPublicBenefit { get; set; }
+
+ [Column("IS_FINANCIAL_GAIN")]
+ public bool? IsFinancialGain { get; set; }
+
+ [Column("FEE_DETERMINATION_NOTE")]
+ [StringLength(1000)]
+ public string FeeDeterminationNote { get; set; }
+
+ [Column("PRIMARY_ARBITRATION_CITY")]
+ [StringLength(200)]
+ public string PrimaryArbitrationCity { get; set; }
}
diff --git a/source/backend/entities/ef/PimsLeasePayment.cs b/source/backend/entities/ef/PimsLeasePayment.cs
index 5067c8a543..4f3690250c 100644
--- a/source/backend/entities/ef/PimsLeasePayment.cs
+++ b/source/backend/entities/ef/PimsLeasePayment.cs
@@ -10,26 +10,55 @@ namespace Pims.Dal.Entities;
/// Describes a payment associated with a lease term.
///
[Table("PIMS_LEASE_PAYMENT")]
+[Index("LeasePaymentCategoryTypeCode", Name = "LSPYMT_LEASE_PAYMENT_CATEGORY_TYPE_CODE_IDX")]
[Index("LeasePaymentMethodTypeCode", Name = "LSPYMT_LEASE_PAYMENT_METHOD_TYPE_CODE_IDX")]
-[Index("LeaseTermId", Name = "LSPYMT_LEASE_TERM_ID_IDX")]
+[Index("LeasePaymentStatusTypeCode", Name = "LSPYMT_LEASE_PAYMENT_STATUS_TYPE_CODE_IDX")]
+[Index("LeasePeriodId", Name = "LSPYMT_LEASE_PERIOD_ID_IDX")]
+[Index("LeasePmtFreqTypeCode", Name = "LSPYMT_LEASE_PMT_FREQ_TYPE_CODE_IDX")]
public partial class PimsLeasePayment
{
+ ///
+ /// Generated surrogate primary key.
+ ///
[Key]
[Column("LEASE_PAYMENT_ID")]
public long LeasePaymentId { get; set; }
- [Column("LEASE_TERM_ID")]
- public long LeaseTermId { get; set; }
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PERIOD table.
+ ///
+ [Column("LEASE_PERIOD_ID")]
+ public long LeasePeriodId { get; set; }
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PAYMENT_METHOD_TYPE_CODE table.
+ ///
[Required]
[Column("LEASE_PAYMENT_METHOD_TYPE_CODE")]
[StringLength(20)]
public string LeasePaymentMethodTypeCode { get; set; }
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PAYMENT_STATUS_TYPE_CODE table.
+ ///
[Column("LEASE_PAYMENT_STATUS_TYPE_CODE")]
[StringLength(20)]
public string LeasePaymentStatusTypeCode { get; set; }
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PAYMENT_CATEGORY_TYPE_CODE table.
+ ///
+ [Column("LEASE_PAYMENT_CATEGORY_TYPE_CODE")]
+ [StringLength(20)]
+ public string LeasePaymentCategoryTypeCode { get; set; }
+
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PMT_FREQ_TYPE_CODE table.
+ ///
+ [Column("LEASE_PMT_FREQ_TYPE_CODE")]
+ [StringLength(20)]
+ public string LeasePmtFreqTypeCode { get; set; }
+
///
/// Date the payment was received or sent
///
@@ -67,57 +96,100 @@ public partial class PimsLeasePayment
[StringLength(2000)]
public string Note { get; set; }
+ ///
+ /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
+ ///
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
+ ///
+ /// The date and time the user created the record.
+ ///
[Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")]
public DateTime AppCreateTimestamp { get; set; }
+ ///
+ /// The user account that created the record.
+ ///
[Required]
[Column("APP_CREATE_USERID")]
[StringLength(30)]
public string AppCreateUserid { get; set; }
+ ///
+ /// The GUID of the user account that created the record.
+ ///
[Column("APP_CREATE_USER_GUID")]
public Guid? AppCreateUserGuid { get; set; }
+ ///
+ /// The directory of the user account that created the record.
+ ///
[Required]
[Column("APP_CREATE_USER_DIRECTORY")]
[StringLength(30)]
public string AppCreateUserDirectory { get; set; }
+ ///
+ /// The date and time the user updated the record.
+ ///
[Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
public DateTime AppLastUpdateTimestamp { get; set; }
+ ///
+ /// The user account that updated the record.
+ ///
[Required]
[Column("APP_LAST_UPDATE_USERID")]
[StringLength(30)]
public string AppLastUpdateUserid { get; set; }
+ ///
+ /// The GUID of the user account that updated the record.
+ ///
[Column("APP_LAST_UPDATE_USER_GUID")]
public Guid? AppLastUpdateUserGuid { get; set; }
+ ///
+ /// The directory of the user account that updated the record.
+ ///
[Required]
[Column("APP_LAST_UPDATE_USER_DIRECTORY")]
[StringLength(30)]
public string AppLastUpdateUserDirectory { get; set; }
+ ///
+ /// The date and time the record was created.
+ ///
[Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
public DateTime DbCreateTimestamp { get; set; }
+ ///
+ /// The user or proxy account that created the record.
+ ///
[Required]
[Column("DB_CREATE_USERID")]
[StringLength(30)]
public string DbCreateUserid { get; set; }
+ ///
+ /// The date and time the record was created or last updated.
+ ///
[Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
public DateTime DbLastUpdateTimestamp { get; set; }
+ ///
+ /// The user or proxy account that created or last updated the record.
+ ///
[Required]
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+ [ForeignKey("LeasePaymentCategoryTypeCode")]
+ [InverseProperty("PimsLeasePayments")]
+ public virtual PimsLeasePaymentCategoryType LeasePaymentCategoryTypeCodeNavigation { get; set; }
+
[ForeignKey("LeasePaymentMethodTypeCode")]
[InverseProperty("PimsLeasePayments")]
public virtual PimsLeasePaymentMethodType LeasePaymentMethodTypeCodeNavigation { get; set; }
@@ -126,7 +198,11 @@ public partial class PimsLeasePayment
[InverseProperty("PimsLeasePayments")]
public virtual PimsLeasePaymentStatusType LeasePaymentStatusTypeCodeNavigation { get; set; }
- [ForeignKey("LeaseTermId")]
+ [ForeignKey("LeasePeriodId")]
+ [InverseProperty("PimsLeasePayments")]
+ public virtual PimsLeasePeriod LeasePeriod { get; set; }
+
+ [ForeignKey("LeasePmtFreqTypeCode")]
[InverseProperty("PimsLeasePayments")]
- public virtual PimsLeaseTerm LeaseTerm { get; set; }
+ public virtual PimsLeasePmtFreqType LeasePmtFreqTypeCodeNavigation { get; set; }
}
diff --git a/source/backend/entities/ef/PimsLeaseChklstItemStatusType.cs b/source/backend/entities/ef/PimsLeasePaymentCategoryType.cs
similarity index 71%
rename from source/backend/entities/ef/PimsLeaseChklstItemStatusType.cs
rename to source/backend/entities/ef/PimsLeasePaymentCategoryType.cs
index 0712a450ae..659bcc006c 100644
--- a/source/backend/entities/ef/PimsLeaseChklstItemStatusType.cs
+++ b/source/backend/entities/ef/PimsLeasePaymentCategoryType.cs
@@ -7,21 +7,21 @@
namespace Pims.Dal.Entities;
///
-/// Tables that contains the codes and associated descriptions of the lease & license checklist item status types.
+/// Describes the category of the lease payment (currently Base, Additional, or Variable).
///
-[Table("PIMS_LEASE_CHKLST_ITEM_STATUS_TYPE")]
-public partial class PimsLeaseChklstItemStatusType
+[Table("PIMS_LEASE_PAYMENT_CATEGORY_TYPE")]
+public partial class PimsLeasePaymentCategoryType
{
///
- /// Codified version of the lease & license checklist item status type.
+ /// Payment category type code.
///
[Key]
- [Column("LEASE_CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [Column("LEASE_PAYMENT_CATEGORY_TYPE_CODE")]
[StringLength(20)]
- public string LeaseChklstItemStatusTypeCode { get; set; }
+ public string LeasePaymentCategoryTypeCode { get; set; }
///
- /// Description of the lease & license checklist item status type.
+ /// Payment category type description.
///
[Required]
[Column("DESCRIPTION")]
@@ -29,16 +29,16 @@ public partial class PimsLeaseChklstItemStatusType
public string Description { get; set; }
///
- /// Display order of the codes.
+ /// Indicates that the record is disabled.
///
- [Column("DISPLAY_ORDER")]
- public int? DisplayOrder { get; set; }
+ [Column("IS_DISABLED")]
+ public bool IsDisabled { get; set; }
///
- /// Indicates if the code value is inactive.
+ /// Display order of the descriptions
///
- [Column("IS_DISABLED")]
- public bool IsDisabled { get; set; }
+ [Column("DISPLAY_ORDER")]
+ public int? DisplayOrder { get; set; }
///
/// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
@@ -74,6 +74,6 @@ public partial class PimsLeaseChklstItemStatusType
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
- [InverseProperty("LeaseChklstItemStatusTypeCodeNavigation")]
- public virtual ICollection PimsLeaseChecklistItems { get; set; } = new List();
+ [InverseProperty("LeasePaymentCategoryTypeCodeNavigation")]
+ public virtual ICollection PimsLeasePayments { get; set; } = new List();
}
diff --git a/source/backend/entities/ef/PimsLeasePaymentHist.cs b/source/backend/entities/ef/PimsLeasePaymentHist.cs
index 7bfac04750..aca01363d6 100644
--- a/source/backend/entities/ef/PimsLeasePaymentHist.cs
+++ b/source/backend/entities/ef/PimsLeasePaymentHist.cs
@@ -23,8 +23,8 @@ public partial class PimsLeasePaymentHist
[Column("LEASE_PAYMENT_ID")]
public long LeasePaymentId { get; set; }
- [Column("LEASE_TERM_ID")]
- public long LeaseTermId { get; set; }
+ [Column("LEASE_PERIOD_ID")]
+ public long LeasePeriodId { get; set; }
[Required]
[Column("LEASE_PAYMENT_METHOD_TYPE_CODE")]
@@ -35,6 +35,14 @@ public partial class PimsLeasePaymentHist
[StringLength(20)]
public string LeasePaymentStatusTypeCode { get; set; }
+ [Column("LEASE_PAYMENT_CATEGORY_TYPE_CODE")]
+ [StringLength(20)]
+ public string LeasePaymentCategoryTypeCode { get; set; }
+
+ [Column("LEASE_PMT_FREQ_TYPE_CODE")]
+ [StringLength(20)]
+ public string LeasePmtFreqTypeCode { get; set; }
+
[Column("PAYMENT_RECEIVED_DATE", TypeName = "datetime")]
public DateTime PaymentReceivedDate { get; set; }
diff --git a/source/backend/entities/ef/PimsLeasePeriod.cs b/source/backend/entities/ef/PimsLeasePeriod.cs
new file mode 100644
index 0000000000..e77f65c19a
--- /dev/null
+++ b/source/backend/entities/ef/PimsLeasePeriod.cs
@@ -0,0 +1,277 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+///
+/// Describes a duration period for the associated lease.
+///
+[Table("PIMS_LEASE_PERIOD")]
+[Index("AddlRentFreq", Name = "LSPERD_ADDL_RENT_FREQ_IDX")]
+[Index("LeaseId", Name = "LSPERD_LEASE_ID_IDX")]
+[Index("LeasePeriodStatusTypeCode", Name = "LSPERD_LEASE_PERIOD_STATUS_TYPE_CODE_IDX")]
+[Index("LeasePmtFreqTypeCode", Name = "LSPERD_LEASE_PMT_FREQ_TYPE_CODE_IDX")]
+[Index("VblRentFreq", Name = "LSPERD_VBL_RENT_FREQ_IDX")]
+public partial class PimsLeasePeriod
+{
+ ///
+ /// Generated surrogate primary key.
+ ///
+ [Key]
+ [Column("LEASE_PERIOD_ID")]
+ public long LeasePeriodId { get; set; }
+
+ ///
+ /// Foreign key reference to the PIMS_LEASE table.
+ ///
+ [Column("LEASE_ID")]
+ public long LeaseId { get; set; }
+
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PERIOD_STATUS_TYPE table.
+ ///
+ [Column("LEASE_PERIOD_STATUS_TYPE_CODE")]
+ [StringLength(20)]
+ public string LeasePeriodStatusTypeCode { get; set; }
+
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PMT_FREQ_TYPE table.
+ ///
+ [Column("LEASE_PMT_FREQ_TYPE_CODE")]
+ [StringLength(20)]
+ public string LeasePmtFreqTypeCode { get; set; }
+
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PMT_FREQ_TYPE table.
+ ///
+ [Column("ADDL_RENT_FREQ")]
+ [StringLength(20)]
+ public string AddlRentFreq { get; set; }
+
+ ///
+ /// Foreign key reference to the PIMS_LEASE_PMT_FREQ_TYPE table.
+ ///
+ [Column("VBL_RENT_FREQ")]
+ [StringLength(20)]
+ public string VblRentFreq { get; set; }
+
+ ///
+ /// Start date of the current period of the lease/licence
+ ///
+ [Column("PERIOD_START_DATE", TypeName = "datetime")]
+ public DateTime PeriodStartDate { get; set; }
+
+ ///
+ /// Expiry date of the current period of the lease/licence
+ ///
+ [Column("PERIOD_EXPIRY_DATE", TypeName = "datetime")]
+ public DateTime? PeriodExpiryDate { get; set; }
+
+ ///
+ /// Renewal date of the current period of the lease/licence
+ ///
+ [Column("PERIOD_RENEWAL_DATE", TypeName = "datetime")]
+ public DateTime? PeriodRenewalDate { get; set; }
+
+ ///
+ /// Agreed-to payment amount (exclusive of GST)
+ ///
+ [Column("PAYMENT_AMOUNT", TypeName = "money")]
+ public decimal? PaymentAmount { get; set; }
+
+ ///
+ /// Anecdotal description of payment due date (e.g. 1st of month, end of month)
+ ///
+ [Column("PAYMENT_DUE_DATE")]
+ [StringLength(2000)]
+ public string PaymentDueDate { get; set; }
+
+ ///
+ /// Notes regarding payment status for the lease period
+ ///
+ [Column("PAYMENT_NOTE")]
+ [StringLength(2000)]
+ public string PaymentNote { get; set; }
+
+ ///
+ /// Is the lease subject to GST?
+ ///
+ [Column("IS_GST_ELIGIBLE")]
+ public bool? IsGstEligible { get; set; }
+
+ ///
+ /// Calculated/entered GST portion of the payment. Can be overridden by the user.
+ ///
+ [Column("GST_AMOUNT", TypeName = "money")]
+ public decimal? GstAmount { get; set; }
+
+ ///
+ /// Has the lease period been exercised?
+ ///
+ [Column("IS_PERIOD_EXERCISED")]
+ public bool? IsPeriodExercised { get; set; }
+
+ ///
+ /// Indicates whether the payment type is predetermined (FALSE) or variable (TRUE). Predetermined (FALSE) is the default value.
+ ///
+ [Column("IS_VARIABLE_PAYMENT")]
+ public bool IsVariablePayment { get; set; }
+
+ ///
+ /// Indicates whether the period duration is fixed (FALSE) or flexible (TRUE). Fixed (FALSE) is the default value.
+ ///
+ [Column("IS_FLEXIBLE_DURATION")]
+ public bool IsFlexibleDuration { get; set; }
+
+ ///
+ /// Indicates the agreed-to variable additional rent payment amount.
+ ///
+ [Column("ADDL_RENT_AGREED_PMT", TypeName = "money")]
+ public decimal? AddlRentAgreedPmt { get; set; }
+
+ ///
+ /// Is the variable additional rent payment subject to GST?
+ ///
+ [Column("IS_ADDL_RENT_SUBJECT_TO_GST")]
+ public bool? IsAddlRentSubjectToGst { get; set; }
+
+ ///
+ /// Indicates the agreed-to variable rent payment amount.
+ ///
+ [Column("VBL_RENT_AGREED_PMT", TypeName = "money")]
+ public decimal? VblRentAgreedPmt { get; set; }
+
+ ///
+ /// Is the variable rent payment subject to GST?
+ ///
+ [Column("IS_VBL_RENT_SUBJECT_TO_GST")]
+ public bool? IsVblRentSubjectToGst { get; set; }
+
+ ///
+ /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
+ ///
+ [Column("CONCURRENCY_CONTROL_NUMBER")]
+ public long ConcurrencyControlNumber { get; set; }
+
+ ///
+ /// The date and time the user created the record.
+ ///
+ [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppCreateTimestamp { get; set; }
+
+ ///
+ /// The user account that created the record.
+ ///
+ [Required]
+ [Column("APP_CREATE_USERID")]
+ [StringLength(30)]
+ public string AppCreateUserid { get; set; }
+
+ ///
+ /// The GUID of the user account that created the record.
+ ///
+ [Column("APP_CREATE_USER_GUID")]
+ public Guid? AppCreateUserGuid { get; set; }
+
+ ///
+ /// The directory of the user account that created the record.
+ ///
+ [Required]
+ [Column("APP_CREATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppCreateUserDirectory { get; set; }
+
+ ///
+ /// The date and time the user updated the record.
+ ///
+ [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppLastUpdateTimestamp { get; set; }
+
+ ///
+ /// The user account that updated the record.
+ ///
+ [Required]
+ [Column("APP_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string AppLastUpdateUserid { get; set; }
+
+ ///
+ /// The GUID of the user account that updated the record.
+ ///
+ [Column("APP_LAST_UPDATE_USER_GUID")]
+ public Guid? AppLastUpdateUserGuid { get; set; }
+
+ ///
+ /// The directory of the user account that updated the record.
+ ///
+ [Required]
+ [Column("APP_LAST_UPDATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppLastUpdateUserDirectory { get; set; }
+
+ ///
+ /// The date and time the record was created.
+ ///
+ [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbCreateTimestamp { get; set; }
+
+ ///
+ /// The user or proxy account that created the record.
+ ///
+ [Required]
+ [Column("DB_CREATE_USERID")]
+ [StringLength(30)]
+ public string DbCreateUserid { get; set; }
+
+ ///
+ /// The date and time the record was created or last updated.
+ ///
+ [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbLastUpdateTimestamp { get; set; }
+
+ ///
+ /// The user or proxy account that created or last updated the record.
+ ///
+ [Required]
+ [Column("DB_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string DbLastUpdateUserid { get; set; }
+
+ ///
+ /// GST dollar amount for the additional rent.
+ ///
+ [Column("ADDL_RENT_GST_AMOUNT", TypeName = "money")]
+ public decimal? AddlRentGstAmount { get; set; }
+
+ ///
+ /// GST dollar amount for the variable rent.
+ ///
+ [Column("VBL_RENT_GST_AMOUNT", TypeName = "money")]
+ public decimal? VblRentGstAmount { get; set; }
+
+ [ForeignKey("AddlRentFreq")]
+ [InverseProperty("PimsLeasePeriodAddlRentFreqNavigations")]
+ public virtual PimsLeasePmtFreqType AddlRentFreqNavigation { get; set; }
+
+ [ForeignKey("LeaseId")]
+ [InverseProperty("PimsLeasePeriods")]
+ public virtual PimsLease Lease { get; set; }
+
+ [ForeignKey("LeasePeriodStatusTypeCode")]
+ [InverseProperty("PimsLeasePeriods")]
+ public virtual PimsLeasePeriodStatusType LeasePeriodStatusTypeCodeNavigation { get; set; }
+
+ [ForeignKey("LeasePmtFreqTypeCode")]
+ [InverseProperty("PimsLeasePeriodLeasePmtFreqTypeCodeNavigations")]
+ public virtual PimsLeasePmtFreqType LeasePmtFreqTypeCodeNavigation { get; set; }
+
+ [InverseProperty("LeasePeriod")]
+ public virtual ICollection PimsLeasePayments { get; set; } = new List();
+
+ [ForeignKey("VblRentFreq")]
+ [InverseProperty("PimsLeasePeriodVblRentFreqNavigations")]
+ public virtual PimsLeasePmtFreqType VblRentFreqNavigation { get; set; }
+}
diff --git a/source/backend/entities/ef/PimsLeasePeriodHist.cs b/source/backend/entities/ef/PimsLeasePeriodHist.cs
new file mode 100644
index 0000000000..2b9dd894ac
--- /dev/null
+++ b/source/backend/entities/ef/PimsLeasePeriodHist.cs
@@ -0,0 +1,148 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+[Table("PIMS_LEASE_PERIOD_HIST")]
+[Index("LeasePeriodHistId", "EndDateHist", Name = "PIMS_LSPERD_H_UK", IsUnique = true)]
+public partial class PimsLeasePeriodHist
+{
+ [Key]
+ [Column("_LEASE_PERIOD_HIST_ID")]
+ public long LeasePeriodHistId { get; set; }
+
+ [Column("EFFECTIVE_DATE_HIST", TypeName = "datetime")]
+ public DateTime EffectiveDateHist { get; set; }
+
+ [Column("END_DATE_HIST", TypeName = "datetime")]
+ public DateTime? EndDateHist { get; set; }
+
+ [Column("LEASE_PERIOD_ID")]
+ public long LeasePeriodId { get; set; }
+
+ [Column("LEASE_ID")]
+ public long LeaseId { get; set; }
+
+ [Column("LEASE_PERIOD_STATUS_TYPE_CODE")]
+ [StringLength(20)]
+ public string LeasePeriodStatusTypeCode { get; set; }
+
+ [Column("LEASE_PMT_FREQ_TYPE_CODE")]
+ [StringLength(20)]
+ public string LeasePmtFreqTypeCode { get; set; }
+
+ [Column("ADDL_RENT_FREQ")]
+ [StringLength(20)]
+ public string AddlRentFreq { get; set; }
+
+ [Column("VBL_RENT_FREQ")]
+ [StringLength(20)]
+ public string VblRentFreq { get; set; }
+
+ [Column("PERIOD_START_DATE", TypeName = "datetime")]
+ public DateTime PeriodStartDate { get; set; }
+
+ [Column("PERIOD_EXPIRY_DATE", TypeName = "datetime")]
+ public DateTime? PeriodExpiryDate { get; set; }
+
+ [Column("PERIOD_RENEWAL_DATE", TypeName = "datetime")]
+ public DateTime? PeriodRenewalDate { get; set; }
+
+ [Column("PAYMENT_AMOUNT", TypeName = "money")]
+ public decimal? PaymentAmount { get; set; }
+
+ [Column("PAYMENT_DUE_DATE")]
+ [StringLength(2000)]
+ public string PaymentDueDate { get; set; }
+
+ [Column("PAYMENT_NOTE")]
+ [StringLength(2000)]
+ public string PaymentNote { get; set; }
+
+ [Column("IS_GST_ELIGIBLE")]
+ public bool? IsGstEligible { get; set; }
+
+ [Column("GST_AMOUNT", TypeName = "money")]
+ public decimal? GstAmount { get; set; }
+
+ [Column("IS_PERIOD_EXERCISED")]
+ public bool? IsPeriodExercised { get; set; }
+
+ [Column("IS_VARIABLE_PAYMENT")]
+ public bool IsVariablePayment { get; set; }
+
+ [Column("IS_FLEXIBLE_DURATION")]
+ public bool IsFlexibleDuration { get; set; }
+
+ [Column("ADDL_RENT_AGREED_PMT", TypeName = "money")]
+ public decimal? AddlRentAgreedPmt { get; set; }
+
+ [Column("IS_ADDL_RENT_SUBJECT_TO_GST")]
+ public bool? IsAddlRentSubjectToGst { get; set; }
+
+ [Column("VBL_RENT_AGREED_PMT", TypeName = "money")]
+ public decimal? VblRentAgreedPmt { get; set; }
+
+ [Column("IS_VBL_RENT_SUBJECT_TO_GST")]
+ public bool? IsVblRentSubjectToGst { get; set; }
+
+ [Column("CONCURRENCY_CONTROL_NUMBER")]
+ public long ConcurrencyControlNumber { get; set; }
+
+ [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppCreateTimestamp { get; set; }
+
+ [Required]
+ [Column("APP_CREATE_USERID")]
+ [StringLength(30)]
+ public string AppCreateUserid { get; set; }
+
+ [Column("APP_CREATE_USER_GUID")]
+ public Guid? AppCreateUserGuid { get; set; }
+
+ [Required]
+ [Column("APP_CREATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppCreateUserDirectory { get; set; }
+
+ [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppLastUpdateTimestamp { get; set; }
+
+ [Required]
+ [Column("APP_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string AppLastUpdateUserid { get; set; }
+
+ [Column("APP_LAST_UPDATE_USER_GUID")]
+ public Guid? AppLastUpdateUserGuid { get; set; }
+
+ [Required]
+ [Column("APP_LAST_UPDATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppLastUpdateUserDirectory { get; set; }
+
+ [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbCreateTimestamp { get; set; }
+
+ [Required]
+ [Column("DB_CREATE_USERID")]
+ [StringLength(30)]
+ public string DbCreateUserid { get; set; }
+
+ [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbLastUpdateTimestamp { get; set; }
+
+ [Required]
+ [Column("DB_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string DbLastUpdateUserid { get; set; }
+
+ [Column("ADDL_RENT_GST_AMOUNT", TypeName = "money")]
+ public decimal? AddlRentGstAmount { get; set; }
+
+ [Column("VBL_RENT_GST_AMOUNT", TypeName = "money")]
+ public decimal? VblRentGstAmount { get; set; }
+}
diff --git a/source/backend/entities/ef/PimsDspChklstItemStatusType.cs b/source/backend/entities/ef/PimsLeasePeriodStatusType.cs
similarity index 67%
rename from source/backend/entities/ef/PimsDspChklstItemStatusType.cs
rename to source/backend/entities/ef/PimsLeasePeriodStatusType.cs
index 9eea7d7485..ea8db3686e 100644
--- a/source/backend/entities/ef/PimsDspChklstItemStatusType.cs
+++ b/source/backend/entities/ef/PimsLeasePeriodStatusType.cs
@@ -7,21 +7,21 @@
namespace Pims.Dal.Entities;
///
-/// Tables that contains the codes and associated descriptions of the disposition checklist item status types.
+/// Describes the status of the lease period.
///
-[Table("PIMS_DSP_CHKLST_ITEM_STATUS_TYPE")]
-public partial class PimsDspChklstItemStatusType
+[Table("PIMS_LEASE_PERIOD_STATUS_TYPE")]
+public partial class PimsLeasePeriodStatusType
{
///
- /// Codified version of the disposition checklist item status type.
+ /// Code value of the status of the lease period.
///
[Key]
- [Column("DSP_CHKLST_ITEM_STATUS_TYPE_CODE")]
+ [Column("LEASE_PERIOD_STATUS_TYPE_CODE")]
[StringLength(20)]
- public string DspChklstItemStatusTypeCode { get; set; }
+ public string LeasePeriodStatusTypeCode { get; set; }
///
- /// Description of the disposition checklist item status type.
+ /// Description of the status of the lease period.
///
[Required]
[Column("DESCRIPTION")]
@@ -29,19 +29,19 @@ public partial class PimsDspChklstItemStatusType
public string Description { get; set; }
///
- /// Display order of the codes.
+ /// Indicates that the record is disabled.
///
- [Column("DISPLAY_ORDER")]
- public int? DisplayOrder { get; set; }
+ [Column("IS_DISABLED")]
+ public bool IsDisabled { get; set; }
///
- /// Indicates if the code value is inactive.
+ /// Display order of the descriptions.
///
- [Column("IS_DISABLED")]
- public bool IsDisabled { get; set; }
+ [Column("DISPLAY_ORDER")]
+ public int? DisplayOrder { get; set; }
///
- /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any
+ /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
///
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
@@ -74,6 +74,6 @@ public partial class PimsDspChklstItemStatusType
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
- [InverseProperty("DspChklstItemStatusTypeCodeNavigation")]
- public virtual ICollection PimsDispositionChecklistItems { get; set; } = new List();
+ [InverseProperty("LeasePeriodStatusTypeCodeNavigation")]
+ public virtual ICollection PimsLeasePeriods { get; set; } = new List();
}
diff --git a/source/backend/entities/ef/PimsLeasePmtFreqType.cs b/source/backend/entities/ef/PimsLeasePmtFreqType.cs
index 86c88f8a25..032e7095a2 100644
--- a/source/backend/entities/ef/PimsLeasePmtFreqType.cs
+++ b/source/backend/entities/ef/PimsLeasePmtFreqType.cs
@@ -28,31 +28,61 @@ public partial class PimsLeasePmtFreqType
[StringLength(200)]
public string Description { get; set; }
+ ///
+ /// Indicates that the record is disabled.
+ ///
[Column("IS_DISABLED")]
public bool IsDisabled { get; set; }
+ ///
+ /// Display order of the descriptions.
+ ///
[Column("DISPLAY_ORDER")]
public int? DisplayOrder { get; set; }
+ ///
+ /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
+ ///
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
+ ///
+ /// The date and time the record was created.
+ ///
[Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
public DateTime DbCreateTimestamp { get; set; }
+ ///
+ /// The user or proxy account that created the record.
+ ///
[Required]
[Column("DB_CREATE_USERID")]
[StringLength(30)]
public string DbCreateUserid { get; set; }
+ ///
+ /// The date and time the record was created or last updated.
+ ///
[Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
public DateTime DbLastUpdateTimestamp { get; set; }
+ ///
+ /// The user or proxy account that created or last updated the record.
+ ///
[Required]
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
[InverseProperty("LeasePmtFreqTypeCodeNavigation")]
- public virtual ICollection PimsLeaseTerms { get; set; } = new List();
+ public virtual ICollection PimsLeasePayments { get; set; } = new List();
+
+ [InverseProperty("AddlRentFreqNavigation")]
+ public virtual ICollection PimsLeasePeriodAddlRentFreqNavigations { get; set; } = new List();
+
+ [InverseProperty("LeasePmtFreqTypeCodeNavigation")]
+ public virtual ICollection PimsLeasePeriodLeasePmtFreqTypeCodeNavigations { get; set; } = new List();
+
+ [InverseProperty("VblRentFreqNavigation")]
+ public virtual ICollection PimsLeasePeriodVblRentFreqNavigations { get; set; } = new List();
}
diff --git a/source/backend/entities/ef/PimsLeaseRenewal.cs b/source/backend/entities/ef/PimsLeaseRenewal.cs
new file mode 100644
index 0000000000..1290079e11
--- /dev/null
+++ b/source/backend/entities/ef/PimsLeaseRenewal.cs
@@ -0,0 +1,147 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+///
+/// Table containing lease renewal options.
+///
+[Table("PIMS_LEASE_RENEWAL")]
+[Index("LeaseId", Name = "LSRNWL_LEASE_ID_IDX")]
+public partial class PimsLeaseRenewal
+{
+ ///
+ /// Generated surrogate primary key
+ ///
+ [Key]
+ [Column("LEASE_RENEWAL_ID")]
+ public long LeaseRenewalId { get; set; }
+
+ ///
+ /// Foreign key to the PIMS_LEASE table.
+ ///
+ [Column("LEASE_ID")]
+ public long LeaseId { get; set; }
+
+ ///
+ /// Date that the lease lease begins.
+ ///
+ [Column("COMMENCEMENT_DT", TypeName = "datetime")]
+ public DateTime? CommencementDt { get; set; }
+
+ ///
+ /// Date that the lease lease ends.
+ ///
+ [Column("EXPIRY_DT", TypeName = "datetime")]
+ public DateTime? ExpiryDt { get; set; }
+
+ ///
+ /// Indicates if the lease renewal was exercised.
+ ///
+ [Column("IS_EXERCISED")]
+ public bool? IsExercised { get; set; }
+
+ ///
+ /// Notes pertaining to the lease reewal.
+ ///
+ [Column("RENEWAL_NOTE")]
+ [StringLength(2000)]
+ public string RenewalNote { get; set; }
+
+ ///
+ /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
+ ///
+ [Column("CONCURRENCY_CONTROL_NUMBER")]
+ public long ConcurrencyControlNumber { get; set; }
+
+ ///
+ /// The date and time the user created the record.
+ ///
+ [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppCreateTimestamp { get; set; }
+
+ ///
+ /// The user account that created the record.
+ ///
+ [Required]
+ [Column("APP_CREATE_USERID")]
+ [StringLength(30)]
+ public string AppCreateUserid { get; set; }
+
+ ///
+ /// The GUID of the user account that created the record.
+ ///
+ [Column("APP_CREATE_USER_GUID")]
+ public Guid? AppCreateUserGuid { get; set; }
+
+ ///
+ /// The directory of the user account that created the record.
+ ///
+ [Required]
+ [Column("APP_CREATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppCreateUserDirectory { get; set; }
+
+ ///
+ /// The date and time the user updated the record.
+ ///
+ [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppLastUpdateTimestamp { get; set; }
+
+ ///
+ /// The user account that updated the record.
+ ///
+ [Required]
+ [Column("APP_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string AppLastUpdateUserid { get; set; }
+
+ ///
+ /// The GUID of the user account that updated the record.
+ ///
+ [Column("APP_LAST_UPDATE_USER_GUID")]
+ public Guid? AppLastUpdateUserGuid { get; set; }
+
+ ///
+ /// The directory of the user account that updated the record.
+ ///
+ [Required]
+ [Column("APP_LAST_UPDATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppLastUpdateUserDirectory { get; set; }
+
+ ///
+ /// The date and time the record was created.
+ ///
+ [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbCreateTimestamp { get; set; }
+
+ ///
+ /// The user or proxy account that created the record.
+ ///
+ [Required]
+ [Column("DB_CREATE_USERID")]
+ [StringLength(30)]
+ public string DbCreateUserid { get; set; }
+
+ ///
+ /// The date and time the record was created or last updated.
+ ///
+ [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbLastUpdateTimestamp { get; set; }
+
+ ///
+ /// The user or proxy account that created or last updated the record.
+ ///
+ [Required]
+ [Column("DB_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string DbLastUpdateUserid { get; set; }
+
+ [ForeignKey("LeaseId")]
+ [InverseProperty("PimsLeaseRenewals")]
+ public virtual PimsLease Lease { get; set; }
+}
diff --git a/source/backend/entities/ef/PimsLeaseTermHist.cs b/source/backend/entities/ef/PimsLeaseRenewalHist.cs
similarity index 59%
rename from source/backend/entities/ef/PimsLeaseTermHist.cs
rename to source/backend/entities/ef/PimsLeaseRenewalHist.cs
index 362d27165a..7f4bec15a7 100644
--- a/source/backend/entities/ef/PimsLeaseTermHist.cs
+++ b/source/backend/entities/ef/PimsLeaseRenewalHist.cs
@@ -6,13 +6,13 @@
namespace Pims.Dal.Entities;
-[Table("PIMS_LEASE_TERM_HIST")]
-[Index("LeaseTermHistId", "EndDateHist", Name = "PIMS_LSTERM_H_UK", IsUnique = true)]
-public partial class PimsLeaseTermHist
+[Table("PIMS_LEASE_RENEWAL_HIST")]
+[Index("LeaseRenewalHistId", "EndDateHist", Name = "PIMS_LSRNWL_H_UK", IsUnique = true)]
+public partial class PimsLeaseRenewalHist
{
[Key]
- [Column("_LEASE_TERM_HIST_ID")]
- public long LeaseTermHistId { get; set; }
+ [Column("_LEASE_RENEWAL_HIST_ID")]
+ public long LeaseRenewalHistId { get; set; }
[Column("EFFECTIVE_DATE_HIST", TypeName = "datetime")]
public DateTime EffectiveDateHist { get; set; }
@@ -20,48 +20,24 @@ public partial class PimsLeaseTermHist
[Column("END_DATE_HIST", TypeName = "datetime")]
public DateTime? EndDateHist { get; set; }
- [Column("LEASE_TERM_ID")]
- public long LeaseTermId { get; set; }
+ [Column("LEASE_RENEWAL_ID")]
+ public long LeaseRenewalId { get; set; }
[Column("LEASE_ID")]
public long LeaseId { get; set; }
- [Column("LEASE_TERM_STATUS_TYPE_CODE")]
- [StringLength(20)]
- public string LeaseTermStatusTypeCode { get; set; }
+ [Column("COMMENCEMENT_DT", TypeName = "datetime")]
+ public DateTime? CommencementDt { get; set; }
- [Column("LEASE_PMT_FREQ_TYPE_CODE")]
- [StringLength(20)]
- public string LeasePmtFreqTypeCode { get; set; }
+ [Column("EXPIRY_DT", TypeName = "datetime")]
+ public DateTime? ExpiryDt { get; set; }
- [Column("TERM_START_DATE", TypeName = "datetime")]
- public DateTime TermStartDate { get; set; }
+ [Column("IS_EXERCISED")]
+ public bool? IsExercised { get; set; }
- [Column("TERM_EXPIRY_DATE", TypeName = "datetime")]
- public DateTime? TermExpiryDate { get; set; }
-
- [Column("TERM_RENEWAL_DATE", TypeName = "datetime")]
- public DateTime? TermRenewalDate { get; set; }
-
- [Column("PAYMENT_AMOUNT", TypeName = "money")]
- public decimal? PaymentAmount { get; set; }
-
- [Column("PAYMENT_DUE_DATE")]
- [StringLength(200)]
- public string PaymentDueDate { get; set; }
-
- [Column("PAYMENT_NOTE")]
+ [Column("RENEWAL_NOTE")]
[StringLength(2000)]
- public string PaymentNote { get; set; }
-
- [Column("IS_GST_ELIGIBLE")]
- public bool? IsGstEligible { get; set; }
-
- [Column("GST_AMOUNT", TypeName = "money")]
- public decimal? GstAmount { get; set; }
-
- [Column("IS_TERM_EXERCISED")]
- public bool? IsTermExercised { get; set; }
+ public string RenewalNote { get; set; }
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
diff --git a/source/backend/entities/ef/PimsLeaseTerm.cs b/source/backend/entities/ef/PimsLeaseTerm.cs
deleted file mode 100644
index a97206f614..0000000000
--- a/source/backend/entities/ef/PimsLeaseTerm.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-using Microsoft.EntityFrameworkCore;
-
-namespace Pims.Dal.Entities;
-
-///
-/// Describes a term for the associated lease.
-///
-[Table("PIMS_LEASE_TERM")]
-[Index("LeaseId", Name = "LSTERM_LEASE_ID_IDX")]
-[Index("LeasePmtFreqTypeCode", Name = "LSTERM_LEASE_PMT_FREQ_TYPE_CODE_IDX")]
-[Index("LeaseTermStatusTypeCode", Name = "LSTERM_LEASE_TERM_STATUS_TYPE_CODE_IDX")]
-public partial class PimsLeaseTerm
-{
- [Key]
- [Column("LEASE_TERM_ID")]
- public long LeaseTermId { get; set; }
-
- [Column("LEASE_ID")]
- public long LeaseId { get; set; }
-
- [Column("LEASE_TERM_STATUS_TYPE_CODE")]
- [StringLength(20)]
- public string LeaseTermStatusTypeCode { get; set; }
-
- ///
- /// Foreign key to payment frequency values
- ///
- [Column("LEASE_PMT_FREQ_TYPE_CODE")]
- [StringLength(20)]
- public string LeasePmtFreqTypeCode { get; set; }
-
- ///
- /// Start date of the current term of the lease/licence
- ///
- [Column("TERM_START_DATE", TypeName = "datetime")]
- public DateTime TermStartDate { get; set; }
-
- ///
- /// Expiry date of the current term of the lease/licence
- ///
- [Column("TERM_EXPIRY_DATE", TypeName = "datetime")]
- public DateTime? TermExpiryDate { get; set; }
-
- ///
- /// Renewal date of the current term of the lease/licence
- ///
- [Column("TERM_RENEWAL_DATE", TypeName = "datetime")]
- public DateTime? TermRenewalDate { get; set; }
-
- ///
- /// Agreed-to payment amount (exclusive of GST)
- ///
- [Column("PAYMENT_AMOUNT", TypeName = "money")]
- public decimal? PaymentAmount { get; set; }
-
- ///
- /// Anecdotal description of payment due date (e.g. 1st of month, end of month)
- ///
- [Column("PAYMENT_DUE_DATE")]
- [StringLength(200)]
- public string PaymentDueDate { get; set; }
-
- ///
- /// Notes regarding payment status for the lease term
- ///
- [Column("PAYMENT_NOTE")]
- [StringLength(2000)]
- public string PaymentNote { get; set; }
-
- ///
- /// Is the lease subject to GST?
- ///
- [Column("IS_GST_ELIGIBLE")]
- public bool? IsGstEligible { get; set; }
-
- ///
- /// Calculated/entered GST portion of the payment. Can be overridden by the user.
- ///
- [Column("GST_AMOUNT", TypeName = "money")]
- public decimal? GstAmount { get; set; }
-
- ///
- /// Has the lease term been exercised?
- ///
- [Column("IS_TERM_EXERCISED")]
- public bool? IsTermExercised { get; set; }
-
- [Column("CONCURRENCY_CONTROL_NUMBER")]
- public long ConcurrencyControlNumber { get; set; }
-
- [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")]
- public DateTime AppCreateTimestamp { get; set; }
-
- [Required]
- [Column("APP_CREATE_USERID")]
- [StringLength(30)]
- public string AppCreateUserid { get; set; }
-
- [Column("APP_CREATE_USER_GUID")]
- public Guid? AppCreateUserGuid { get; set; }
-
- [Required]
- [Column("APP_CREATE_USER_DIRECTORY")]
- [StringLength(30)]
- public string AppCreateUserDirectory { get; set; }
-
- [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
- public DateTime AppLastUpdateTimestamp { get; set; }
-
- [Required]
- [Column("APP_LAST_UPDATE_USERID")]
- [StringLength(30)]
- public string AppLastUpdateUserid { get; set; }
-
- [Column("APP_LAST_UPDATE_USER_GUID")]
- public Guid? AppLastUpdateUserGuid { get; set; }
-
- [Required]
- [Column("APP_LAST_UPDATE_USER_DIRECTORY")]
- [StringLength(30)]
- public string AppLastUpdateUserDirectory { get; set; }
-
- [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
- public DateTime DbCreateTimestamp { get; set; }
-
- [Required]
- [Column("DB_CREATE_USERID")]
- [StringLength(30)]
- public string DbCreateUserid { get; set; }
-
- [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
- public DateTime DbLastUpdateTimestamp { get; set; }
-
- [Required]
- [Column("DB_LAST_UPDATE_USERID")]
- [StringLength(30)]
- public string DbLastUpdateUserid { get; set; }
-
- [ForeignKey("LeaseId")]
- [InverseProperty("PimsLeaseTerms")]
- public virtual PimsLease Lease { get; set; }
-
- [ForeignKey("LeasePmtFreqTypeCode")]
- [InverseProperty("PimsLeaseTerms")]
- public virtual PimsLeasePmtFreqType LeasePmtFreqTypeCodeNavigation { get; set; }
-
- [ForeignKey("LeaseTermStatusTypeCode")]
- [InverseProperty("PimsLeaseTerms")]
- public virtual PimsLeaseTermStatusType LeaseTermStatusTypeCodeNavigation { get; set; }
-
- [InverseProperty("LeaseTerm")]
- public virtual ICollection PimsLeasePayments { get; set; } = new List();
-}
diff --git a/source/backend/entities/ef/PimsLeaseTermStatusType.cs b/source/backend/entities/ef/PimsLeaseTermStatusType.cs
deleted file mode 100644
index 29029a9ceb..0000000000
--- a/source/backend/entities/ef/PimsLeaseTermStatusType.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-using Microsoft.EntityFrameworkCore;
-
-namespace Pims.Dal.Entities;
-
-///
-/// Describes the status of the lease term
-///
-[Table("PIMS_LEASE_TERM_STATUS_TYPE")]
-public partial class PimsLeaseTermStatusType
-{
- ///
- /// Code value of the status of the lease term
- ///
- [Key]
- [Column("LEASE_TERM_STATUS_TYPE_CODE")]
- [StringLength(20)]
- public string LeaseTermStatusTypeCode { get; set; }
-
- ///
- /// Description of the status of the lease term
- ///
- [Required]
- [Column("DESCRIPTION")]
- [StringLength(200)]
- public string Description { get; set; }
-
- [Column("IS_DISABLED")]
- public bool IsDisabled { get; set; }
-
- [Column("DISPLAY_ORDER")]
- public int? DisplayOrder { get; set; }
-
- [Column("CONCURRENCY_CONTROL_NUMBER")]
- public long ConcurrencyControlNumber { get; set; }
-
- [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
- public DateTime DbCreateTimestamp { get; set; }
-
- [Required]
- [Column("DB_CREATE_USERID")]
- [StringLength(30)]
- public string DbCreateUserid { get; set; }
-
- [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
- public DateTime DbLastUpdateTimestamp { get; set; }
-
- [Required]
- [Column("DB_LAST_UPDATE_USERID")]
- [StringLength(30)]
- public string DbLastUpdateUserid { get; set; }
-
- [InverseProperty("LeaseTermStatusTypeCodeNavigation")]
- public virtual ICollection PimsLeaseTerms { get; set; } = new List();
-}
diff --git a/source/backend/entities/ef/PimsPropAcqFlCompReq.cs b/source/backend/entities/ef/PimsPropAcqFlCompReq.cs
new file mode 100644
index 0000000000..4703a32675
--- /dev/null
+++ b/source/backend/entities/ef/PimsPropAcqFlCompReq.cs
@@ -0,0 +1,131 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+[Table("PIMS_PROP_ACQ_FL_COMP_REQ")]
+[Index("CompensationRequisitionId", Name = "PACMRQ_COMPENSATION_REQUISITION_ID_IDX")]
+[Index("PropertyAcquisitionFileId", Name = "PACMRQ_PROPERTY_ACQUISITION_FILE_ID_IDX")]
+[Index("PropertyAcquisitionFileId", "CompensationRequisitionId", Name = "PACMRQ_PROP_COMPREQ_TUC", IsUnique = true)]
+public partial class PimsPropAcqFlCompReq
+{
+ ///
+ /// Generated surrogate primary key.
+ ///
+ [Key]
+ [Column("PROP_ACQ_FL_COMP_REQ_ID")]
+ public long PropAcqFlCompReqId { get; set; }
+
+ ///
+ /// Foreign key reference to the PROPERTY_ACQUISITION_FILE table.
+ ///
+ [Column("PROPERTY_ACQUISITION_FILE_ID")]
+ public long PropertyAcquisitionFileId { get; set; }
+
+ ///
+ /// Foreign key reference to the COMPENSATION_REQUISITION table.
+ ///
+ [Column("COMPENSATION_REQUISITION_ID")]
+ public long CompensationRequisitionId { get; set; }
+
+ ///
+ /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
+ ///
+ [Column("CONCURRENCY_CONTROL_NUMBER")]
+ public long ConcurrencyControlNumber { get; set; }
+
+ ///
+ /// The date and time the user created the record.
+ ///
+ [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppCreateTimestamp { get; set; }
+
+ ///
+ /// The user account that created the record.
+ ///
+ [Required]
+ [Column("APP_CREATE_USERID")]
+ [StringLength(30)]
+ public string AppCreateUserid { get; set; }
+
+ ///
+ /// The GUID of the user account that created the record.
+ ///
+ [Column("APP_CREATE_USER_GUID")]
+ public Guid? AppCreateUserGuid { get; set; }
+
+ ///
+ /// The directory of the user account that created the record.
+ ///
+ [Required]
+ [Column("APP_CREATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppCreateUserDirectory { get; set; }
+
+ ///
+ /// The date and time the user updated the record.
+ ///
+ [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppLastUpdateTimestamp { get; set; }
+
+ ///
+ /// The user account that updated the record.
+ ///
+ [Required]
+ [Column("APP_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string AppLastUpdateUserid { get; set; }
+
+ ///
+ /// The GUID of the user account that updated the record.
+ ///
+ [Column("APP_LAST_UPDATE_USER_GUID")]
+ public Guid? AppLastUpdateUserGuid { get; set; }
+
+ ///
+ /// The directory of the user account that updated the record.
+ ///
+ [Required]
+ [Column("APP_LAST_UPDATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppLastUpdateUserDirectory { get; set; }
+
+ ///
+ /// The date and time the record was created.
+ ///
+ [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbCreateTimestamp { get; set; }
+
+ ///
+ /// The user or proxy account that created the record.
+ ///
+ [Required]
+ [Column("DB_CREATE_USERID")]
+ [StringLength(30)]
+ public string DbCreateUserid { get; set; }
+
+ ///
+ /// The date and time the record was created or last updated.
+ ///
+ [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbLastUpdateTimestamp { get; set; }
+
+ ///
+ /// The user or proxy account that created or last updated the record.
+ ///
+ [Required]
+ [Column("DB_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string DbLastUpdateUserid { get; set; }
+
+ [ForeignKey("CompensationRequisitionId")]
+ [InverseProperty("PimsPropAcqFlCompReqs")]
+ public virtual PimsCompensationRequisition CompensationRequisition { get; set; }
+
+ [ForeignKey("PropertyAcquisitionFileId")]
+ [InverseProperty("PimsPropAcqFlCompReqs")]
+ public virtual PimsPropertyAcquisitionFile PropertyAcquisitionFile { get; set; }
+}
diff --git a/source/backend/entities/ef/PimsPropAcqFlCompReqHist.cs b/source/backend/entities/ef/PimsPropAcqFlCompReqHist.cs
new file mode 100644
index 0000000000..a29fd13a5e
--- /dev/null
+++ b/source/backend/entities/ef/PimsPropAcqFlCompReqHist.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+[Table("PIMS_PROP_ACQ_FL_COMP_REQ_HIST")]
+[Index("PropAcqFlCompReqHistId", "EndDateHist", Name = "PIMS_PACMRQ_H_UK", IsUnique = true)]
+public partial class PimsPropAcqFlCompReqHist
+{
+ [Key]
+ [Column("_PROP_ACQ_FL_COMP_REQ_HIST_ID")]
+ public long PropAcqFlCompReqHistId { get; set; }
+
+ [Column("EFFECTIVE_DATE_HIST", TypeName = "datetime")]
+ public DateTime EffectiveDateHist { get; set; }
+
+ [Column("END_DATE_HIST", TypeName = "datetime")]
+ public DateTime? EndDateHist { get; set; }
+
+ [Column("PROP_ACQ_FL_COMP_REQ_ID")]
+ public long PropAcqFlCompReqId { get; set; }
+
+ [Column("PROPERTY_ACQUISITION_FILE_ID")]
+ public long PropertyAcquisitionFileId { get; set; }
+
+ [Column("COMPENSATION_REQUISITION_ID")]
+ public long CompensationRequisitionId { get; set; }
+
+ [Column("CONCURRENCY_CONTROL_NUMBER")]
+ public long ConcurrencyControlNumber { get; set; }
+
+ [Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppCreateTimestamp { get; set; }
+
+ [Required]
+ [Column("APP_CREATE_USERID")]
+ [StringLength(30)]
+ public string AppCreateUserid { get; set; }
+
+ [Column("APP_CREATE_USER_GUID")]
+ public Guid? AppCreateUserGuid { get; set; }
+
+ [Required]
+ [Column("APP_CREATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppCreateUserDirectory { get; set; }
+
+ [Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime AppLastUpdateTimestamp { get; set; }
+
+ [Required]
+ [Column("APP_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string AppLastUpdateUserid { get; set; }
+
+ [Column("APP_LAST_UPDATE_USER_GUID")]
+ public Guid? AppLastUpdateUserGuid { get; set; }
+
+ [Required]
+ [Column("APP_LAST_UPDATE_USER_DIRECTORY")]
+ [StringLength(30)]
+ public string AppLastUpdateUserDirectory { get; set; }
+
+ [Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbCreateTimestamp { get; set; }
+
+ [Required]
+ [Column("DB_CREATE_USERID")]
+ [StringLength(30)]
+ public string DbCreateUserid { get; set; }
+
+ [Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
+ public DateTime DbLastUpdateTimestamp { get; set; }
+
+ [Required]
+ [Column("DB_LAST_UPDATE_USERID")]
+ [StringLength(30)]
+ public string DbLastUpdateUserid { get; set; }
+}
diff --git a/source/backend/entities/ef/PimsPropertyAcquisitionFile.cs b/source/backend/entities/ef/PimsPropertyAcquisitionFile.cs
index 9e0380be5c..74b64d9351 100644
--- a/source/backend/entities/ef/PimsPropertyAcquisitionFile.cs
+++ b/source/backend/entities/ef/PimsPropertyAcquisitionFile.cs
@@ -3,6 +3,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
+using NetTopologySuite.Geometries;
namespace Pims.Dal.Entities;
@@ -15,13 +16,22 @@ namespace Pims.Dal.Entities;
[Index("PropertyId", "AcquisitionFileId", Name = "PRACQF_PROP_ACQ_TUC", IsUnique = true)]
public partial class PimsPropertyAcquisitionFile
{
+ ///
+ /// Generated surrogate primary key.
+ ///
[Key]
[Column("PROPERTY_ACQUISITION_FILE_ID")]
public long PropertyAcquisitionFileId { get; set; }
+ ///
+ /// Foreign key to the ACQUISTION_FILE table.
+ ///
[Column("ACQUISITION_FILE_ID")]
public long AcquisitionFileId { get; set; }
+ ///
+ /// Foreign key to the PROPERTY table.
+ ///
[Column("PROPERTY_ID")]
public long PropertyId { get; set; }
@@ -32,58 +42,103 @@ public partial class PimsPropertyAcquisitionFile
[StringLength(500)]
public string PropertyName { get; set; }
+ ///
+ /// Geospatial location (pin) of property
+ ///
+ [Column("LOCATION", TypeName = "geometry")]
+ public Geometry Location { get; set; }
+
///
/// Force the display order of the codes.
///
[Column("DISPLAY_ORDER")]
public int? DisplayOrder { get; set; }
+ ///
+ /// Application code is responsible for retrieving the row and then incrementing the value of the CONCURRENCY_CONTROL_NUMBER column by one prior to issuing an update. If this is done then the update will succeed, provided that the row was not updated by any o
+ ///
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
+ ///
+ /// The date and time the user created the record.
+ ///
[Column("APP_CREATE_TIMESTAMP", TypeName = "datetime")]
public DateTime AppCreateTimestamp { get; set; }
+ ///
+ /// The user account that created the record.
+ ///
[Required]
[Column("APP_CREATE_USERID")]
[StringLength(30)]
public string AppCreateUserid { get; set; }
+ ///
+ /// The GUID of the user account that created the record.
+ ///
[Column("APP_CREATE_USER_GUID")]
public Guid? AppCreateUserGuid { get; set; }
+ ///
+ /// The directory of the user account that created the record.
+ ///
[Required]
[Column("APP_CREATE_USER_DIRECTORY")]
[StringLength(30)]
public string AppCreateUserDirectory { get; set; }
+ ///
+ /// The date and time the user updated the record.
+ ///
[Column("APP_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
public DateTime AppLastUpdateTimestamp { get; set; }
+ ///
+ /// The user account that updated the record.
+ ///
[Required]
[Column("APP_LAST_UPDATE_USERID")]
[StringLength(30)]
public string AppLastUpdateUserid { get; set; }
+ ///
+ /// The GUID of the user account that updated the record.
+ ///
[Column("APP_LAST_UPDATE_USER_GUID")]
public Guid? AppLastUpdateUserGuid { get; set; }
+ ///
+ /// The directory of the user account that updated the record.
+ ///
[Required]
[Column("APP_LAST_UPDATE_USER_DIRECTORY")]
[StringLength(30)]
public string AppLastUpdateUserDirectory { get; set; }
+ ///
+ /// The date and time the record was created.
+ ///
[Column("DB_CREATE_TIMESTAMP", TypeName = "datetime")]
public DateTime DbCreateTimestamp { get; set; }
+ ///
+ /// The user or proxy account that created the record.
+ ///
[Required]
[Column("DB_CREATE_USERID")]
[StringLength(30)]
public string DbCreateUserid { get; set; }
+ ///
+ /// The date and time the record was created or last updated.
+ ///
[Column("DB_LAST_UPDATE_TIMESTAMP", TypeName = "datetime")]
public DateTime DbLastUpdateTimestamp { get; set; }
+ ///
+ /// The user or proxy account that created or last updated the record.
+ ///
[Required]
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
@@ -96,6 +151,9 @@ public partial class PimsPropertyAcquisitionFile
[InverseProperty("PropertyAcquisitionFile")]
public virtual ICollection PimsInthldrPropInterests { get; set; } = new List();
+ [InverseProperty("PropertyAcquisitionFile")]
+ public virtual ICollection PimsPropAcqFlCompReqs { get; set; } = new List();
+
[InverseProperty("PropertyAcquisitionFile")]
public virtual ICollection PimsTakes { get; set; } = new List();
diff --git a/source/backend/entities/ef/PimsPropertyActivity.cs b/source/backend/entities/ef/PimsPropertyActivity.cs
index 0d03262e51..319e627903 100644
--- a/source/backend/entities/ef/PimsPropertyActivity.cs
+++ b/source/backend/entities/ef/PimsPropertyActivity.cs
@@ -73,7 +73,6 @@ public partial class PimsPropertyActivity
/// Description of the property management activity.
///
[Column("DESCRIPTION")]
- [StringLength(2000)]
public string Description { get; set; }
///
diff --git a/source/backend/entities/ef/PimsPropertyActivityHist.cs b/source/backend/entities/ef/PimsPropertyActivityHist.cs
index f9d39e7145..527df3ccf7 100644
--- a/source/backend/entities/ef/PimsPropertyActivityHist.cs
+++ b/source/backend/entities/ef/PimsPropertyActivityHist.cs
@@ -51,7 +51,6 @@ public partial class PimsPropertyActivityHist
public DateOnly? CompletionDt { get; set; }
[Column("DESCRIPTION")]
- [StringLength(2000)]
public string Description { get; set; }
[Column("REQUEST_SOURCE")]
diff --git a/source/backend/entities/ef/PimsPropertyLease.cs b/source/backend/entities/ef/PimsPropertyLease.cs
index 83e47d6622..194eff4394 100644
--- a/source/backend/entities/ef/PimsPropertyLease.cs
+++ b/source/backend/entities/ef/PimsPropertyLease.cs
@@ -3,6 +3,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
+using NetTopologySuite.Geometries;
namespace Pims.Dal.Entities;
@@ -90,6 +91,12 @@ public partial class PimsPropertyLease
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+ ///
+ /// Geospatial location (pin) of property
+ ///
+ [Column("LOCATION", TypeName = "geometry")]
+ public Geometry Location { get; set; }
+
[ForeignKey("AreaUnitTypeCode")]
[InverseProperty("PimsPropertyLeases")]
public virtual PimsAreaUnitType AreaUnitTypeCodeNavigation { get; set; }
diff --git a/source/backend/entities/ef/PimsPropertyResearchFile.cs b/source/backend/entities/ef/PimsPropertyResearchFile.cs
index 3725ccf487..55928b746c 100644
--- a/source/backend/entities/ef/PimsPropertyResearchFile.cs
+++ b/source/backend/entities/ef/PimsPropertyResearchFile.cs
@@ -3,6 +3,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
+using NetTopologySuite.Geometries;
namespace Pims.Dal.Entities;
@@ -114,6 +115,12 @@ public partial class PimsPropertyResearchFile
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+ ///
+ /// Geospatial location (pin) of property
+ ///
+ [Column("LOCATION", TypeName = "geometry")]
+ public Geometry Location { get; set; }
+
[InverseProperty("PropertyResearchFile")]
public virtual ICollection PimsPrfPropResearchPurposeTypes { get; set; } = new List();
diff --git a/source/backend/ltsa/ILtsaService.cs b/source/backend/ltsa/ILtsaService.cs
index e43d5dcf5a..79e19e0bd0 100644
--- a/source/backend/ltsa/ILtsaService.cs
+++ b/source/backend/ltsa/ILtsaService.cs
@@ -1,3 +1,4 @@
+using Pims.Core.Http.Models;
using Pims.Ltsa.Models;
using System.Threading.Tasks;
@@ -5,6 +6,7 @@ namespace Pims.Ltsa
{
public interface ILtsaService
{
+ Task GetTokenAsync(string integratorUsername = null, string integratorPassword = null, string myLtsaUsername = null, string myLtsaUserPassword = null);
Task GetTitleSummariesAsync(int pid);
Task>> PostTitleOrder(string titleNumber, string landTitleDistrictCode);
Task>> PostParcelInfoOrder(string pid);
diff --git a/source/backend/tests/core/Entities/AcquisitionFileChecklistHelper.cs b/source/backend/tests/core/Entities/AcquisitionFileChecklistHelper.cs
index bdf0f992e6..7709b2d0ce 100644
--- a/source/backend/tests/core/Entities/AcquisitionFileChecklistHelper.cs
+++ b/source/backend/tests/core/Entities/AcquisitionFileChecklistHelper.cs
@@ -1,5 +1,6 @@
using System;
using System.Linq;
+using Pims.Api.Models.CodeTypes;
using Pims.Dal;
using Pims.Dal.Entities;
using Entity = Pims.Dal.Entities;
@@ -15,7 +16,7 @@ public static partial class EntityHelper
/// Create a new instance of an Acquisition File checklist item.
///
///
- public static Entity.PimsAcquisitionChecklistItem CreateAcquisitionChecklistItem(long? id = null, long? acquisitionFileId = null, PimsAcqChklstItemStatusType statusType = null, PimsAcqChklstItemType itemType = null)
+ public static Entity.PimsAcquisitionChecklistItem CreateAcquisitionChecklistItem(long? id = null, long? acquisitionFileId = null, PimsChklstItemStatusType statusType = null, PimsAcqChklstItemType itemType = null)
{
var checklistItem = new Entity.PimsAcquisitionChecklistItem()
{
@@ -30,8 +31,8 @@ public static Entity.PimsAcquisitionChecklistItem CreateAcquisitionChecklistItem
DbLastUpdateUserid = string.Empty,
ConcurrencyControlNumber = 1,
};
- checklistItem.AcqChklstItemStatusTypeCodeNavigation = statusType ?? new Entity.PimsAcqChklstItemStatusType() { Id = "INCOMP", Description = "Incomplete", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now };
- checklistItem.AcqChklstItemStatusTypeCode = checklistItem.AcqChklstItemStatusTypeCodeNavigation.Id;
+ checklistItem.ChklstItemStatusTypeCodeNavigation = statusType ?? new Entity.PimsChklstItemStatusType() { Id = ChecklistItemStatusTypes.INCOMP.ToString(), Description = "Incomplete", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now };
+ checklistItem.ChklstItemStatusTypeCode = checklistItem.ChklstItemStatusTypeCodeNavigation.Id;
checklistItem.AcqChklstItemTypeCodeNavigation = itemType ?? new Entity.PimsAcqChklstItemType() { Id = "APPRAISE", Description = "Appraisals and reviews", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now, AcqChklstSectionTypeCode = "section" };
checklistItem.AcqChklstItemTypeCode = checklistItem.AcqChklstItemTypeCodeNavigation.Id;
@@ -44,7 +45,7 @@ public static Entity.PimsAcquisitionChecklistItem CreateAcquisitionChecklistItem
///
public static Entity.PimsAcquisitionChecklistItem CreateAcquisitionChecklistItem(this PimsContext context, long? id = null, long? acquisitionFileId = null)
{
- var statusType = context.PimsAcqChklstItemStatusTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find checklist item status type.");
+ var statusType = context.PimsChklstItemStatusTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find checklist item status type.");
var itemType = context.PimsAcqChklstItemTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find checklist item type.");
var checklistItem = EntityHelper.CreateAcquisitionChecklistItem(id: id, acquisitionFileId: acquisitionFileId, statusType: statusType, itemType: itemType);
context.PimsAcquisitionChecklistItems.Add(checklistItem);
diff --git a/source/backend/tests/core/Entities/DispositionFileChecklistHelper.cs b/source/backend/tests/core/Entities/DispositionFileChecklistHelper.cs
index cec05102a1..958c04b2b8 100644
--- a/source/backend/tests/core/Entities/DispositionFileChecklistHelper.cs
+++ b/source/backend/tests/core/Entities/DispositionFileChecklistHelper.cs
@@ -15,7 +15,7 @@ public static partial class EntityHelper
/// Create a new instance of an Disposition File checklist item.
///
///
- public static Entity.PimsDispositionChecklistItem CreateDispositionChecklistItem(long? id = null, long? dispositionFileId = null, PimsDspChklstItemStatusType statusType = null, PimsDspChklstItemType itemType = null)
+ public static Entity.PimsDispositionChecklistItem CreateDispositionChecklistItem(long? id = null, long? dispositionFileId = null, PimsChklstItemStatusType statusType = null, PimsDspChklstItemType itemType = null)
{
var checklistItem = new Entity.PimsDispositionChecklistItem()
{
@@ -30,8 +30,8 @@ public static Entity.PimsDispositionChecklistItem CreateDispositionChecklistItem
DbLastUpdateUserid = string.Empty,
ConcurrencyControlNumber = 1,
};
- checklistItem.DspChklstItemStatusTypeCodeNavigation = statusType ?? new Entity.PimsDspChklstItemStatusType() { Id = "INCOMP", Description = "Incomplete", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now };
- checklistItem.DspChklstItemStatusTypeCode = checklistItem.DspChklstItemStatusTypeCodeNavigation.Id;
+ checklistItem.ChklstItemStatusTypeCodeNavigation = statusType ?? new Entity.PimsChklstItemStatusType() { Id = "INCOMP", Description = "Incomplete", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now };
+ checklistItem.ChklstItemStatusTypeCode = checklistItem.ChklstItemStatusTypeCodeNavigation.Id;
checklistItem.DspChklstItemTypeCodeNavigation = itemType ?? new Entity.PimsDspChklstItemType() { Id = "APPRAISE", Description = "Appraisals and reviews", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now, DspChklstSectionTypeCode = "section" };
checklistItem.DspChklstItemTypeCode = checklistItem.DspChklstItemTypeCodeNavigation.Id;
@@ -44,7 +44,7 @@ public static Entity.PimsDispositionChecklistItem CreateDispositionChecklistItem
///
public static Entity.PimsDispositionChecklistItem CreateDispositionChecklistItem(this PimsContext context, long? id = null, long? dispositionFileId = null)
{
- var statusType = context.PimsDspChklstItemStatusTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find checklist item status type.");
+ var statusType = context.PimsChklstItemStatusTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find checklist item status type.");
var itemType = context.PimsDspChklstItemTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find checklist item type.");
var checklistItem = EntityHelper.CreateDispositionChecklistItem(id: id, dispositionFileId: dispositionFileId, statusType: statusType, itemType: itemType);
context.PimsDispositionChecklistItems.Add(checklistItem);
diff --git a/source/backend/tests/core/Entities/NtsGeometryHelper.cs b/source/backend/tests/core/Entities/NtsGeometryHelper.cs
new file mode 100644
index 0000000000..313dfe07ee
--- /dev/null
+++ b/source/backend/tests/core/Entities/NtsGeometryHelper.cs
@@ -0,0 +1,66 @@
+using NetTopologySuite.Geometries;
+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 Polygon.
+ ///
+ /// The target spatial reference Id (4396 = lat/lon), (3005 = BC ALBERS).
+ /// A polygon geometry instance.
+ public static Polygon CreatePolygon(int spatialReferenceId = 4396)
+ {
+ return CreatePolygon(
+ new[]
+ {
+ new Coordinate(-100, 45),
+ new Coordinate(-98, 45),
+ new Coordinate(-99, 46),
+ new Coordinate(-100, 45),
+ },
+ spatialReferenceId);
+ }
+
+ ///
+ /// Creates a new instance of a Polygon.
+ ///
+ /// An array without null elements, or an empty array, or null.
+ /// The target spatial reference Id (4396 = lat/lon), (3005 = BC ALBERS).
+ /// A polygon geometry instance.
+ public static Polygon CreatePolygon(Coordinate[] coordinates, int spatialReferenceId = 4396)
+ {
+ var gf = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(spatialReferenceId);
+ return gf.CreatePolygon(gf.CreateLinearRing(coordinates));
+ }
+
+ ///
+ /// Creates a geometric point object for the specified 'longitude' and 'latitude'.
+ ///
+ /// The x coordinate.
+ /// The y coordinate.
+ /// Spatial Reference Identifier (SRID) is a unique identifier associated with a specific coordinate system, tolerance, and resolution (default 4326).
+ /// A NetTopologySuite.Geometries.Point object.
+ public static Point CreatePoint(double longitude, double latitude, int spatialReferenceId)
+ {
+ return CreatePoint(new Coordinate(longitude, latitude), spatialReferenceId);
+ }
+
+ ///
+ /// Creates a Point using the given Coordinate. A null coordinate creates an empty Geometry.
+ ///
+ /// a Coordinate, or null.
+ /// Spatial Reference Identifier (SRID) is a unique identifier associated with a specific coordinate system, tolerance, and resolution (default 4326).
+ /// A NetTopologySuite.Geometries.Point object.
+ public static Point CreatePoint(Coordinate coordinate, int spatialReferenceId)
+ {
+ // Spatial Reference Identifier (SRID) is a unique identifier associated with a specific coordinate system, tolerance, and resolution (default 4326)
+ var gf = NetTopologySuite.NtsGeometryServices.Instance.CreateGeometryFactory(spatialReferenceId);
+ return gf.CreatePoint(coordinate);
+ }
+ }
+}
diff --git a/source/backend/tests/unit/api/Controllers/Leases/LeasePeriodControllerTest.cs b/source/backend/tests/unit/api/Controllers/Leases/LeasePeriodControllerTest.cs
new file mode 100644
index 0000000000..ec40fb88f0
--- /dev/null
+++ b/source/backend/tests/unit/api/Controllers/Leases/LeasePeriodControllerTest.cs
@@ -0,0 +1,98 @@
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using FluentAssertions;
+using MapsterMapper;
+using Microsoft.AspNetCore.Mvc;
+using Moq;
+using Pims.Api.Areas.Lease.Controllers;
+using Pims.Api.Models.Concepts.Lease;
+using Pims.Api.Models.Concepts;
+using Pims.Api.Services;
+using Pims.Core.Test;
+using Pims.Dal;
+using Pims.Dal.Repositories;
+using Pims.Dal.Security;
+using Pims.Dal.Services;
+using Xunit;
+
+namespace Pims.Api.Test.Controllers.Lease
+{
+ [Trait("category", "unit")]
+ [Trait("category", "api")]
+ [Trait("group", "lease")]
+ [ExcludeFromCodeCoverage]
+ public class LeasePeriodControllerTest
+ {
+ private Mock _service;
+ private LeasePeriodController _controller;
+ private IMapper _mapper;
+ private TestHelper _helper;
+
+ public LeasePeriodControllerTest()
+ {
+ this._helper = new TestHelper();
+ this._controller = this._helper.CreateController(Permissions.LeaseView);
+ this._mapper = this._helper.GetService();
+ this._service = this._helper.GetService>();
+ }
+
+ #region Tests
+ ///
+ /// Make a successful request.
+ ///
+ [Fact]
+ public void UpdateLeasePeriods_Success()
+ {
+ // Arrange
+ var lease = EntityHelper.CreateLease(1);
+ var leasePeriod = new Dal.Entities.PimsLeasePeriod() { LeasePeriodId = 1 };
+
+ this._service.Setup(m => m.UpdatePeriod(It.IsAny(), It.IsAny(), It.IsAny())).Returns(leasePeriod);
+
+ // Act
+ var result = this._controller.UpdatePeriod(lease.LeaseId, leasePeriod.LeasePeriodId, this._mapper.Map(leasePeriod));
+
+ // Assert
+ this._service.Verify(m => m.UpdatePeriod(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once());
+ }
+
+ ///
+ /// Make a successful request.
+ ///
+ [Fact]
+ public void DeleteLeasePeriods_Success()
+ {
+ // Arrange
+ var lease = EntityHelper.CreateLease(1);
+ var leasePeriod = new Dal.Entities.PimsLeasePeriod();
+
+ this._service.Setup(m => m.DeletePeriod(It.IsAny(), It.IsAny())).Returns(true);
+
+ // Act
+ var result = this._controller.DeletePeriod(lease.LeaseId, this._mapper.Map(leasePeriod));
+
+ // Assert
+ this._service.Verify(m => m.DeletePeriod(It.IsAny(), It.IsAny()), Times.Once());
+ }
+
+ ///
+ /// Make a successful request.
+ ///
+ [Fact]
+ public void AddLeasePeriods_Success()
+ {
+ // Arrange
+ var lease = EntityHelper.CreateLease(1);
+ var leasePeriod = new Dal.Entities.PimsLeasePeriod();
+
+ this._service.Setup(m => m.AddPeriod(It.IsAny(), It.IsAny())).Returns(leasePeriod);
+
+ // Act
+ var result = this._controller.AddPeriod(lease.LeaseId, this._mapper.Map(leasePeriod));
+
+ // Assert
+ this._service.Verify(m => m.AddPeriod(It.IsAny(), It.IsAny()), Times.Once());
+ }
+ #endregion
+ }
+}
diff --git a/source/backend/tests/unit/api/Controllers/Leases/LeaseTermControllerTest.cs b/source/backend/tests/unit/api/Controllers/Leases/LeaseTermControllerTest.cs
deleted file mode 100644
index 67ae82fd00..0000000000
--- a/source/backend/tests/unit/api/Controllers/Leases/LeaseTermControllerTest.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using FluentAssertions;
-using MapsterMapper;
-using Microsoft.AspNetCore.Mvc;
-using Moq;
-using Pims.Api.Areas.Lease.Controllers;
-using Pims.Api.Models.Concepts.Lease;
-using Pims.Api.Models.Concepts;
-using Pims.Api.Services;
-using Pims.Core.Test;
-using Pims.Dal;
-using Pims.Dal.Repositories;
-using Pims.Dal.Security;
-using Pims.Dal.Services;
-using Xunit;
-
-namespace Pims.Api.Test.Controllers.Lease
-{
- [Trait("category", "unit")]
- [Trait("category", "api")]
- [Trait("group", "lease")]
- [ExcludeFromCodeCoverage]
- public class LeaseTermControllerTest
- {
- private Mock _service;
- private LeaseTermController _controller;
- private IMapper _mapper;
- private TestHelper _helper;
-
- public LeaseTermControllerTest()
- {
- this._helper = new TestHelper();
- this._controller = this._helper.CreateController(Permissions.LeaseView);
- this._mapper = this._helper.GetService();
- this._service = this._helper.GetService>();
- }
-
- #region Tests
- ///
- /// Make a successful request.
- ///
- [Fact]
- public void UpdateLeaseTerms_Success()
- {
- // Arrange
- var lease = EntityHelper.CreateLease(1);
- var leaseTerm = new Dal.Entities.PimsLeaseTerm() { LeaseTermId = 1 };
-
- this._service.Setup(m => m.UpdateTerm(It.IsAny(), It.IsAny(), It.IsAny())).Returns(leaseTerm);
-
- // Act
- var result = this._controller.UpdateTerm(lease.LeaseId, leaseTerm.LeaseTermId, this._mapper.Map(leaseTerm));
-
- // Assert
- this._service.Verify(m => m.UpdateTerm(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once());
- }
-
- ///
- /// Make a successful request.
- ///
- [Fact]
- public void DeleteLeaseTerms_Success()
- {
- // Arrange
- var lease = EntityHelper.CreateLease(1);
- var leaseTerm = new Dal.Entities.PimsLeaseTerm();
-
- this._service.Setup(m => m.DeleteTerm(It.IsAny(), It.IsAny())).Returns(true);
-
- // Act
- var result = this._controller.DeleteTerm(lease.LeaseId, this._mapper.Map(leaseTerm));
-
- // Assert
- this._service.Verify(m => m.DeleteTerm(It.IsAny(), It.IsAny()), Times.Once());
- }
-
- ///
- /// Make a successful request.
- ///
- [Fact]
- public void AddLeaseTerms_Success()
- {
- // Arrange
- var lease = EntityHelper.CreateLease(1);
- var leaseTerm = new Dal.Entities.PimsLeaseTerm();
-
- this._service.Setup(m => m.AddTerm(It.IsAny(), It.IsAny())).Returns(leaseTerm);
-
- // Act
- var result = this._controller.AddTerm(lease.LeaseId, this._mapper.Map(leaseTerm));
-
- // Assert
- this._service.Verify(m => m.AddTerm(It.IsAny(), It.IsAny()), Times.Once());
- }
- #endregion
- }
-}
diff --git a/source/backend/tests/unit/api/Controllers/LookupControllerTest.cs b/source/backend/tests/unit/api/Controllers/LookupControllerTest.cs
index f2050feadd..08294eb037 100644
--- a/source/backend/tests/unit/api/Controllers/LookupControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/LookupControllerTest.cs
@@ -82,7 +82,7 @@ public void GetAll()
var classificationTypes = EntityHelper.CreatePropertyClassificationType("classification");
this._repository.Setup(m => m.GetAllPropertyClassificationTypes()).Returns(new[] { classificationTypes });
- var countries = EntityHelper.CreateCountry(1, "CAN");
+ var countries = EntityHelper.CreateCountry(1, "CA");
this._repository.Setup(m => m.GetAllCountries()).Returns(new[] { countries });
var districts = EntityHelper.CreateDistrict(1, "district");
diff --git a/source/backend/tests/unit/api/Controllers/Reports/LeaseControllerTest.cs b/source/backend/tests/unit/api/Controllers/Reports/LeaseControllerTest.cs
index 60b3aae7ef..97d19b291b 100644
--- a/source/backend/tests/unit/api/Controllers/Reports/LeaseControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/Reports/LeaseControllerTest.cs
@@ -165,21 +165,52 @@ public void ExportLeases_Lease_Mapping()
result.InspectionNotes.Should().Be("inspection note");
}
+ public static IEnumerable