diff --git a/.github/workflows/api-dotnetcore.yml b/.github/workflows/api-dotnetcore.yml
index 57157ef17f..a21a58c2f2 100644
--- a/.github/workflows/api-dotnetcore.yml
+++ b/.github/workflows/api-dotnetcore.yml
@@ -104,21 +104,16 @@ jobs:
cd ..
head TestResults/coverage.opencover.xml
- - name: Codecov
- uses: codecov/codecov-action@v3.1.1
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV }}
+ - name: Save PR number and scan results
+ run: |
+ mkdir -p ./pr
+ echo ${{ github.event.pull_request.number }} > ./pr/NR
+ cp ${{env.working-directory}}/tests/unit/TestResults/coverage.opencover.xml ./pr
+
+ - uses: actions/upload-artifact@v4
with:
- # User defined upload name. Visible in Codecov UI
- name: PIMS
- # Path to coverage file to upload
- file: ${{env.working-directory}}/tests/unit/TestResults/coverage.opencover.xml
- # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
- flags: unittests
- # Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
- env_vars: C#
- # Specify whether or not CI build should fail if Codecov runs into an error during upload
- fail_ci_if_error: false
+ name: pr-codecov
+ path: pr/
- name: SonarScanner for .NET 8 with pull request decoration support
id: scan
diff --git a/.github/workflows/app-react.yml b/.github/workflows/app-react.yml
index 0972c92cf9..87453e04f3 100644
--- a/.github/workflows/app-react.yml
+++ b/.github/workflows/app-react.yml
@@ -57,36 +57,30 @@ jobs:
env:
REACT_APP_TENANT: MOTI
- - name: Codecov
- uses: codecov/codecov-action@v3.1.1
- env:
- CODECOV_TOKEN: ${{ secrets.CODECOV }}
+ - name: Save PR number and scan results
+ run: |
+ mkdir -p ./pr
+ echo ${{ github.event.pull_request.number }} > ./pr/NR
+ cp ${{env.working-directory}}/coverage/coverage-final.json ./pr
+
+ - uses: actions/upload-artifact@v4
with:
- # User defined upload name. Visible in Codecov UI
- name: PIMS
- # Path to coverage file to upload
- file: ${{env.working-directory}}/coverage/coverage-final.json
- # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
- flags: unittests
- # Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
- env_vars: javascript
- # Specify whether or not CI build should fail if Codecov runs into an error during upload
- fail_ci_if_error: false
+ name: pr-codecov
+ path: pr/
- name: SonarQube Scan
id: scan
uses: sonarsource/sonarqube-scan-action@master
- if: false
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- SONAR_HOST_URL: ${{ secrets.SONAR_URL }}
- PROJECT_KEY: ${{secrets.PROJECT_KEY_APP}}
+ SONAR_HOST_URL: https://sonarqube-3cd915-tools.apps.silver.devops.gov.bc.ca/
+ PROJECT_KEY: 21faa627-fe70-4a67-89e3-1262a32d2e2c
PROJECT_NAME: PIMS-APP
with:
projectBaseDir: ${{env.working-directory}}
args: >
- -Dsonar.projectKey=${{env.PROJECT_KEY}}
- -Dsonar.projectName=${{env.PROJECT_NAME}}
+ -Dsonar.projectKey=21faa627-fe70-4a67-89e3-1262a32d2e2c
+ -Dsonar.projectName=PIMS-APP
-Dsonar.qualitygate.wait=true
# Send notifications only if MS_TEAMS_NOTIFY_URL secret has been set
diff --git a/.github/workflows/ci-cd-pims-dev.yml b/.github/workflows/ci-cd-pims-dev.yml
index 0784a6cfcb..c30e40a654 100644
--- a/.github/workflows/ci-cd-pims-dev.yml
+++ b/.github/workflows/ci-cd-pims-dev.yml
@@ -7,7 +7,6 @@ env:
MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}
AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET }}
AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }}
- sync-directory: ./tools/keycloak/sync
ASPNETCORE_ENVIRONMENT: "Development"
## variables for scripts under git\openshift\4.0\scripts\oc-*.sh
@@ -101,6 +100,7 @@ jobs:
run: |
./openshift/4.0/player.sh deploy api $DESTINATION -apply
./openshift/4.0/player.sh deploy app $DESTINATION -apply
+ oc tag mayan-bcgov:latest-$DESTINATION mayan-bcgov:$DESTINATION
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
@@ -127,31 +127,6 @@ jobs:
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
- needs: database-upgrade
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Source Code
- uses: actions/checkout@v4
-
- - name: Setup .NET 8
- uses: actions/setup-dotnet@v3
- with:
- dotnet-version: "8.0.x"
-
- - name: Install dependencies for keycloak sync
- run: dotnet restore
- working-directory: ${{env.sync-directory}}
-
- - name: Build keycloak sync
- run: dotnet build
- working-directory: ${{env.sync-directory}}
-
- - name: Start keycloak sync
- run: dotnet run
- working-directory: ${{env.sync-directory}}
-
## 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.
mayan-sync:
@@ -175,11 +150,30 @@ jobs:
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-dev-only-4700 -p MAYAN_SYNC_URL=https://pims-app-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso | 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-dev-only-4700 -p MAYAN_SYNC_URL=https://pims-app-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
+## Call the tekton pipeline that executes the keycloak sync. Dependent on the pims-api being accessible. Can run in parallel with the mayan sync.
+ keycloak-sync:
+ name: sync keycloak
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v4
+ - 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-dev
+ - name: call scripts to sync keycloak
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml -p ASPNETCORE_ENVIRONMENT=$ASPNETCORE_ENVIRONMENT -p NAMESPACE=3cd915-dev -p BRANCH=$DESTINATION -p API_URL=http://pims-api:8080/api | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read PIPELINE_NAME; oc wait --for=condition=succeeded pipelineruns/$PIPELINE_NAME --timeout=500s)
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
- needs: sync-keycloak
+ needs: keycloak-sync
if: ${{ always() && github.event.pull_request.merged == true }}
steps:
- name: check workflow status
diff --git a/.github/workflows/codecov-comment-pr.yml b/.github/workflows/codecov-comment-pr.yml
new file mode 100644
index 0000000000..e7b73d6545
--- /dev/null
+++ b/.github/workflows/codecov-comment-pr.yml
@@ -0,0 +1,93 @@
+name: Codecov Comment on PR
+
+# read-write repo token
+# access to secrets
+on:
+ workflow_run:
+ workflows: ["API (.NET 8)", "APP (React)"]
+ types:
+ - completed
+
+jobs:
+ upload:
+ runs-on: ubuntu-latest
+ if: >
+ github.event.workflow_run.event == 'pull_request' &&
+ github.event.workflow_run.conclusion == 'success'
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ repository: ${{ github.event.workflow_run.head_repository.full_name }}
+ ref: ${{ github.event.workflow_run.head_branch }}
+ fetch-depth: 0
+ - name: "Download artifact"
+ uses: actions/github-script@v7
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ run_id: ${{github.event.workflow_run.id }},
+ });
+ var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
+ return artifact.name == "pr-codecov"
+ })[0];
+ var download = await github.rest.actions.downloadArtifact({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ artifact_id: matchArtifact.id,
+ archive_format: 'zip',
+ });
+ var fs = require('fs');
+ fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
+ - run: unzip pr.zip
+ - name: "Comment on PR"
+ id: create-comment
+ uses: actions/github-script@v7
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ var fs = require('fs');
+ var issue_number = Number(fs.readFileSync('./NR'));
+ await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: issue_number,
+ body: 'See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/' + issue_number
+ });
+ return issue_number;
+ result-encoding: string
+ - name: Codecov(API)
+ if: ${{ github.event.workflow_run.name == 'API (.NET 8)' }}
+ uses: codecov/codecov-action@v3.1.1
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV }}
+ with:
+ # User defined upload name. Visible in Codecov UI
+ name: PIMS
+ # Path to coverage file to upload
+ file: ./coverage.opencover.xml
+ # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
+ flags: unittests
+ env_vars: C#
+ # Specify whether or not CI build should fail if Codecov runs into an error during upload
+ fail_ci_if_error: false
+ override_pr: ${{steps.create-comment.outputs.result}}
+ - name: Codecov(APP)
+ if: ${{ github.event.workflow_run.name == 'APP (React)' }}
+ uses: codecov/codecov-action@v3.1.1
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV }}
+ with:
+ # User defined upload name. Visible in Codecov UI
+ name: PIMS
+ # Path to coverage file to upload
+ file: ./coverage-final.json
+ # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
+ flags: unittests
+ # Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
+ env_vars: javascript
+ # Specify whether or not CI build should fail if Codecov runs into an error during upload
+ fail_ci_if_error: false
+ override_pr: ${{steps.create-comment.outputs.result}}
diff --git a/.github/workflows/deploy-prod-start.yml b/.github/workflows/deploy-prod-start.yml
index 98248e0e62..e72d6c11a7 100644
--- a/.github/workflows/deploy-prod-start.yml
+++ b/.github/workflows/deploy-prod-start.yml
@@ -7,7 +7,6 @@ env:
MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}
AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET_PROD }}
AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }}
- sync-directory: ./tools/keycloak/sync
ASPNETCORE_ENVIRONMENT: "prod"
APP_PORT: 8080
@@ -74,6 +73,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
+ oc tag mayan-bcgov:$RELEASE_VERSION mayan-bcgov:master
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
@@ -123,27 +123,23 @@ jobs:
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-prod -p TOKEN_URL=https://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-3cd915-prod.apps.silver.devops.gov.bc.ca/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso | 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-prod -p TOKEN_URL=https://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-3cd915-prod.apps.silver.devops.gov.bc.ca/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
- sync-keycloak:
- name: Sync Keycloak
+## Call the tekton pipeline that executes the keycloak sync. Dependent on the pims-api being accessible. Can run in parallel with the mayan sync.
+ keycloak-sync:
+ name: sync keycloak
needs: database-upgrade
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
-
- - name: Setup .NET 8
- uses: actions/setup-dotnet@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
with:
- dotnet-version: "8.0.x"
-
- - name: Install dependencies for keycloak sync
- run: dotnet restore
- working-directory: ${{env.sync-directory}}
-
- - name: Build keycloak sync
- run: dotnet build
- working-directory: ${{env.sync-directory}}
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-prod
+ - name: call scripts to sync keycloak
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml -p ASPNETCORE_ENVIRONMENT=$ASPNETCORE_ENVIRONMENT -p NAMESPACE=3cd915-prod -p BRANCH=$DESTINATION -p API_URL=http://pims-api:8080/api | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read PIPELINE_NAME; oc wait --for=condition=succeeded pipelineruns/$PIPELINE_NAME --timeout=500s)
- - name: Start keycloak sync
- run: dotnet run
- working-directory: ${{env.sync-directory}}
diff --git a/.github/workflows/retag-dev-to-test.yml b/.github/workflows/retag-dev-to-test.yml
index 2dfc2b2116..2d4769b529 100644
--- a/.github/workflows/retag-dev-to-test.yml
+++ b/.github/workflows/retag-dev-to-test.yml
@@ -63,6 +63,7 @@ jobs:
run: |
./openshift/4.0/player.sh deploy api $DESTINATION -apply
./openshift/4.0/player.sh deploy app $DESTINATION -apply
+ oc tag mayan-bcgov:dev mayan-bcgov:$DESTINATION
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
@@ -89,31 +90,6 @@ jobs:
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
- needs: database-upgrade
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Source Code
- uses: actions/checkout@v4
-
- - name: Setup .NET 8
- uses: actions/setup-dotnet@v3
- with:
- dotnet-version: "8.0.x"
-
- - name: Install dependencies for keycloak sync
- run: dotnet restore
- working-directory: ${{env.sync-directory}}
-
- - name: Build keycloak sync
- run: dotnet build
- working-directory: ${{env.sync-directory}}
-
- - name: Start keycloak sync
- run: dotnet run
- working-directory: ${{env.sync-directory}}
## 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.
mayan-sync:
@@ -137,10 +113,31 @@ jobs:
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)
+## Call the tekton pipeline that executes the keycloak sync. Dependent on the pims-api being accessible. Can run in parallel with the mayan sync.
+ keycloak-sync:
+ name: sync keycloak
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v4
+ - 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: ${{ env.NAMESPACE_OVERRIDE }}
+ - name: call scripts to sync keycloak
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml -p ASPNETCORE_ENVIRONMENT=$ASPNETCORE_ENVIRONMENT -p NAMESPACE=$NAMESPACE_OVERRIDE -p BRANCH=dev -p KEYCLOAK_SECRET_NAME=pims-api-sso-test -p KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME=pims-api-sso-test -p API_URL=http://pims-api-test:8080/api | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read PIPELINE_NAME; oc wait --for=condition=succeeded pipelineruns/$PIPELINE_NAME --timeout=600s)
+
+
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
- needs: sync-keycloak
+ needs: keycloak-sync
steps:
- name: check workflow status
uses: martialonline/workflow-status@v4
diff --git a/.github/workflows/retag-test-to-uat.yml b/.github/workflows/retag-test-to-uat.yml
index 2a45ab2665..e7119db64c 100644
--- a/.github/workflows/retag-test-to-uat.yml
+++ b/.github/workflows/retag-test-to-uat.yml
@@ -63,6 +63,7 @@ jobs:
run: |
./openshift/4.0/player.sh deploy api $DESTINATION -apply
./openshift/4.0/player.sh deploy app $DESTINATION -apply
+ oc tag mayan-bcgov:test mayan-bcgov:$DESTINATION
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
@@ -112,30 +113,25 @@ jobs:
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-test -p TOKEN_URL=https://test.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-uat-3cd915-test.apps.silver.devops.gov.bc.ca/api/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso-uat | 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-test -p TOKEN_URL=https://test.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-uat-3cd915-test.apps.silver.devops.gov.bc.ca/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso-uat | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
- sync-keycloak:
- name: Sync Keycloak
+ ## Call the tekton pipeline that executes the keycloak sync. Dependent on the pims-api being accessible. Can run in parallel with the mayan sync.
+ keycloak-sync:
+ name: sync keycloak
needs: database-upgrade
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
-
- - name: Setup .NET 8
- uses: actions/setup-dotnet@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
with:
- dotnet-version: "8.0.x"
-
- - name: Install dependencies for keycloak sync
- run: dotnet restore
- working-directory: ${{env.sync-directory}}
-
- - name: Build keycloak sync
- run: dotnet build
- working-directory: ${{env.sync-directory}}
-
- - name: Start keycloak sync
- run: dotnet run
- working-directory: ${{env.sync-directory}}
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.NAMESPACE_OVERRIDE }}
+ - name: call scripts to sync keycloak
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml -p ASPNETCORE_ENVIRONMENT=$ASPNETCORE_ENVIRONMENT -p NAMESPACE=$NAMESPACE_OVERRIDE -p BRANCH=test -p API_URL=http://pims-api-uat:8080/api -p KEYCLOAK_SECRET_NAME=pims-api-sso-uat -p KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME=pims-api-sso-uat | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read PIPELINE_NAME; oc wait --for=condition=succeeded pipelineruns/$PIPELINE_NAME --timeout=500s)
tag-release-image:
name: Release Tag
@@ -157,11 +153,12 @@ jobs:
VERSION=$(make version)
oc tag pims-app:uat pims-app:v${VERSION}-master
oc tag pims-api:uat pims-api:v${VERSION}-master
+ oc tag mayan-bcgov:uat mayan-bcgov:v${VERSION}-master
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
- needs: [sync-keycloak, mayan-sync]
+ needs: [keycloak-sync, mayan-sync]
if: always()
steps:
- name: check workflow status
diff --git a/.github/workflows/uat_hotfix.yml b/.github/workflows/uat_hotfix.yml
index 77a63a86c5..598d473fac 100644
--- a/.github/workflows/uat_hotfix.yml
+++ b/.github/workflows/uat_hotfix.yml
@@ -7,7 +7,6 @@ env:
MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}
AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET_UAT }}
AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }}
- sync-directory: ./tools/keycloak/sync
ASPNETCORE_ENVIRONMENT: "uat"
## variables for scripts under git\openshift\4.0\scripts\oc-*.sh
@@ -124,8 +123,8 @@ jobs:
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)
-## 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.
+ ## 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.
mayan-sync:
name: sync mayan
needs: database-upgrade
@@ -147,29 +146,25 @@ jobs:
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-test -p TOKEN_URL=https://test.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-uat-3cd915-test.apps.silver.devops.gov.bc.ca/api/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso-uat | 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-test -p TOKEN_URL=https://test.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-uat-3cd915-test.apps.silver.devops.gov.bc.ca/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso-uat | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
- sync-keycloak:
- name: Sync Keycloak
+ ## Call the tekton pipeline that executes the keycloak sync. Dependent on the pims-api being accessible. Can run in parallel with the mayan sync.
+ keycloak-sync:
+ name: sync keycloak
+ needs: database-upgrade
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
-
- - name: Setup .NET 8
- uses: actions/setup-dotnet@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
with:
- dotnet-version: "8.0.x"
-
- - name: Install dependencies for keycloak sync
- run: dotnet restore
- working-directory: ${{env.sync-directory}}
-
- - name: Build keycloak sync
- run: dotnet build
- working-directory: ${{env.sync-directory}}
-
- - name: Start keycloak sync
- run: dotnet run
- working-directory: ${{env.sync-directory}}
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.NAMESPACE_OVERRIDE }}
+ - name: call scripts to sync keycloak
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml -p ASPNETCORE_ENVIRONMENT=$ASPNETCORE_ENVIRONMENT -p NAMESPACE=$NAMESPACE_OVERRIDE -p BRANCH=$DESTINATION -p API_URL=http://pims-api-uat:8080/api | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read PIPELINE_NAME; oc wait --for=condition=succeeded pipelineruns/$PIPELINE_NAME --timeout=500s)
tag-release-image:
name: Release Tag
@@ -196,7 +191,7 @@ jobs:
if: always()
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
- needs: [mayan-sync, sync-keycloak]
+ needs: [mayan-sync, keycloak-sync]
steps:
- name: check workflow status
uses: martialonline/workflow-status@v4
diff --git a/.github/workflows/uat_pre_release_hotfix.yml b/.github/workflows/uat_pre_release_hotfix.yml
index 7fe71626a4..b4f270c31b 100644
--- a/.github/workflows/uat_pre_release_hotfix.yml
+++ b/.github/workflows/uat_pre_release_hotfix.yml
@@ -7,7 +7,6 @@ env:
MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}
AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET_UAT }}
AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }}
- sync-directory: ./tools/keycloak/sync
ASPNETCORE_ENVIRONMENT: "uat"
## variables for scripts under git\openshift\4.0\scripts\oc-*.sh
@@ -173,30 +172,25 @@ jobs:
oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-test -p TOKEN_URL=https://test.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-uat-3cd915-test.apps.silver.devops.gov.bc.ca/api/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso-uat | 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-test -p TOKEN_URL=https://test.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-uat-3cd915-test.apps.silver.devops.gov.bc.ca/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso-uat | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
- sync-keycloak:
- name: Sync Keycloak
+ ## Call the tekton pipeline that executes the keycloak sync. Dependent on the pims-api being accessible. Can run in parallel with the mayan sync.
+ keycloak-sync:
+ name: sync keycloak
needs: database-upgrade
runs-on: ubuntu-latest
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
-
- - name: Setup .NET 8
- uses: actions/setup-dotnet@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
with:
- dotnet-version: "8.0.x"
-
- - name: Install dependencies for keycloak sync
- run: dotnet restore
- working-directory: ${{env.sync-directory}}
-
- - name: Build keycloak sync
- run: dotnet build
- working-directory: ${{env.sync-directory}}
-
- - name: Start keycloak sync
- run: dotnet run
- working-directory: ${{env.sync-directory}}
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.NAMESPACE_OVERRIDE }}
+ - name: call scripts to sync keycloak
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml -p ASPNETCORE_ENVIRONMENT=$ASPNETCORE_ENVIRONMENT -p NAMESPACE=$NAMESPACE_OVERRIDE -p BRANCH=$DESTINATION -p API_URL=http://pims-api-uat:8080/api | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read PIPELINE_NAME; oc wait --for=condition=succeeded pipelineruns/$PIPELINE_NAME --timeout=500s)
tag-release-image:
name: Release Tag
@@ -223,7 +217,7 @@ jobs:
if: always()
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
- needs: [mayan-sync, sync-keycloak]
+ needs: [mayan-sync, keycloak-sync]
steps:
- name: check workflow status
uses: martialonline/workflow-status@v4
diff --git a/Makefile b/Makefile
index 6663367b27..4edef774a5 100644
--- a/Makefile
+++ b/Makefile
@@ -216,7 +216,7 @@ clean: ## Removes all local containers, images, volumes, etc
@docker volume rm -f psp-frontend-node-cache
@docker volume rm -f psp-api-db-data
-restart-mayan:
+restart-mayan:
@docker-compose --profile mayan up --build --force-recreate -d
mayan-up: ## Calls the docker compose up for the mayan images
@@ -272,14 +272,20 @@ db-deploy:
@echo "$(P) deployment script that facilitates releasing database changes."
@cd source/database/mssql/scripts/dbscripts; TARGET_SPRINT=$(n) ./deploy.sh
+DRY_RUN=0
db-upgrade: ## Upgrade an existing database to the TARGET_VERSION (if passed) or latest version (default), n=TARGET_VERSION (16.01).
@echo "$(P) Upgrade an existing database to the TARGET_VERSION (if passed) or latest version (default), n=TARGET_VERSION (16.01)"
- @cd source/database/mssql/scripts/dbscripts; TARGET_VERSION=$(n) ./db-upgrade.sh
+ @cd source/database/mssql/scripts/dbscripts; TARGET_SPRINT=$(n) ./upgrade.sh -n $(DRY_RUN)
db-scaffold: ## Requires local install of sqlcmd
@echo "$(P) regenerate ef core entities from database"
@cd source/backend/entities; eval $(grep -v '^#' .env | xargs) dotnet ef dbcontext scaffold Name=PIMS Microsoft.EntityFrameworkCore.SqlServer -o ../entities/ef --schema dbo --context PimsBaseContext --context-namespace Pims.Dal --context-dir . --no-onconfiguring --namespace Pims.Dal.Entities --data-annotations -v -f --startup-project ../api
+db-generate-master:
+ @echo "$(P) Generates a master script that for the given sprint."
+ @cd source/database/mssql/scripts/dbscripts; ./generate_master_sql.sh -s $(n)
+
+
keycloak-sync: ## Syncs accounts with Keycloak and PIMS
@echo "$(P) Syncing keycloak with PIMS..."
@cd tools/keycloak/sync; dotnet build; dotnet run;
diff --git a/codecov.yml b/codecov.yml
index 5096cd9c9f..42efc0197d 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -1,6 +1,8 @@
codecov:
require_ci_to_pass: yes
branch: dev
+ fixes:
+ - "/home/runner/work/PSP/PSP/::"
coverage:
precision: 2
diff --git a/docker-compose.yml b/docker-compose.yml
index 96bfcef60f..4c7ab2ccf0 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -25,6 +25,27 @@ services:
networks:
- psp
+ ## Emulates the Openshift database job image for testing purposes
+ rhel8-database:
+ profiles:
+ - debug
+ environment:
+ - TARGET_SPRINT
+ - SEED
+ restart: on-failure:1
+ container_name: psp-rhel-db
+ build:
+ context: source/database/mssql
+ dockerfile: ./scripts/dbscripts/rhel8.dockerfile
+ env_file:
+ - source/database/mssql/.env
+ ports:
+ - 6433:1433
+ volumes:
+ - api-db-rhel-data:/var/opt/data
+ networks:
+ - psp
+
####################### Backend #######################
backend:
profiles:
@@ -149,5 +170,7 @@ networks:
volumes:
api-db-data:
name: psp-api-db-data
+ api-db-rhel-data:
+ name: psp-api-db-rhel-data
frontend-node-cache:
name: psp-frontend-node-cache
diff --git a/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/DOCUMENT_IMPORT.dtsx b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/DOCUMENT_IMPORT.dtsx
new file mode 100644
index 0000000000..3d2c595749
--- /dev/null
+++ b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/DOCUMENT_IMPORT.dtsx
@@ -0,0 +1,2615 @@
+
+
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+]]>
+
+
+
+/// This is the class to which to add your code. Do not change the name, attributes, or parent
+/// of this class.
+///
+[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
+public class ScriptMain : UserComponent
+{
+ #region Help: Using Integration Services variables and parameters
+ /* To use a variable in this script, first ensure that the variable has been added to
+ * either the list contained in the ReadOnlyVariables property or the list contained in
+ * the ReadWriteVariables property of this script component, according to whether or not your
+ * code needs to write into the variable. To do so, save this script, close this instance of
+ * Visual Studio, and update the ReadOnlyVariables and ReadWriteVariables properties in the
+ * Script Transformation Editor window.
+ * To use a parameter in this script, follow the same steps. Parameters are always read-only.
+ *
+ * Example of reading from a variable or parameter:
+ * DateTime startTime = Variables.MyStartTime;
+ *
+ * Example of writing to a variable:
+ * Variables.myStringVariable = "new value";
+ */
+ #endregion
+
+ #region Help: Using Integration Services Connnection Managers
+ /* Some types of connection managers can be used in this script component. See the help topic
+ * "Working with Connection Managers Programatically" for details.
+ *
+ * To use a connection manager in this script, first ensure that the connection manager has
+ * been added to either the list of connection managers on the Connection Managers page of the
+ * script component editor. To add the connection manager, save this script, close this instance of
+ * Visual Studio, and add the Connection Manager to the list.
+ *
+ * If the component needs to hold a connection open while processing rows, override the
+ * AcquireConnections and ReleaseConnections methods.
+ *
+ * Example of using an ADO.Net connection manager to acquire a SqlConnection:
+ * object rawConnection = Connections.SalesDB.AcquireConnection(transaction);
+ * SqlConnection salesDBConn = (SqlConnection)rawConnection;
+ *
+ * Example of using a File connection manager to acquire a file path:
+ * object rawConnection = Connections.Prices_zip.AcquireConnection(transaction);
+ * string filePath = (string)rawConnection;
+ *
+ * Example of releasing a connection manager:
+ * Connections.SalesDB.ReleaseConnection(rawConnection);
+ */
+ #endregion
+
+ #region Help: Firing Integration Services Events
+ /* This script component can fire events.
+ *
+ * Example of firing an error event:
+ * ComponentMetaData.FireError(10, "Process Values", "Bad value", "", 0, out cancel);
+ *
+ * Example of firing an information event:
+ * ComponentMetaData.FireInformation(10, "Process Values", "Processing has started", "", 0, fireAgain);
+ *
+ * Example of firing a warning event:
+ * ComponentMetaData.FireWarning(10, "Process Values", "No rows were received", "", 0);
+ */
+ #endregion
+
+ ///
+ /// This method is called once, before rows begin to be processed in the data flow.
+ ///
+ /// You can remove this method if you don't need to do anything here.
+ ///
+ ///
+
+ // Create the variables that will track the running values
+ int rowNumber;
+ public override void PreExecute()
+ {
+ base.PreExecute();
+ rowNumber = 0;
+ }
+
+ ///
+ /// This method is called after all the rows have passed through this component.
+ ///
+ /// You can delete this method if you don't need to do anything here.
+ ///
+ public override void PostExecute()
+ {
+ base.PostExecute();
+ /*
+ * Add your code here
+ */
+ }
+
+ ///
+ /// This method is called once for every row that passes through the component from Input0.
+ ///
+ ///
+ /// The row that is currently passing through the component
+ public override void Input0_ProcessInputRow(Input0Buffer Row)
+ {
+ rowNumber++;
+ Row.ROWNUMBER = rowNumber;
+ }
+
+}
+]]>
+
+
+
+
+
+
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+[assembly: global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="SC_8c3041f0f56349b9b42753763ea83b38.Properties.Settings.get_Default():SC_8c3041f0f56349b9b42753763ea83b38.Properties.Sett" +
+ "ings")]
+
+namespace SC_8c3041f0f56349b9b42753763ea83b38.Properties {
+
+
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ private static Settings defaultInstance = new Settings();
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
+]]>
+
+
+
+
+
+ {30D016F9-3734-4E33-A861-5E7D899E18F3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {4738b847-d31c-470c-ac6d-510be6b40ef2}
+ Library
+ Properties
+ SC_8c3041f0f56349b9b42753763ea83b38
+ SC_8c3041f0f56349b9b42753763ea83b38
+ v4.7
+ 512
+ true
+
+
+
+ true
+ full
+ false
+ .\bin\Debug\
+ false
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ false
+ true
+ .\bin\Release\
+ false
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+
+
+
+
+
+
+
+
+
+
+
+ SSIS_SC150
+
+
+
+
+]]>
+
+
+
+
+
+ SC_8c3041f0f56349b9b42753763ea83b38
+ msBuild
+ SC_8c3041f0f56349b9b42753763ea83b38
+ {1A3D5ECF-9671-4F6F-AF67-4EA8D82D7BE2}
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
+
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+[assembly: global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="SC_8c3041f0f56349b9b42753763ea83b38.Properties.Resources.get_ResourceManager():System.Resources.Resou" +
+ "rceManager")]
+[assembly: global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="SC_8c3041f0f56349b9b42753763ea83b38.Properties.Resources.get_Culture():System.Globalization.CultureIn" +
+ "fo")]
+[assembly: global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope="member", Target="SC_8c3041f0f56349b9b42753763ea83b38.Properties.Resources.set_Culture(System.Globalization.CultureInfo" +
+ "):Void")]
+
+namespace SC_8c3041f0f56349b9b42753763ea83b38.Properties {
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if ((resourceMan == null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SC_8c3041f0f56349b9b42753763ea83b38.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
+]]>
+
+
+
+
+
+
+
+
+ SC_8c3041f0f56349b9b42753763ea83b38
+ CSharp
+
+
+
+
+
+ D8
+ Microsoft.ScriptComponentHost
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select * from [dbo].[PIMS_DOCUMENT_QUEUE]
+ select * from (select * from [dbo].[PIMS_DOCUMENT_QUEUE]) [refTable]
+where [refTable].[DOCUMENT_EXTERNAL_ID] = ?
+ 0
+ 2
+ 1
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="DOCUMENT_QUEUE_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="DOCUMENT_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="DOCUMENT_QUEUE_STATUS_TYPE_CODE" dataType="DT_WSTR" length="20" 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="DOCUMENT_EXTERNAL_ID" dataType="DT_WSTR" length="1000" precision="0" scale="0" codePage="0"/><referenceColumn name="DOC_PROCESS_START_DT" dataType="DT_DBTIMESTAMP" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="DOC_PROCESS_END_DT" dataType="DT_DBTIMESTAMP" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="DOC_PROCESS_RETRIES" dataType="DT_I4" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="MAYAN_ERROR" dataType="DT_WSTR" length="4000" precision="0" scale="0" codePage="0"/><referenceColumn name="DOCUMENT" dataType="DT_IMAGE" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="CONCURRENCY_CONTROL_NUMBER" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_CREATE_TIMESTAMP" dataType="DT_DBTIMESTAMP" 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_CREATE_USER_GUID" dataType="DT_GUID" 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_LAST_UPDATE_TIMESTAMP" dataType="DT_DBTIMESTAMP" 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="APP_LAST_UPDATE_USER_GUID" dataType="DT_GUID" 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="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"/></referenceColumns></referenceMetadata>
+ #{Package\IMPORT_DOCUMENTS\Data Conversion.Outputs[Data Conversion Output].Columns[Copy of MULTIMEDIA_OBJECT_ID]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ DOCUMENT_EXTERNAL_ID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT 'PAT' AS JOIN_ID, COUNT(*) AS PENDING_COUNT FROM PIMS_DOCUMENT_QUEUE WHERE DOCUMENT_QUEUE_STATUS_TYPE_CODE = 'PENDING'
+ select * from (SELECT 'PAT' AS JOIN_ID, COUNT(*) AS PENDING_COUNT FROM PIMS_DOCUMENT_QUEUE WHERE DOCUMENT_QUEUE_STATUS_TYPE_CODE = 'PENDING') [refTable]
+where [refTable].[JOIN_ID] = ?
+ 0
+ 0
+ 0
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="JOIN_ID" dataType="DT_STR" length="3" precision="0" scale="0" codePage="1252"/><referenceColumn name="PENDING_COUNT" dataType="DT_I4" length="0" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\IMPORT_DOCUMENTS\Add Audit Columns.Outputs[Derived Column Output].Columns[JOIN_ID]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ JOIN_ID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [dbo].[PIMS_DOCUMENT_QUEUE]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ SELECT * FROM TAP_MULTIMEDIA_OBJECT ORDER BY MULTIMEDIA_OBJECT_ID FETCH FIRST 1 ROWS ONLY
+
+ 1252
+ false
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+ [dbo].[PIMS_DOCUMENT_QUEUE]
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+]]>
+
\ No newline at end of file
diff --git a/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.dtproj b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.dtproj
new file mode 100644
index 0000000000..979d5c0e70
--- /dev/null
+++ b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.dtproj
@@ -0,0 +1,400 @@
+
+
+ Project
+ 16.0.948.0
+ 9.0.1.0
+ $base64$PFNvdXJjZUNvbnRyb2xJbmZvIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOmRkbDI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yIiB4bWxuczpkZGwyXzI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yLzIiIHhtbG5zOmRkbDEwMF8xMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDA4L2VuZ2luZS8xMDAvMTAwIiB4bWxuczpkZGwyMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAiIHhtbG5zOmRkbDIwMF8yMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAvMjAwIiB4bWxuczpkZGwzMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAiIHhtbG5zOmRkbDMwMF8zMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAvMzAwIiB4bWxuczpkZGw0MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAiIHhtbG5zOmRkbDQwMF80MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAvNDAwIiB4bWxuczpkZGw1MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAiIHhtbG5zOmRkbDUwMF81MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAvNTAwIiB4bWxuczpkd2Q9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vRGF0YVdhcmVob3VzZS9EZXNpZ25lci8xLjAiPg0KICA8RW5hYmxlZD5mYWxzZTwvRW5hYmxlZD4NCiAgPFByb2plY3ROYW1lPjwvUHJvamVjdE5hbWU+DQogIDxBdXhQYXRoPjwvQXV4UGF0aD4NCiAgPExvY2FsUGF0aD48L0xvY2FsUGF0aD4NCiAgPFByb3ZpZGVyPjwvUHJvdmlkZXI+DQo8L1NvdXJjZUNvbnRyb2xJbmZvPg==
+
+ PAT_PIMS_DOCUMENT_IMPORT.database
+ PAT_PIMS_DOCUMENT_IMPORT.database
+
+
+
+
+
+
+
+ {ecd9adfa-d0ff-45cc-817d-6973a46f874c}
+ PAT_PIMS_DOCUMENT_IMPORT
+ 0
+ 0
+ 0
+
+
+ 2024-10-11T15:31:46.2564573-07:00
+ Xerces\Devin Smith
+ XERCES
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ {AA2CE8A9-14F1-4782-B6E7-9770C3FB0AA8}
+ Package
+ 1
+ 0
+ 22
+
+
+ {CA638372-6C4F-415F-ABCB-F3DE6FB49975}
+ 8
+
+
+ 0
+
+
+
+
+ {67299CCC-1DBB-4DA3-98EF-CFCD141FE0AC}
+
+
+
+
+ 0
+ 0
+ 0
+ 0
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=lizzard.th.gov.bc.ca:20208/DEV01;User ID=desmith;Provider=OraOLEDB.Oracle.1;
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 1
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 5
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ lizzard.th.gov.bc.ca:20208/DEV01
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ desmith
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=localhost,5433;User ID=admin;Initial Catalog=pims;Provider=SQLNCLI11.1;Auto Translate=False;Application Name=SSIS-Package-{8BFC6FCC-AD79-4DE2-B828-D69AE2AC1874}localhost,5433.pims.admin;
+ 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
+
+
+
+
+ SQLServer2019
+ false
+
+
+
+
+
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-10-11T23:15:29.0687005Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.dtproj.user b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.dtproj.user
new file mode 100644
index 0000000000..c6dd6f38eb
--- /dev/null
+++ b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.dtproj.user
@@ -0,0 +1,25 @@
+
+
+
+
+ Development
+
+
+ false
+
+
+
+
+ false
+ true
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-10-11T23:15:29.0697001Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.sln b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.sln
new file mode 100644
index 0000000000..9536e75d04
--- /dev/null
+++ b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.33027.164
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{C9674DCB-5085-4A16-B785-4C70DD1589BD}") = "PAT_PIMS_DOCUMENT_IMPORT", "PAT_PIMS_DOCUMENT_IMPORT.dtproj", "{8D688065-BC77-4671-BF5F-057201FBF3F4}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Development|Default = Development|Default
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8D688065-BC77-4671-BF5F-057201FBF3F4}.Development|Default.ActiveCfg = Development
+ {8D688065-BC77-4671-BF5F-057201FBF3F4}.Development|Default.Build.0 = Development
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A0AAEAFE-BC23-413A-AC3B-8C50D579C4D3}
+ EndGlobalSection
+EndGlobal
diff --git a/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/Project.params b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/Project.params
new file mode 100644
index 0000000000..680ffe30da
--- /dev/null
+++ b/etl/PAT_PIMS_DOCUMENT_IMPORT/PAT_PIMS_DOCUMENT_IMPORT/Project.params
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/etl/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION.dtproj b/etl/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION.dtproj
index ae7573c274..090b807af4 100644
--- a/etl/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION.dtproj
+++ b/etl/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION.dtproj
@@ -29,13 +29,13 @@
1
-
+
-
+
{74037122-414C-4317-B096-F0B5505A0733}
Package
diff --git a/etl/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION/SPATIAL_CORRECTION.dtsx b/etl/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION/SPATIAL_CORRECTION.dtsx
index 7957b0057c..c93a5b442d 100644
--- a/etl/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION/SPATIAL_CORRECTION.dtsx
+++ b/etl/PIMS_PROPERTY_SPATIAL_CORRECTION/PIMS_PROPERTY_SPATIAL_CORRECTION/SPATIAL_CORRECTION.dtsx
@@ -12,8 +12,8 @@
DTS:ObjectName="Package"
DTS:PackageType="5"
DTS:ProtectionLevel="0"
- DTS:VersionBuild="57"
- DTS:VersionGUID="{D964A069-45BD-4156-8F06-443B81810E43}">
+ DTS:VersionBuild="58"
+ DTS:VersionGUID="{8F53B208-6B33-411E-A77F-7D285783938B}">
8
@@ -26,11 +26,7 @@
-
-
+ DTS:ConnectionString="Data Source=sqlprd.th.gov.bc.ca;User ID=PIMS_UAT;Initial Catalog=PIMS_UAT;Provider=SQLNCLI11.1;Auto Translate=False;Application Name=SSIS-Package-{C854C770-B13C-477E-8DD4-44721E1B9FCF}sqldevtst.th.gov.bc.ca.PIMS_DEV;" />
@@ -3307,7 +3303,7 @@ AAAAAAAAAAAAAA==]]>
+ SQLTask:SqlStatementSource="UPDATE PIMS_PROPERTY SET PIMS_PROPERTY.LOCATION = geometry::STGeomFromText( tpl.LOCATION , 3005 ), CONCURRENCY_CONTROL_NUMBER = CONCURRENCY_CONTROL_NUMBER + 1
FROM PIMS_PROPERTY p
INNER JOIN
dbo.TEMP_PROPERTY_LOCATION tpl
ON tpl.PROPERTY_ID = p.PROPERTY_ID" xmlns:SQLTask="www.microsoft.com/sqlserver/dts/tasks/sqltask" />
diff --git a/openshift/4.0/templates/jobs/db-deploy.yaml b/openshift/4.0/templates/jobs/db-deploy.yaml
index 86252df56e..c37af96a6f 100644
--- a/openshift/4.0/templates/jobs/db-deploy.yaml
+++ b/openshift/4.0/templates/jobs/db-deploy.yaml
@@ -33,8 +33,10 @@ objects:
git fetch origin ${GIT_BRANCH};
git reset --h origin/${GIT_BRANCH};
cd /usr/config/psp/source/database/mssql/scripts/dbscripts;
- chmod 777 db-upgrade.sh;
- ./db-upgrade.sh;
+ chmod 777 upgrade.sh;
+ chmod 777 db-deploy-transaction.sh;
+ chmod 777 db-deploy.sh;
+ ./upgrade.sh;
env:
- name: SERVER_NAME
value: ${SERVER_NAME}
diff --git a/openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml b/openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml
new file mode 100644
index 0000000000..68fe1685d5
--- /dev/null
+++ b/openshift/4.0/templates/jobs/keycloak-sync-pipeline-run.yaml
@@ -0,0 +1,67 @@
+kind: Template
+apiVersion: template.openshift.io/v1
+metadata:
+ name: keycloak-sync
+ annotations:
+ description: "This template creates a task to synchronize keycloak."
+ tags: "keycloak,sync,sso"
+objects:
+ - kind: PipelineRun
+ apiVersion: tekton.dev/v1beta1
+ metadata:
+ generateName: keycloak-sync-
+ namespace: ${NAMESPACE}
+ labels:
+ tekton.dev/pipeline: keycloak-sync
+ spec:
+ params:
+ - name: BRANCH
+ value: ${BRANCH}
+ - name: KEYCLOAK_CONTEXT_DIR
+ value: ${KEYCLOAK_CONTEXT_DIR}
+ - name: KEYCLOAK_SECRET_NAME
+ value: ${KEYCLOAK_SECRET_NAME}
+ - name: KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME
+ value: ${KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME}
+ #NOTE: API_URL must be an internal openshift URI to avoid interactions with the whitelist.
+ - name: API_URL
+ value: ${API_URL}
+ - name: ASPNETCORE_ENVIRONMENT
+ value: ${ASPNETCORE_ENVIRONMENT}
+ pipelineRef:
+ name: keycloak-sync
+ podTemplate:
+ #NOTE: The below user/group is defaulted by the git-clone task run prior to this - required for write/execute permissions on the cloned repo.
+ securityContext:
+ fsGroup: 65532
+ runAsUser: 65532
+ serviceAccountName: pipeline
+ timeouts:
+ pipeline: 1h0m0s
+ workspaces:
+ - name: psp
+ persistentVolumeClaim:
+ claimName: keycloak-sync
+parameters:
+ - name: BRANCH
+ description: The github branch to pull the keycloak sync source
+ required: true
+ - name: KEYCLOAK_CONTEXT_DIR
+ description: The path within the github repo where the keycloak sync source is located
+ value: tools/keycloak/sync
+ - name: KEYCLOAK_SECRET_NAME
+ description: The name of the secret in the target namespace that contains the pims-api SSO secret
+ value: pims-api-sso
+ - name: KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME
+ description: The name of the secret in the target namespace that contains the pims-api service account SSO secret
+ value: pims-api-sso
+ - name: NAMESPACE
+ description: The namespace to deploy this template
+ required: true
+ - name: API_URL
+ required: true
+ description: The route of the openshift service hosting the PSP api
+ - name: ASPNETCORE_ENVIRONMENT
+ required: true
+ description: The environment corresponding to the appsettings file that should be used
+
diff --git a/openshift/4.0/templates/jobs/keycloak-sync-pipeline.yaml b/openshift/4.0/templates/jobs/keycloak-sync-pipeline.yaml
new file mode 100644
index 0000000000..edb754d5d0
--- /dev/null
+++ b/openshift/4.0/templates/jobs/keycloak-sync-pipeline.yaml
@@ -0,0 +1,97 @@
+apiVersion: tekton.dev/v1beta1
+kind: Pipeline
+metadata:
+ name: keycloak-sync
+ namespace: 3cd915-dev
+spec:
+ params:
+ - default: dev
+ description: The git branch to use from the bcgov repo when executing
+ name: BRANCH
+ type: string
+ - default: tools/keycloak/sync
+ description: The path of the keycloak solution in the repo
+ name: KEYCLOAK_CONTEXT_DIR
+ type: string
+ - default: pims-api-sso
+ description: The name of the OC secret that contains the keycloak secret
+ name: KEYCLOAK_SECRET_NAME
+ type: string
+ - default: pims-api-sso
+ description: >-
+ The name of the OC secret that contains the keycloak service account
+ secret
+ name: KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME
+ type: string
+ - default: 'http://pims-api:8080/api'
+ description: The route of the openshift service hosting the PSP api
+ name: API_URL
+ type: string
+ - default: DEVELOPMENT
+ description: 'The target env, to load the appropriate appsettings file.'
+ name: ASPNETCORE_ENVIRONMENT
+ type: string
+ tasks:
+ - name: git-clone
+ params:
+ - name: url
+ value: 'https://github.com/bcgov/PSP'
+ - name: revision
+ value: $(params.BRANCH)
+ - name: refspec
+ value: ''
+ - name: submodules
+ value: 'true'
+ - name: depth
+ value: '1'
+ - name: sslVerify
+ value: 'true'
+ - name: crtFileName
+ value: ca-bundle.crt
+ - name: subdirectory
+ value: ''
+ - name: sparseCheckoutDirectories
+ value: '$(params.KEYCLOAK_CONTEXT_DIR)/*,source/backend/*'
+ - name: deleteExisting
+ value: 'true'
+ - name: httpProxy
+ value: ''
+ - name: httpsProxy
+ value: ''
+ - name: noProxy
+ value: ''
+ - name: verbose
+ value: 'true'
+ - name: gitInitImage
+ value: >-
+ registry.redhat.io/openshift-pipelines/pipelines-git-init-rhel8@sha256:66f219b4d54a41b945cb5715ecd1fbb5d25431cf8dad4b06914a4cdc65b298cc
+ - name: userHome
+ value: /home/git
+ taskRef:
+ kind: ClusterTask
+ name: git-clone
+ workspaces:
+ - name: output
+ workspace: psp
+ - name: keycloak-sync
+ params:
+ - name: KEYCLOAK_CONTEXT_DIR
+ value: $(params.KEYCLOAK_CONTEXT_DIR)
+ - name: KEYCLOAK_SECRET_NAME
+ value: $(params.KEYCLOAK_SECRET_NAME)
+ - name: KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME
+ value: $(params.KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME)
+ - name: ASPNETCORE_ENVIRONMENT
+ value: $(params.ASPNETCORE_ENVIRONMENT)
+ - name: API_URL
+ value: $(params.API_URL)
+ runAfter:
+ - git-clone
+ taskRef:
+ kind: Task
+ name: keycloak-sync
+ workspaces:
+ - name: psp
+ workspace: psp
+ workspaces:
+ - name: psp
diff --git a/openshift/4.0/templates/jobs/keycloak-sync-pvc.yaml b/openshift/4.0/templates/jobs/keycloak-sync-pvc.yaml
new file mode 100644
index 0000000000..3d61026818
--- /dev/null
+++ b/openshift/4.0/templates/jobs/keycloak-sync-pvc.yaml
@@ -0,0 +1,16 @@
+#This PVC is used to allow persistence between tasks in the keycloak sync pipeline.
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: keycloak-sync
+ namespace: 3cd915-dev
+ finalizers:
+ - kubernetes.io/pvc-protection
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 512Mi
+ storageClassName: netapp-file-standard
+ volumeMode: Filesystem
diff --git a/openshift/4.0/templates/jobs/keycloak-sync-task.yaml b/openshift/4.0/templates/jobs/keycloak-sync-task.yaml
new file mode 100644
index 0000000000..38c2a3c573
--- /dev/null
+++ b/openshift/4.0/templates/jobs/keycloak-sync-task.yaml
@@ -0,0 +1,52 @@
+#Note that this is a not a standalone task - it should always be run with the keycloak-sync pipeline.
+apiVersion: tekton.dev/v1beta1
+kind: Task
+metadata:
+ name: keycloak-sync
+ namespace: 3cd915-dev
+spec:
+ params:
+ - name: KEYCLOAK_CONTEXT_DIR
+ type: string
+ - name: KEYCLOAK_SECRET_NAME
+ type: string
+ - name: KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME
+ type: string
+ - name: ASPNETCORE_ENVIRONMENT
+ type: string
+ - name: API_URL
+ type: string
+ steps:
+ - env:
+ - name: Auth__Keycloak__Secret
+ valueFrom:
+ secretKeyRef:
+ key: KEYCLOAK_SECRET
+ name: $(params.KEYCLOAK_SECRET_NAME)
+ - name: Auth__Keycloak__ServiceAccount__Secret
+ valueFrom:
+ secretKeyRef:
+ key: KEYCLOAK_SERVICE_ACCOUNT_SECRET
+ name: $(params.KEYCLOAK_SERVICE_ACCOUNT_SECRET_NAME)
+ - name: Api__Uri
+ value: $(params.API_URL)
+ - name: ASPNETCORE_ENVIRONMENT
+ value: $(params.ASPNETCORE_ENVIRONMENT)
+ image: >-
+ image-registry.openshift-image-registry.svc:5000/3cd915-tools/dotnet-80:8.0
+ name: keycloak-sync
+ resources:
+ limits:
+ cpu: 750m
+ memory: 1500Mi
+ requests:
+ cpu: 200m
+ memory: 500Mi
+ script: |
+ cd $(workspaces.psp.path)/$(params.KEYCLOAK_CONTEXT_DIR)
+ dotnet restore
+ dotnet build
+ dotnet run
+ workspaces:
+ - description: 'The PSP repository, checked out by a prior task'
+ name: psp
diff --git a/openshift/4.0/templates/mayan-bcgov/build.yaml b/openshift/4.0/templates/mayan-bcgov/build.yaml
new file mode 100644
index 0000000000..a3e2e5c8d8
--- /dev/null
+++ b/openshift/4.0/templates/mayan-bcgov/build.yaml
@@ -0,0 +1,28 @@
+kind: BuildConfig
+apiVersion: build.openshift.io/v1
+metadata:
+ name: mayan-bcgov
+ namespace: 3cd915-tools
+ generation: 2
+ labels:
+ app: mayan-bcgov
+spec:
+ nodeSelector: null
+ output:
+ to:
+ kind: ImageStreamTag
+ name: "mayan-bcgov:latest-dev"
+ resources: {}
+ successfulBuildsHistoryLimit: 5
+ failedBuildsHistoryLimit: 5
+ strategy:
+ type: Docker
+ dockerStrategy:
+ dockerfilePath: docker/Dockerfile
+ postCommit: {}
+ source:
+ type: Git
+ git:
+ uri: "https://github.com/bcgov/mayan-openshift"
+ ref: dev
+ runPolicy: Serial
diff --git a/openshift/4.0/templates/mayan-bcgov/imagestream.yaml b/openshift/4.0/templates/mayan-bcgov/imagestream.yaml
new file mode 100644
index 0000000000..aad70e5780
--- /dev/null
+++ b/openshift/4.0/templates/mayan-bcgov/imagestream.yaml
@@ -0,0 +1,9 @@
+kind: ImageStream
+apiVersion: image.openshift.io/v1
+metadata:
+ name: mayan-bcgov
+ namespace: 3cd915-tools
+ generation: 1
+spec:
+ lookupPolicy:
+ local: false
diff --git a/source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs b/source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs
index 633a8d763d..c5059edb0f 100644
--- a/source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs
+++ b/source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs
@@ -7,7 +7,6 @@
using Microsoft.Extensions.Logging;
using Pims.Api.Models;
using Pims.Api.Models.Concepts.AcquisitionFile;
-using Pims.Api.Models.Concepts.CompensationRequisition;
using Pims.Api.Models.Concepts.ExpropriationPayment;
using Pims.Api.Policies;
using Pims.Api.Services;
@@ -33,7 +32,6 @@ public class AcquisitionFileController : ControllerBase
{
#region Variables
private readonly IAcquisitionFileService _acquisitionService;
- private readonly ICompReqFinancialService _compReqFinancialService;
private readonly IMapper _mapper;
private readonly ILogger _logger;
#endregion
@@ -44,14 +42,12 @@ public class AcquisitionFileController : ControllerBase
/// Creates a new instance of a AcquisitionFileController class, initializes it with the specified arguments.
///
///
- ///
///
///
///
- public AcquisitionFileController(IAcquisitionFileService acquisitionService, ICompReqFinancialService compReqFinancialService, IMapper mapper, ILogger logger)
+ public AcquisitionFileController(IAcquisitionFileService acquisitionService, IMapper mapper, ILogger logger)
{
_acquisitionService = acquisitionService;
- _compReqFinancialService = compReqFinancialService;
_mapper = mapper;
_logger = logger;
}
@@ -279,6 +275,23 @@ public IActionResult AddExpropriationPayment([FromRoute] long id, [FromBody] Exp
return new JsonResult(_mapper.Map(newExpPaymentEntity));
}
+ ///
+ /// Get the acquisition file sub-files.
+ ///
+ /// All sub-files related to the acquisition.
+ [HttpGet("{id:long}/sub-files")]
+ [HasPermission(Permissions.AcquisitionFileView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(List), 200)]
+ [SwaggerOperation(Tags = new[] { "acquisitionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetAcquisitionFileSubFiles(long id)
+ {
+ var subFiles = _acquisitionService.GetAcquisitionSubFiles(id);
+
+ return new JsonResult(_mapper.Map>(subFiles));
+ }
+
#endregion
}
}
diff --git a/source/backend/api/Areas/Contacts/Controllers/ContactController.cs b/source/backend/api/Areas/Contacts/Controllers/ContactController.cs
deleted file mode 100644
index 1b6d5a989c..0000000000
--- a/source/backend/api/Areas/Contacts/Controllers/ContactController.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using System.Collections.Generic;
-using MapsterMapper;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using Pims.Api.Policies;
-using Pims.Api.Services.Interfaces;
-using Pims.Dal.Repositories;
-using Pims.Dal.Security;
-using Swashbuckle.AspNetCore.Annotations;
-
-namespace Pims.Api.Areas.Contact.Controllers
-{
- ///
- /// ContactController class, provides endpoints for interacting with contacts.
- ///
- [Authorize]
- [ApiController]
- [ApiVersion("1.0")]
- [Area("contacts")]
- [Route("v{version:apiVersion}/[area]")]
- [Route("[area]")]
- public class ContactController : ControllerBase
- {
- #region Variables
- private readonly IContactService _contactService;
- private readonly IPersonRepository _personRepository;
- private readonly IOrganizationRepository _organizationRepository;
- private readonly IMapper _mapper;
- #endregion
-
- #region Constructors
-
- ///
- /// Creates a new instance of a ContactController class, initializes it with the specified arguments.
- ///
- ///
- ///
- ///
- ///
- ///
- public ContactController(
- IContactService contactService,
- IPersonRepository personRepository,
- IOrganizationRepository organizationRepository,
- IMapper mapper)
- {
- _contactService = contactService;
- _personRepository = personRepository;
- _organizationRepository = organizationRepository;
- _mapper = mapper;
- }
- #endregion
-
- #region Endpoints
-
- ///
- /// Get the contact for the specified primary key 'id'.
- ///
- ///
- [HttpGet("{id}")]
- [HasPermission(Permissions.ContactView)]
- [Produces("application/json")]
- [ProducesResponseType(typeof(IEnumerable), 200)]
- [SwaggerOperation(Tags = new[] { "contact" })]
- public IActionResult GetContact(string id)
- {
- var contactView = _contactService.GetById(id);
-
- if (id.StartsWith("P"))
- {
- var person = _personRepository.GetById(contactView.PersonId.Value);
- var mappedPerson = _mapper.Map(person);
- mappedPerson.Id = contactView.Id;
- return new JsonResult(mappedPerson);
- }
- else
- {
- var organization = _organizationRepository.GetById(contactView.OrganizationId.Value);
- var mappedOrganization = _mapper.Map(organization);
- mappedOrganization.Id = contactView.Id;
- return new JsonResult(mappedOrganization);
- }
- }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Controllers/SearchController.cs b/source/backend/api/Areas/Contacts/Controllers/SearchController.cs
index d4a46f23f6..4ece351922 100644
--- a/source/backend/api/Areas/Contacts/Controllers/SearchController.cs
+++ b/source/backend/api/Areas/Contacts/Controllers/SearchController.cs
@@ -8,6 +8,7 @@
using Pims.Api.Helpers.Exceptions;
using Pims.Api.Helpers.Extensions;
using Pims.Api.Models.Base;
+using Pims.Api.Models.Concepts.Contact;
using Pims.Api.Policies;
using Pims.Api.Services.Interfaces;
using Pims.Dal.Entities.Models;
diff --git a/source/backend/api/Areas/Contacts/Mapping/Contact/AddressMap.cs b/source/backend/api/Areas/Contacts/Mapping/Contact/AddressMap.cs
deleted file mode 100644
index 4486c715aa..0000000000
--- a/source/backend/api/Areas/Contacts/Mapping/Contact/AddressMap.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Contact.Models.Contact;
-
-namespace Pims.Api.Areas.Contact.Mapping.Contact
-{
- public class AddressMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.AddressId)
- .Map(dest => dest.RowVersion, src => src.ConcurrencyControlNumber)
- .Map(dest => dest.StreetAddress1, src => src.Address.StreetAddress1)
- .Map(dest => dest.StreetAddress2, src => src.Address.StreetAddress2)
- .Map(dest => dest.StreetAddress3, src => src.Address.StreetAddress3)
- .Map(dest => dest.Municipality, src => src.Address.MunicipalityName)
- .Map(dest => dest.Province, src => src.Address.ProvinceState)
- .Map(dest => dest.Country, src => src.Address.Country)
- .Map(dest => dest.CountryOther, src => src.Address.OtherCountry)
- .Map(dest => dest.Postal, src => src.Address.PostalCode)
- .Map(dest => dest.AddressType, src => src.AddressUsageTypeCodeNavigation);
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.AddressId)
- .Map(dest => dest.RowVersion, src => src.ConcurrencyControlNumber)
- .Map(dest => dest.StreetAddress1, src => src.Address.StreetAddress1)
- .Map(dest => dest.StreetAddress2, src => src.Address.StreetAddress2)
- .Map(dest => dest.StreetAddress3, src => src.Address.StreetAddress3)
- .Map(dest => dest.Municipality, src => src.Address.MunicipalityName)
- .Map(dest => dest.Province, src => src.Address.ProvinceState)
- .Map(dest => dest.Country, src => src.Address.Country)
- .Map(dest => dest.CountryOther, src => src.Address.OtherCountry)
- .Map(dest => dest.Postal, src => src.Address.PostalCode)
- .Map(dest => dest.AddressType, src => src.AddressUsageTypeCodeNavigation);
- }
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Mapping/Contact/ContactMap.cs b/source/backend/api/Areas/Contacts/Mapping/Contact/ContactMap.cs
deleted file mode 100644
index faf3a85c54..0000000000
--- a/source/backend/api/Areas/Contacts/Mapping/Contact/ContactMap.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Contact.Models.Contact;
-
-namespace Pims.Api.Areas.Contact.Mapping.Contact
-{
- public class ContactMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.PersonId)
- .Map(dest => dest.Person, src => src);
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.OrganizationId)
- .Map(dest => dest.Organization, src => src);
- }
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Mapping/Contact/ContactMethodMap.cs b/source/backend/api/Areas/Contacts/Mapping/Contact/ContactMethodMap.cs
deleted file mode 100644
index aea8eb5b46..0000000000
--- a/source/backend/api/Areas/Contacts/Mapping/Contact/ContactMethodMap.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Contact.Models.Contact;
-
-namespace Pims.Api.Areas.Contact.Mapping.Contact
-{
- public class ContactMethodMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.ContactMethodId)
- .Map(dest => dest.ContactMethodType, src => src.ContactMethodTypeCodeNavigation)
- .Map(dest => dest.Value, src => src.ContactMethodValue)
- .Map(dest => dest.RowVersion, src => src.ConcurrencyControlNumber);
- }
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Mapping/Contact/CountryMap.cs b/source/backend/api/Areas/Contacts/Mapping/Contact/CountryMap.cs
deleted file mode 100644
index cf5786a239..0000000000
--- a/source/backend/api/Areas/Contacts/Mapping/Contact/CountryMap.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Contact.Models.Contact;
-
-namespace Pims.Api.Areas.Contact.Mapping.Contact
-{
- public class CountryMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.CountryId, src => src.CountryId)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.CountryCode, src => src.CountryCode);
- }
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Mapping/Contact/OrganizationMap.cs b/source/backend/api/Areas/Contacts/Mapping/Contact/OrganizationMap.cs
deleted file mode 100644
index 1ba8c0d930..0000000000
--- a/source/backend/api/Areas/Contacts/Mapping/Contact/OrganizationMap.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Contact.Models.Contact;
-
-namespace Pims.Api.Areas.Contact.Mapping.Contact
-{
- public class OrganizationMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Internal_Id)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Alias, src => src.OrganizationAlias)
- .Map(dest => dest.IncorporationNumber, src => src.IncorporationNumber)
- .Map(dest => dest.Addresses, src => src.PimsOrganizationAddresses)
- .Map(dest => dest.ContactMethods, src => src.PimsContactMethods)
- .Map(dest => dest.Persons, src => src.GetPersons())
- .Map(dest => dest.Comment, src => src.Comment);
- }
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Mapping/Contact/PersonMap.cs b/source/backend/api/Areas/Contacts/Mapping/Contact/PersonMap.cs
deleted file mode 100644
index e28d81db8e..0000000000
--- a/source/backend/api/Areas/Contacts/Mapping/Contact/PersonMap.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Mapster;
-using Pims.Dal.Helpers.Extensions;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Contact.Models.Contact;
-
-namespace Pims.Api.Areas.Contact.Mapping.Contact
-{
- public class PersonMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.PersonId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Map(dest => dest.FullName, src => src.GetFullName(false))
- .Map(dest => dest.PreferredName, src => src.PreferredName)
- .Map(dest => dest.Addresses, src => src.PimsPersonAddresses)
- .Map(dest => dest.ContactMethods, src => src.PimsContactMethods)
- .Map(dest => dest.UseOrganizationAddress, src => src.UseOrganizationAddress)
- .Map(dest => dest.Organizations, src => src.GetOrganizations())
- .Map(dest => dest.Comment, src => src.Comment);
- }
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Mapping/Contact/ProvinceStateMap.cs b/source/backend/api/Areas/Contacts/Mapping/Contact/ProvinceStateMap.cs
deleted file mode 100644
index 3756a1f1bf..0000000000
--- a/source/backend/api/Areas/Contacts/Mapping/Contact/ProvinceStateMap.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Contact.Models.Contact;
-
-namespace Pims.Api.Areas.Contact.Mapping.Contact
-{
- public class ProvinceStateMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.ProvinceStateId, src => src.ProvinceStateId)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.ProvinceStateCode, src => src.ProvinceStateCode);
- }
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/AddressModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/AddressModel.cs
deleted file mode 100644
index c28cfa8853..0000000000
--- a/source/backend/api/Areas/Contacts/Models/Contact/AddressModel.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Contact.Models.Contact
-{
- ///
- /// Provides a contact-oriented address model.
- ///
- public class AddressModel
- {
- #region Properties
-
- ///
- /// get/set - The primary key to identify the address.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The concurrency row version.
- ///
- public long RowVersion { get; set; }
-
- ///
- /// get/set - The address type.
- ///
- public CodeTypeModel AddressType { get; set; }
-
- ///
- /// get/set - The street address.
- ///
- public string StreetAddress1 { get; set; }
-
- ///
- /// get/set - The street address.
- ///
- public string StreetAddress2 { get; set; }
-
- ///
- /// get/set - The street address.
- ///
- public string StreetAddress3 { get; set; }
-
- ///
- /// get/set - The name of the municipality name.
- ///
- public string Municipality { get; set; }
-
- ///
- /// get/set - The address's province.
- ///
- public ProvinceStateModel Province { get; set; }
-
- ///
- /// get/set - The address's country.
- ///
- public CountryModel Country { get; set; }
-
- ///
- /// get/set - The free-form value of country when country code is "Other".
- ///
- public string CountryOther { get; set; }
-
- ///
- /// get/set - The postal code.
- ///
- public string Postal { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/ContactMethodModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/ContactMethodModel.cs
deleted file mode 100644
index 27fb8e4e61..0000000000
--- a/source/backend/api/Areas/Contacts/Models/Contact/ContactMethodModel.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Contact.Models.Contact
-{
- ///
- /// Provides a contact-oriented contact method model.
- ///
- public class ContactMethodModel
- {
- #region Properties
-
- ///
- /// get/set - The primary key to identify the contact method.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The concurrency row version.
- ///
- public long RowVersion { get; set; }
-
- ///
- /// get/set - The contact method type.
- ///
- public CodeTypeModel ContactMethodType { get; set; }
-
- ///
- /// get/set - The contact method value.
- ///
- public string Value { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/ContactModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/ContactModel.cs
deleted file mode 100644
index 7d13008abd..0000000000
--- a/source/backend/api/Areas/Contacts/Models/Contact/ContactModel.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace Pims.Api.Areas.Contact.Models.Contact
-{
- public class ContactModel
- {
- #region Properties
-
- ///
- /// get/set - The primary key to identify the organization or person.
- ///
- public string Id { get; set; }
-
- ///
- /// get/set - Detailed information if the contact is a person. Null if the contact is an organization.
- ///
- public PersonModel Person { get; set; }
-
- ///
- /// get/set - Detailed information if the contact is an organization. Null if the contact is a person.
- ///
- public OrganizationModel Organization { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/CountryModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/CountryModel.cs
deleted file mode 100644
index 46a0c2ef74..0000000000
--- a/source/backend/api/Areas/Contacts/Models/Contact/CountryModel.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace Pims.Api.Areas.Contact.Models.Contact
-{
- public class CountryModel
- {
- public short CountryId { get; set; }
-
- public string CountryCode { get; set; }
-
- public string Description { get; set; }
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/OrganizationModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/OrganizationModel.cs
deleted file mode 100644
index aec502b692..0000000000
--- a/source/backend/api/Areas/Contacts/Models/Contact/OrganizationModel.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System.Collections.Generic;
-
-namespace Pims.Api.Areas.Contact.Models.Contact
-{
- ///
- /// Provides a contact-oriented organization model.
- ///
- public class OrganizationModel
- {
- #region Properties
-
- ///
- /// get/set - The organization's id.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The organization's disabled status flag.
- ///
- public bool IsDisabled { get; set; }
-
- ///
- /// get/set - The organization's name.
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - The organization's alias name.
- ///
- public string Alias { get; set; }
-
- ///
- /// get/set - The organization's incorporation number.
- ///
- public string IncorporationNumber { get; set; }
-
- ///
- /// get/set - The organization's persons.
- ///
- public IList Persons { get; set; }
-
- ///
- /// get/set - The organization's addresses.
- ///
- public IList Addresses { get; set; }
-
- ///
- /// get/set - The organization's contact methods.
- ///
- public IList ContactMethods { get; set; }
-
- ///
- /// get/set - The organization's Comment.
- ///
- public string Comment { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/PersonModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/PersonModel.cs
deleted file mode 100644
index a447085c7a..0000000000
--- a/source/backend/api/Areas/Contacts/Models/Contact/PersonModel.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Collections.Generic;
-
-namespace Pims.Api.Areas.Contact.Models.Contact
-{
- public class PersonModel
- {
- #region Properties
-
- ///
- /// get/set - The person's id.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The person's disabled status flag.
- ///
- public bool IsDisabled { get; set; }
-
- ///
- /// get/set - The person's concatenated full name.
- ///
- public string FullName { get; set; }
-
- ///
- /// get/set - The person's preferred name.
- ///
- public string PreferredName { get; set; }
-
- ///
- /// get/set - The person's organizations.
- ///
- public IList Organizations { get; set; }
-
- ///
- /// get/set - Flag to note to use the organization address.
- ///
- public bool? UseOrganizationAddress { get; set; }
-
- ///
- /// get/set - The person's addresses.
- ///
- public IList Addresses { get; set; }
-
- ///
- /// get/set - The person's contact methods.
- ///
- public IList ContactMethods { get; set; }
-
- ///
- /// get/set - The person's Comment.
- ///
- public string Comment { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/ProvinceStateModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/ProvinceStateModel.cs
deleted file mode 100644
index 1053992bd2..0000000000
--- a/source/backend/api/Areas/Contacts/Models/Contact/ProvinceStateModel.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace Pims.Api.Areas.Contact.Models.Contact
-{
- public class ProvinceStateModel
- {
- public short ProvinceStateId { get; set; }
-
- public string ProvinceStateCode { get; set; }
-
- public string Description { get; set; }
- }
-}
diff --git a/source/backend/api/Areas/Documents/DocumentController.cs b/source/backend/api/Areas/Documents/DocumentController.cs
index 538b7f7c86..81a6064546 100644
--- a/source/backend/api/Areas/Documents/DocumentController.cs
+++ b/source/backend/api/Areas/Documents/DocumentController.cs
@@ -68,20 +68,18 @@ public IActionResult GetDocumentTypes()
}
///
- /// Updates document metadata and status.
+ /// Updates document's type, status and metadata.
///
/// Used to identify document.
/// Contains information about the document metadata.
///
- [HttpPut("{documentId}/metadata")]
+ [HttpPut("{documentId}")]
[Produces("application/json")]
[HasPermission(Permissions.DocumentEdit)]
[ProducesResponseType(typeof(DocumentUpdateResponse), 200)]
[SwaggerOperation(Tags = new[] { "documents" })]
[TypeFilter(typeof(NullJsonResultFilter))]
- public async Task UpdateDocumentMetadata(
- long documentId,
- [FromBody] DocumentUpdateRequest updateRequest)
+ public async Task UpdateDocument(long documentId, [FromBody] DocumentUpdateRequest updateRequest)
{
if (documentId != updateRequest.DocumentId)
{
diff --git a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestMap.cs b/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestMap.cs
deleted file mode 100644
index 69fc3f6940..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestMap.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Mapster;
-using Pims.Api.Models.Base;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.AccessRequest;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.AccessRequest
-{
- public class AccessRequestMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.AccessRequestId)
- .Map(dest => dest.User, src => src.User)
- .Map(dest => dest.Status, src => src.AccessRequestStatusTypeCode)
- .Map(dest => dest.Role, src => src.Role)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.AccessRequestId, src => src.Id)
- .Map(dest => dest.AccessRequestStatusTypeCode, src => src.Status)
- .Map(dest => dest.UserId, src => src.User.Id)
- .Map(dest => dest.RoleId, src => src.Role.Id)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestOrganizationMap.cs b/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestOrganizationMap.cs
deleted file mode 100644
index 215632d77a..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestOrganizationMap.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Mapster;
-using Pims.Api.Models.Base;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.AccessRequest;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.AccessRequest
-{
- public class AccessRequestOrganizationMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.OrganizationId)
- .Map(dest => dest.Name, src => src.Organization == null ? null : src.Organization.OrganizationName)
- .Inherits, BaseAuditModel>();
-
- config.NewConfig()
- .Map(dest => dest.OrganizationId, src => src.Id)
- .Inherits>();
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestRoleMap.cs b/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestRoleMap.cs
deleted file mode 100644
index c1a841bde9..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestRoleMap.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using Mapster;
-using Pims.Api.Models.Base;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.AccessRequest;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.AccessRequest
-{
- public class AccessRequestRoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.RoleId)
- .Map(dest => dest.Name, src => src.Name)
- .Inherits();
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestUserMap.cs b/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestUserMap.cs
deleted file mode 100644
index b5fd8c1e6c..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestUserMap.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Mapster;
-using Pims.Api.Models.Base;
-using Pims.Dal.Helpers.Extensions;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.AccessRequest;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.AccessRequest
-{
- public class AccessRequestUserMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Internal_Id)
- .Map(dest => dest.FirstName, src => src.Person.FirstName)
- .Map(dest => dest.Surname, src => src.Person.Surname)
- .Map(dest => dest.Email, src => src.Person.GetWorkEmail())
- .Map(dest => dest.UserTypeCode, src => src.UserTypeCode)
- .Inherits, BaseAuditModel>();
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs b/source/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs
deleted file mode 100644
index ac3e56501b..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using Mapster;
-using Pims.Api.Models.Base;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.Role;
-
-namespace Pims.Api.Areas.Admin.Keycloak.Role
-{
- public class RoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.RoleId)
- .Map(dest => dest.Key, src => src.RoleUid)
- .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.RoleId, src => src.Id)
- .Map(dest => dest.RoleUid, src => src.Key)
- .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits();
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs b/source/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs
deleted file mode 100644
index 4bbaacce22..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Mapster;
-using Pims.Api.Models.Base;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.Role;
-
-namespace Pims.Api.Areas.Admin.Keycloak.Role
-{
- public class UpdateRoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.RowVersion, src => src.ConcurrencyControlNumber);
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/User/OrganizationMap.cs b/source/backend/api/Areas/Keycloak/Mapping/User/OrganizationMap.cs
deleted file mode 100644
index 384b1e0edb..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/User/OrganizationMap.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using Mapster;
-using Pims.Api.Models.Base;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class OrganizationMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Internal_Id)
- .Map(dest => dest.Name, src => src.OrganizationName)
- .Map(dest => dest.ParentId, src => src.PrntOrganizationId)
- .Inherits();
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Internal_Id, src => src.Id)
- .Map(dest => dest.OrganizationName, src => src.Name)
- .Map(dest => dest.PrntOrganizationId, src => src.ParentId)
- .Inherits();
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.OrganizationId)
- .Map(dest => dest.ParentId, src => src.Organization.PrntOrganizationId)
- .Inherits();
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.OrganizationId, src => src.Id)
- .Inherits();
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs b/source/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs
deleted file mode 100644
index e116b1dbae..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Mapster;
-using Pims.Api.Models.Base;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class RoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.RoleId)
- .Map(dest => dest.Name, src => src.Name)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.RoleId, src => src.Id)
- .Map(dest => dest.Name, src => src.Name)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.UserId);
-
- config.NewConfig()
- .Map(dest => dest.UserId, src => src.Id);
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs b/source/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs
deleted file mode 100644
index 149f7b486f..0000000000
--- a/source/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using System.Linq;
-using Mapster;
-using Pims.Api.Models.Base;
-using Pims.Dal.Helpers.Extensions;
-using Entity = Pims.Dal.Entities;
-using KModel = Pims.Keycloak.Models;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class UserMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Internal_Id)
- .Map(dest => dest.KeycloakUserId, src => src.GuidIdentifierValue)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Map(dest => dest.BusinessIdentifier, src => src.BusinessIdentifierValue)
- .Map(dest => dest.FirstName, src => src.Person.FirstName)
- .Map(dest => dest.MiddleNames, src => src.Person.MiddleNames)
- .Map(dest => dest.Surname, src => src.Person.Surname)
- .Map(dest => dest.Email, src => src.Person.GetWorkEmail())
- .Map(dest => dest.Organizations, src => src.PimsUserOrganizations.OrderBy(o => o.Organization != null ? o.Organization.PrntOrganizationId : null))
- .Map(dest => dest.Roles, src => src.PimsUserRoles)
- .Inherits, BaseAuditModel>();
-
- config.NewConfig()
- .Map(dest => dest.Internal_Id, src => src.Id)
- .Map(dest => dest.GuidIdentifierValue, src => src.KeycloakUserId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Map(dest => dest.BusinessIdentifierValue, src => src.BusinessIdentifier)
- .Map(dest => dest.Person.FirstName, src => src.FirstName)
- .Map(dest => dest.Person.MiddleNames, src => src.MiddleNames)
- .Map(dest => dest.Person.Surname, src => src.Surname)
- .Map(dest => dest.PimsUserOrganizations, src => src.Organizations)
- .Map(dest => dest.PimsUserRoles, src => src.Roles)
- .Inherits>();
-
- config.NewConfig()
- .Map(dest => dest.Username, src => src.BusinessIdentifierValue)
- .Map(dest => dest.FirstName, src => src.Person.FirstName)
- .Map(dest => dest.LastName, src => src.Person.Surname)
- .Map(dest => dest.Email, src => src.Person.GetWorkEmail());
- }
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/AccessRequest/AccessRequestModel.cs b/source/backend/api/Areas/Keycloak/Models/AccessRequest/AccessRequestModel.cs
deleted file mode 100644
index 7470182fbe..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/AccessRequest/AccessRequestModel.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.AccessRequest
-{
- public class AccessRequestModel : BaseAuditModel
- {
- #region Properties
- public long Id { get; set; }
-
- public string Status { get; set; }
-
- public string Note { get; set; }
-
- public UserModel User { get; set; }
-
- public RoleModel Role { get; set; }
-
- public OrganizationModel Organization { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/AccessRequest/OrganizationModel.cs b/source/backend/api/Areas/Keycloak/Models/AccessRequest/OrganizationModel.cs
deleted file mode 100644
index 2cbabb47f8..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/AccessRequest/OrganizationModel.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.AccessRequest
-{
- ///
- /// OrganizationModel class, provides a model that represents a role attached to an access request.
- ///
- public class OrganizationModel : BaseAuditModel
- {
- #region Properties
-
- ///
- /// get/set - Primary key to identify organization.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The name of the code.
- ///
- public string Name { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/AccessRequest/RoleModel.cs b/source/backend/api/Areas/Keycloak/Models/AccessRequest/RoleModel.cs
deleted file mode 100644
index 2c33bade0a..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/AccessRequest/RoleModel.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.AccessRequest
-{
- ///
- /// RoleModel class, provides a model that represents a role attached to an access request.
- ///
- public class RoleModel : BaseAuditModel
- {
- #region Properties
-
- ///
- /// get/set - Primary key to identify record.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The item's name.
- ///
- public string Name { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/AccessRequest/UserModel.cs b/source/backend/api/Areas/Keycloak/Models/AccessRequest/UserModel.cs
deleted file mode 100644
index a44a087c08..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/AccessRequest/UserModel.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.AccessRequest
-{
- ///
- /// UserModel class, provides a model that represents a user attached to an access request.
- ///
- public class UserModel : BaseAuditModel
- {
- #region Properties
-
- ///
- /// get/set - The primary key IDENTITY.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - Unique key to identify the claim.
- ///
- public Guid KeycloakUserId { get; set; }
-
- ///
- /// get/set - The user's given name.
- ///
- public string FirstName { get; set; }
-
- ///
- /// get/set - The user's surname.
- ///
- public string Surname { get; set; }
-
- ///
- /// get/set - The user's Type.
- ///
- public string UserTypeCode { get; set; }
-
- ///
- /// get/set - The user's email.
- ///
- public string Email { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/Role/RoleModel.cs b/source/backend/api/Areas/Keycloak/Models/Role/RoleModel.cs
deleted file mode 100644
index fc69789eed..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/Role/RoleModel.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.Role
-{
- ///
- /// RoleModel class, provides a model that represents a role.
- ///
- public class RoleModel : BaseConcurrentModel
- {
- #region Properties
-
- ///
- /// get/set - Primary key to identify the role model.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The GUID that identifies this Group in Keycloak.
- ///
- public Guid Key { get; set; }
-
- ///
- /// get/set - The GUID that identifies this Group in Keycloak.
- ///
- public Guid? KeycloakGroupId { get; set; }
-
- ///
- /// get/set - The item's name.
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - The role description.
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - Whether the role is public.
- /// One which users can request to join.
- ///
- public bool IsPublic { get; set; }
-
- ///
- /// get/set - Whether the item is disabled.
- ///
- public bool IsDisabled { get; set; }
-
- ///
- /// get/set - Whether this item is visible.
- ///
- public bool? IsVisible { get; set; }
-
- ///
- /// get/set - The item's sort order.
- ///
- public int DisplayOrder { get; set; }
-
- ///
- /// get/set - The item's type.
- ///
- public string Type { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/Role/Update/RoleModel.cs b/source/backend/api/Areas/Keycloak/Models/Role/Update/RoleModel.cs
deleted file mode 100644
index b872753ec7..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/Role/Update/RoleModel.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.Role.Update
-{
- ///
- /// RoleModel class, provides a model that represents a role.
- ///
- public class RoleModel : BaseAuditModel
- {
- #region Properties
-
- ///
- /// get/set - A unique name to identify the role.
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - The role description.
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - Whether the role is public.
- /// One which users can request to join.
- ///
- public bool IsPublic { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/User/OrganizationModel.cs b/source/backend/api/Areas/Keycloak/Models/User/OrganizationModel.cs
deleted file mode 100644
index 2a187e1167..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/User/OrganizationModel.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.User
-{
- ///
- /// OrganizationModel class, provides a model to represent the organization.
- ///
- public class OrganizationModel : BaseAuditModel
- {
- #region Properties
-
- ///
- /// get/set - Primary key to identify organization.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The organization name.
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - Foreign key to the parent organization.
- ///
- public long? ParentId { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/User/RoleModel.cs b/source/backend/api/Areas/Keycloak/Models/User/RoleModel.cs
deleted file mode 100644
index db475ecb58..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/User/RoleModel.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.User
-{
- ///
- /// RoleModel class, provides a model that represents a role.
- ///
- public class RoleModel : BaseConcurrentModel
- {
- #region Properties
-
- ///
- /// get/set - Primary key to identify the role.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The role description.
- ///
- public string Name { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/User/Update/BaseModel.cs b/source/backend/api/Areas/Keycloak/Models/User/Update/BaseModel.cs
deleted file mode 100644
index 3c83b65311..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/User/Update/BaseModel.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Pims.Api.Areas.Keycloak.Models.User.Update
-{
- ///
- /// BaseModel class, provides a model that represents the base properties of an update model.
- ///
- public abstract class BaseModel
- {
- #region Properties
-
- ///
- /// get/set - The rowversion of the item.
- ///
- public long RowVersion { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/User/Update/RoleModel.cs b/source/backend/api/Areas/Keycloak/Models/User/Update/RoleModel.cs
deleted file mode 100644
index 302169c0c9..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/User/Update/RoleModel.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.User.Update
-{
- ///
- /// RoleModel class, provides a model that represents a role.
- ///
- public class RoleModel : BaseAuditModel
- {
- #region Properties
-
- ///
- /// get/set - A unique name to identify the role.
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - The role description.
- ///
- public string Description { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/User/Update/UserOrganizationModel.cs b/source/backend/api/Areas/Keycloak/Models/User/Update/UserOrganizationModel.cs
deleted file mode 100644
index 26207bbda6..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/User/Update/UserOrganizationModel.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace Pims.Api.Areas.Keycloak.Models.User.Update
-{
- ///
- /// UserOrganizationModel class, provides a model to represent a user organization.
- ///
- public class UserOrganizationModel
- {
- #region Properties
-
- ///
- /// get/set - The unique identify for the organization.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The unique name to identify the organization.
- ///
- public string Name { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/User/Update/UserRoleModel.cs b/source/backend/api/Areas/Keycloak/Models/User/Update/UserRoleModel.cs
deleted file mode 100644
index ecd77eb52e..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/User/Update/UserRoleModel.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Keycloak.Models.User.Update
-{
- ///
- /// UserRoleModel class, provides a model that represents a user role model.
- ///
- public class UserRoleModel
- {
- #region Properties
-
- ///
- /// get/set - The primary key IDENTITY.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - Unique key to identify the claim.
- ///
- public Guid Key { get; set; }
-
- ///
- /// get/set - A unique name that identifies the user role.
- ///
- public string Name { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Keycloak/Models/User/UserModel.cs b/source/backend/api/Areas/Keycloak/Models/User/UserModel.cs
deleted file mode 100644
index 8e1b10881a..0000000000
--- a/source/backend/api/Areas/Keycloak/Models/User/UserModel.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Pims.Api.Models.Base;
-
-namespace Pims.Api.Areas.Keycloak.Models.User
-{
- ///
- /// UserModel class, provides a model to represent a user.
- ///
- public class UserModel : BaseAuditModel
- {
- #region Properties
-
- ///
- /// get/set - The primary key.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - Unique key to identify the user within keycloak.
- ///
- public Guid KeycloakUserId { get; set; }
-
- ///
- /// get/set - A unique username to identify the user.
- ///
- public string BusinessIdentifier { get; set; }
-
- ///
- /// get/set - The user's given name.
- ///
- public string FirstName { get; set; }
-
- ///
- /// get/set - The user's middle names.
- ///
- public string MiddleNames { get; set; }
-
- ///
- /// get/set - The user's last name.
- ///
- public string Surname { get; set; }
-
- ///
- /// get/set - The user's email.
- ///
- public string Email { get; set; }
-
- ///
- /// get/set - Whether the user is disabled.
- ///
- public bool IsDisabled { get; set; }
-
- ///
- /// get/set - An array of organizations the user belongs to.
- ///
- public IEnumerable Organizations { get; set; } = new List();
-
- ///
- /// get/set - An array of roles the user is a member of.
- ///
- public IEnumerable Roles { get; set; } = new List();
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Organizations/Controllers/OrganizationController.cs b/source/backend/api/Areas/Organizations/Controllers/OrganizationController.cs
index 8fa008249d..096eb9807d 100644
--- a/source/backend/api/Areas/Organizations/Controllers/OrganizationController.cs
+++ b/source/backend/api/Areas/Organizations/Controllers/OrganizationController.cs
@@ -87,7 +87,7 @@ public IActionResult GetOrganizationConcept(int id)
[HttpPost]
[HasPermission(Permissions.ContactAdd)]
[Produces("application/json")]
- [ProducesResponseType(typeof(Areas.Contact.Models.Contact.ContactModel), 201)]
+ [ProducesResponseType(typeof(OrganizationModel), 201)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "organization" })]
public IActionResult AddOrganization([FromBody] OrganizationModel model, bool userOverride = false)
@@ -109,7 +109,7 @@ public IActionResult AddOrganization([FromBody] OrganizationModel model, bool us
try
{
var createdOrganization = _organizationService.AddOrganization(entity, userOverride);
- var response = _mapper.Map(createdOrganization);
+ var response = _mapper.Map(createdOrganization);
return new JsonResult(response);
}
diff --git a/source/backend/api/Areas/Persons/Controllers/PersonController.cs b/source/backend/api/Areas/Persons/Controllers/PersonController.cs
index 3e853a41b9..22a7c8ba73 100644
--- a/source/backend/api/Areas/Persons/Controllers/PersonController.cs
+++ b/source/backend/api/Areas/Persons/Controllers/PersonController.cs
@@ -87,7 +87,7 @@ public IActionResult GetPersonConcept(int id)
[HttpPost]
[HasPermission(Permissions.ContactAdd)]
[Produces("application/json")]
- [ProducesResponseType(typeof(Areas.Contact.Models.Contact.ContactModel), 201)]
+ [ProducesResponseType(typeof(PersonModel), 201)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "person" })]
public IActionResult AddPerson([FromBody] PersonModel model, bool userOverride = false)
@@ -110,7 +110,7 @@ public IActionResult AddPerson([FromBody] PersonModel model, bool userOverride =
try
{
var created = _personService.AddPerson(entity, userOverride);
- var response = _mapper.Map(created);
+ var response = _mapper.Map(created);
return new JsonResult(response);
}
diff --git a/source/backend/api/Areas/Reports/Controllers/AcquisitionController.cs b/source/backend/api/Areas/Reports/Controllers/AcquisitionController.cs
index d8013c80c6..c0debd780b 100644
--- a/source/backend/api/Areas/Reports/Controllers/AcquisitionController.cs
+++ b/source/backend/api/Areas/Reports/Controllers/AcquisitionController.cs
@@ -126,7 +126,8 @@ public IActionResult ExportCompensationRequisitions([FromBody] AcquisitionReport
var reportFinancials = financials.Select(financial => new CompensationFinancialReportModel(financial, totals, _user))
.OrderByDescending(f => f.MinistryProject)
.ThenByDescending(f => f.Product)
- .ThenByDescending(f => f.AcquisitionNumberAndName)
+ .ThenBy(f => f.FileType)
+ .ThenByDescending(f => f.FileNumberAndName)
.ThenByDescending(f => f.RequisitionNumber)
.ThenByDescending(f => f.FinancialActivityName);
diff --git a/source/backend/api/Areas/Reports/Controllers/LeaseController.cs b/source/backend/api/Areas/Reports/Controllers/LeaseController.cs
index df50d2b26d..61f0bf4908 100644
--- a/source/backend/api/Areas/Reports/Controllers/LeaseController.cs
+++ b/source/backend/api/Areas/Reports/Controllers/LeaseController.cs
@@ -172,7 +172,7 @@ public IActionResult ExportAggregatedLeases(int fiscalYearStart)
[HasPermission(Permissions.PropertyView)]
[Produces(ContentTypes.CONTENTTYPEEXCELX)]
[ProducesResponseType(200)]
- [SwaggerOperation(Tags = new[] { "lease", "payements", "report" })]
+ [SwaggerOperation(Tags = new[] { "lease", "payments", "report" })]
public IActionResult ExportLeasePayments(int fiscalYearStart)
{
var acceptHeader = (string)this.Request.Headers["Accept"];
diff --git a/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportModel.cs b/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportModel.cs
index 38d2b3b24a..7719a466a4 100644
--- a/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportModel.cs
@@ -21,8 +21,11 @@ public class CompensationFinancialReportModel
[DisplayName("Product")]
public string Product { get; set; }
- [DisplayName("Acquisition File # and Name")]
- public string AcquisitionNumberAndName { get; set; }
+ [DisplayName("File Type")]
+ public string FileType { get; set; }
+
+ [DisplayName("File # and Name")]
+ public string FileNumberAndName { get; set; }
[DisplayName("Fiscal Year")]
public string FiscalYear { get; set; }
@@ -91,9 +94,10 @@ public CompensationFinancialReportModel(PimsCompReqFinancial financial, Compensa
{
ExportBy = user.GetDisplayName();
ExportDate = DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
- MinistryProject = GetMinistryProjectName(financial.CompensationRequisition?.AcquisitionFile?.Project);
- Product = GetMinistryProductName(financial.CompensationRequisition?.AcquisitionFile?.Product);
- AcquisitionNumberAndName = GetAcquisitionFileName(financial.CompensationRequisition?.AcquisitionFile);
+ MinistryProject = GetMinistryProjectName(financial.CompensationRequisition?.AcquisitionFile?.Project ?? financial.CompensationRequisition?.Lease?.Project);
+ Product = GetMinistryProductName(financial.CompensationRequisition?.AcquisitionFile?.Product ?? financial.CompensationRequisition?.Lease?.Product);
+ FileType = GetFileType(financial.CompensationRequisition);
+ FileNumberAndName = GetFileNumberAndName(financial.CompensationRequisition);
FiscalYear = financial.CompensationRequisition?.FiscalYear ?? string.Empty;
AlternateProject = GetMinistryProjectName(financial.CompensationRequisition?.AlternateProject);
RequisitionNumber = financial.CompensationRequisition?.Internal_Id ?? 0;
@@ -108,14 +112,14 @@ public CompensationFinancialReportModel(PimsCompReqFinancial financial, Compensa
var project = GetProject(financial);
// Draft requisition totals per project
- ProjectDraftPreTaxAmount = project is not null && reportTotals.ProjectDraftPreTaxAmount.ContainsKey(project.Id) ? reportTotals.ProjectDraftPreTaxAmount[project.Id] : 0;
- ProjectDraftTaxAmount = project is not null && reportTotals.ProjectDraftTaxAmount.ContainsKey(project.Id) ? reportTotals.ProjectDraftTaxAmount[project.Id] : 0;
- ProjectDraftTotalAmount = project is not null && reportTotals.ProjectDraftTotalAmount.ContainsKey(project.Id) ? reportTotals.ProjectDraftTotalAmount[project.Id] : 0;
+ ProjectDraftPreTaxAmount = project is not null && reportTotals.ProjectDraftPreTaxAmount.TryGetValue(project.Id, out decimal draftPreTax) ? draftPreTax : 0;
+ ProjectDraftTaxAmount = project is not null && reportTotals.ProjectDraftTaxAmount.TryGetValue(project.Id, out decimal draftTax) ? draftTax : 0;
+ ProjectDraftTotalAmount = project is not null && reportTotals.ProjectDraftTotalAmount.TryGetValue(project.Id, out decimal draftTotal) ? draftTotal : 0;
// Final requisition total per project
- ProjectFinalPreTaxAmount = project is not null && reportTotals.ProjectFinalPreTaxAmount.ContainsKey(project.Id) ? reportTotals.ProjectFinalPreTaxAmount[project.Id] : 0;
- ProjectFinalTaxAmount = project is not null && reportTotals.ProjectFinalTaxAmount.ContainsKey(project.Id) ? reportTotals.ProjectFinalTaxAmount[project.Id] : 0;
- ProjectFinalTotalAmount = project is not null && reportTotals.ProjectFinalTotalAmount.ContainsKey(project.Id) ? reportTotals.ProjectFinalTotalAmount[project.Id] : 0;
+ ProjectFinalPreTaxAmount = project is not null && reportTotals.ProjectFinalPreTaxAmount.TryGetValue(project.Id, out decimal finalPreTax) ? finalPreTax : 0;
+ ProjectFinalTaxAmount = project is not null && reportTotals.ProjectFinalTaxAmount.TryGetValue(project.Id, out decimal finalTax) ? finalTax : 0;
+ ProjectFinalTotalAmount = project is not null && reportTotals.ProjectFinalTotalAmount.TryGetValue(project.Id, out decimal finalTotal) ? finalTotal : 0;
// Total expenditures - draft
AllExpendituresDraftPreTaxAmount = reportTotals.AllExpendituresDraftPreTaxAmount;
@@ -139,20 +143,19 @@ private static PimsProject GetProject(PimsCompReqFinancial financial)
{
return financial.CompensationRequisition.AcquisitionFile.Project;
}
+ else if (financial?.CompensationRequisition?.Lease?.Project is not null)
+ {
+ return financial.CompensationRequisition.Lease.Project;
+ }
else
{
return null;
}
}
- private static string GetNullableDate(DateTime? dateTime)
- {
- return dateTime.HasValue ? dateTime.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) : string.Empty;
- }
-
- private static string GetNullableDate(DateOnly? dateTime)
+ private static string GetNullableDate(DateOnly? date)
{
- return dateTime.HasValue ? dateTime.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) : string.Empty;
+ return date.HasValue ? date.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) : string.Empty;
}
private static string GetMinistryProjectName(PimsProject project)
@@ -191,15 +194,35 @@ private static string GetFinancialActivityName(PimsFinancialActivityCode financi
}
}
- private static string GetAcquisitionFileName(PimsAcquisitionFile file)
+ private static string GetFileNumberAndName(PimsCompensationRequisition compensationRequisition)
{
- if (file == null)
+ if (compensationRequisition?.AcquisitionFile is not null)
+ {
+ return $"{compensationRequisition.AcquisitionFile.FileNumber} - {compensationRequisition.AcquisitionFile.FileName}";
+ }
+ else if (compensationRequisition?.Lease is not null)
+ {
+ return compensationRequisition.Lease.LFileNo ?? string.Empty;
+ }
+ else
{
return string.Empty;
}
+ }
+
+ private static string GetFileType(PimsCompensationRequisition compensationRequisition)
+ {
+ if (compensationRequisition?.AcquisitionFile is not null)
+ {
+ return "Acquisition";
+ }
+ else if (compensationRequisition?.Lease is not null)
+ {
+ return "Lease/Licence";
+ }
else
{
- return $"{file.FileNumber} - {file.FileName}";
+ return string.Empty;
}
}
}
diff --git a/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportTotalsModel.cs b/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportTotalsModel.cs
index 41f9187fa0..0711d4724f 100644
--- a/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportTotalsModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportTotalsModel.cs
@@ -105,6 +105,10 @@ private static PimsProject GetProject(PimsCompReqFinancial financial)
{
return financial.CompensationRequisition.AcquisitionFile.Project;
}
+ else if (financial?.CompensationRequisition?.Lease?.Project is not null)
+ {
+ return financial.CompensationRequisition.Lease.Project;
+ }
else
{
return null;
@@ -113,14 +117,10 @@ private static PimsProject GetProject(PimsCompReqFinancial financial)
private static void AddToProjectTotal(Dictionary dict, long projectId, decimal financialValue)
{
- if (dict.ContainsKey(projectId))
+ if (!dict.TryAdd(projectId, financialValue))
{
dict[projectId] += financialValue;
}
- else
- {
- dict.Add(projectId, financialValue);
- }
}
}
}
diff --git a/source/backend/api/Controllers/LookupController.cs b/source/backend/api/Controllers/LookupController.cs
index ba37472735..600effdc15 100644
--- a/source/backend/api/Controllers/LookupController.cs
+++ b/source/backend/api/Controllers/LookupController.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
-using System.Linq;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -46,20 +45,6 @@ public LookupController(ILookupRepository lookupRepository, IMapper mapper, IMem
#region Endpoints
- ///
- /// Get all of the role code values.
- ///
- ///
- [HttpGet("roles")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(IEnumerable), 200)]
- [SwaggerOperation(Tags = new[] { "lookup" })]
- public IActionResult GetRoles()
- {
- var roleCodes = _mapper.Map(_lookupRepository.GetAllRoles());
- return new JsonResult(roleCodes.ToArray());
- }
-
///
/// Get all of the code values.
///
@@ -146,6 +131,8 @@ public IActionResult GetAll()
var historicalNumberTypes = _mapper.Map(_lookupRepository.GetAllHistoricalNumberTypes());
var leaseChecklistSectionTypes = _mapper.Map(_lookupRepository.GetAllLeaseChecklistSectionTypes());
var leasePaymentCategoryTypes = _mapper.Map(_lookupRepository.GetAllLeasePaymentCategoryTypes());
+ var consultationOutcomeTypes = _mapper.Map(_lookupRepository.GetAllConsultationOutcomeTypes());
+ var subfileInterestTypes = _mapper.Map(_lookupRepository.GetAllSubfileInterestTypes());
var codes = new List
///
/// The formatted Acquisition File Number.
- private static string GenerateAcquisitionNumber(short prefix, long fileNumber, short suffix = 1)
+ private static string GenerateAcquisitionNumber(short prefix, long fileNumber, int suffix = 1)
{
return $"{prefix:00}-{fileNumber}-{suffix:00}";
}
@@ -799,6 +852,24 @@ private int GetNextAcquisitionFileNumberSequenceValue()
return (int)_sequenceRepository.GetNextSequenceValue("dbo.PIMS_ACQUISITION_FILE_NO_SEQ");
}
+ private int GetNextSubFileSuffixValue(long parentAcquisitionFileId)
+ {
+ // To determine the next suffix number we need to grab all sub-files (regardless of any region restriction)
+ var allRegions = Context.PimsRegions.AsNoTracking().Select(r => r.RegionCode).ToHashSet();
+
+ // The suffix numbers for sub-interest files start from "02", and will increment by 1 for sub-sequent file in the order of creation.
+ var existingSubFiles = GetAcquisitionSubFiles(parentAcquisitionFileId, allRegions);
+ if (existingSubFiles.Count == 0)
+ {
+ return 2;
+ }
+ else
+ {
+ int latestSuffix = existingSubFiles.Select(x => x.GetAcquisitionNumberSuffix()).Max();
+ return latestSuffix + 1;
+ }
+ }
+
///
/// Generate a common IQueryable for Acquisition Files.
///
diff --git a/source/backend/dal/Repositories/CompReqFinancialRepository.cs b/source/backend/dal/Repositories/CompReqFinancialRepository.cs
index 2dff5534a8..7eeae53b06 100644
--- a/source/backend/dal/Repositories/CompReqFinancialRepository.cs
+++ b/source/backend/dal/Repositories/CompReqFinancialRepository.cs
@@ -1,8 +1,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
+using LinqKit;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
+using Pims.Core.Exceptions;
using Pims.Dal.Entities;
using Pims.Dal.Entities.Models;
using Pims.Dal.Helpers.Extensions;
@@ -62,48 +64,73 @@ public IEnumerable GetAllByLeaseFileId(long leaseFileId, b
return query.AsNoTracking().ToList();
}
- public IEnumerable SearchCompensationRequisitionFinancials(AcquisitionReportFilterModel filter)
+ public IEnumerable SearchCompensationRequisitionFinancials(AcquisitionReportFilterModel filter, bool includeAcquisitions = true, bool includeLeases = true)
{
using var scope = Logger.QueryScope();
- var query = Context.PimsCompReqFinancials
+ if (!includeAcquisitions && !includeLeases)
+ {
+ throw new BusinessRuleViolationException("Compensation Requisition Export requires access to either acquisition files or leases");
+ }
+
+ IQueryable query = Context.PimsCompReqFinancials.AsNoTracking()
.Include(f => f.FinancialActivityCode)
.Include(f => f.CompensationRequisition)
- .ThenInclude(cr => cr.AlternateProject)
- .Include(f => f.CompensationRequisition)
- .ThenInclude(cr => cr.AcquisitionFile)
- .ThenInclude(a => a.PimsAcquisitionFileTeams)
- .ThenInclude(afp => afp.Person)
- .Include(f => f.CompensationRequisition)
- .ThenInclude(cr => cr.AcquisitionFile)
- .ThenInclude(a => a.PimsAcquisitionFileTeams)
- .ThenInclude(o => o.Organization)
- .Include(f => f.CompensationRequisition)
- .ThenInclude(cr => cr.AcquisitionFile)
- .ThenInclude(a => a.Project)
- .Include(f => f.CompensationRequisition)
- .ThenInclude(cr => cr.AcquisitionFile)
- .ThenInclude(a => a.Product)
- .AsNoTracking();
+ .ThenInclude(cr => cr.AlternateProject);
+
+ if (includeAcquisitions)
+ {
+ query = query
+ .Include(f => f.CompensationRequisition)
+ .ThenInclude(cr => cr.AcquisitionFile)
+ .ThenInclude(a => a.PimsAcquisitionFileTeams)
+ .ThenInclude(afp => afp.Person)
+ .Include(f => f.CompensationRequisition)
+ .ThenInclude(cr => cr.AcquisitionFile)
+ .ThenInclude(a => a.PimsAcquisitionFileTeams)
+ .ThenInclude(o => o.Organization)
+ .Include(f => f.CompensationRequisition)
+ .ThenInclude(cr => cr.AcquisitionFile)
+ .ThenInclude(a => a.Project)
+ .Include(f => f.CompensationRequisition)
+ .ThenInclude(cr => cr.AcquisitionFile)
+ .ThenInclude(a => a.Product);
+ }
+
+ if (includeLeases)
+ {
+ query = query
+ .Include(f => f.CompensationRequisition)
+ .ThenInclude(cr => cr.Lease)
+ .ThenInclude(l => l.Project)
+ .Include(f => f.CompensationRequisition)
+ .ThenInclude(cr => cr.Lease)
+ .ThenInclude(l => l.Product);
+ }
+
+ var predicate = PredicateBuilder.New(p => true);
if (filter.Projects != null && filter.Projects.Any())
{
- query = query.Where(f =>
- (f.CompensationRequisition.AlternateProjectId.HasValue && filter.Projects.Contains(f.CompensationRequisition.AlternateProjectId.Value)) ||
- (!f.CompensationRequisition.AlternateProjectId.HasValue && f.CompensationRequisition.AcquisitionFile.ProjectId.HasValue && filter.Projects.Contains(f.CompensationRequisition.AcquisitionFile.ProjectId.Value)));
+ var projectBuilder = PredicateBuilder.New(p => false);
+ projectBuilder.Or(f => f.CompensationRequisition.AlternateProjectId.HasValue && filter.Projects.Contains(f.CompensationRequisition.AlternateProjectId.Value));
+ projectBuilder.Or(f => !f.CompensationRequisition.AlternateProjectId.HasValue && f.CompensationRequisition.AcquisitionFile != null && f.CompensationRequisition.AcquisitionFile.ProjectId.HasValue && filter.Projects.Contains(f.CompensationRequisition.AcquisitionFile.ProjectId.Value));
+ projectBuilder.Or(f => !f.CompensationRequisition.AlternateProjectId.HasValue && f.CompensationRequisition.Lease != null && f.CompensationRequisition.Lease.ProjectId.HasValue && filter.Projects.Contains(f.CompensationRequisition.Lease.ProjectId.Value));
+
+ predicate.And(projectBuilder);
}
- if (filter.AcquisitionTeamPersons != null && filter.AcquisitionTeamPersons.Any())
+ if (includeAcquisitions && filter.AcquisitionTeamPersons != null && filter.AcquisitionTeamPersons.Any())
{
- query = query.Where(f => f.CompensationRequisition.AcquisitionFile.PimsAcquisitionFileTeams.Any(afp => afp.PersonId.HasValue && filter.AcquisitionTeamPersons.Contains((long)afp.PersonId)));
+ predicate.And(f => f.CompensationRequisition.AcquisitionFile != null && f.CompensationRequisition.AcquisitionFile.PimsAcquisitionFileTeams.Any(afp => afp.PersonId.HasValue && filter.AcquisitionTeamPersons.Contains((long)afp.PersonId)));
}
- if (filter.AcquisitionTeamOrganizations != null && filter.AcquisitionTeamOrganizations.Any())
+ if (includeAcquisitions && filter.AcquisitionTeamOrganizations != null && filter.AcquisitionTeamOrganizations.Any())
{
- query = query.Where(f => f.CompensationRequisition.AcquisitionFile.PimsAcquisitionFileTeams.Any(o => o.OrganizationId.HasValue && filter.AcquisitionTeamOrganizations.Contains((long)o.OrganizationId)));
+ predicate.And(f => f.CompensationRequisition.AcquisitionFile != null && f.CompensationRequisition.AcquisitionFile.PimsAcquisitionFileTeams.Any(o => o.OrganizationId.HasValue && filter.AcquisitionTeamOrganizations.Contains((long)o.OrganizationId)));
}
- return query.ToList();
+ return query.Where(predicate).ToList();
}
}
}
diff --git a/source/backend/dal/Repositories/CompensationRequisitionRepository.cs b/source/backend/dal/Repositories/CompensationRequisitionRepository.cs
index a264e85a78..eadd62f192 100644
--- a/source/backend/dal/Repositories/CompensationRequisitionRepository.cs
+++ b/source/backend/dal/Repositories/CompensationRequisitionRepository.cs
@@ -39,6 +39,7 @@ public IList GetAllByLeaseFileId(long leaseFileId)
{
return Context.PimsCompensationRequisitions
.Include(c => c.PimsCompReqFinancials)
+ .Include(c => c.PimsLeaseStakeholderCompReqs)
.AsNoTracking()
.Where(c => c.LeaseId == leaseFileId).ToList();
}
@@ -114,7 +115,7 @@ public bool TryDelete(long compensationId)
Context.PimsCompReqFinancials.Remove(new PimsCompReqFinancial() { CompReqFinancialId = financial.CompReqFinancialId });
}
- foreach(var propAcqFile in deletedEntity.PimsPropAcqFlCompReqs)
+ foreach (var propAcqFile in deletedEntity.PimsPropAcqFlCompReqs)
{
Context.PimsPropAcqFlCompReqs.Remove(new PimsPropAcqFlCompReq() { PropAcqFlCompReqId = propAcqFile.PropAcqFlCompReqId });
}
diff --git a/source/backend/dal/Repositories/ConsultationRepository.cs b/source/backend/dal/Repositories/ConsultationRepository.cs
index a40d99a95a..612737b0b7 100644
--- a/source/backend/dal/Repositories/ConsultationRepository.cs
+++ b/source/backend/dal/Repositories/ConsultationRepository.cs
@@ -38,6 +38,7 @@ public List GetConsultationsByLease(long leaseId)
return Context.PimsLeaseConsultations
.Where(lc => lc.LeaseId == leaseId)
.Include(lc => lc.ConsultationTypeCodeNavigation)
+ .Include(lc => lc.ConsultationOutcomeTypeCodeNavigation)
.AsNoTracking()
.ToList();
}
@@ -58,6 +59,7 @@ public PimsLeaseConsultation GetConsultationById(long consultationId)
return Context.PimsLeaseConsultations.Where(x => x.LeaseConsultationId == consultationId)
.AsNoTracking()
.Include(x => x.ConsultationTypeCodeNavigation)
+ .Include(x => x.ConsultationOutcomeTypeCodeNavigation)
.FirstOrDefault() ?? throw new KeyNotFoundException();
}
diff --git a/source/backend/dal/Repositories/DocumentTypeRepository.cs b/source/backend/dal/Repositories/DocumentTypeRepository.cs
index 398d7bb54c..c2131e1aa3 100644
--- a/source/backend/dal/Repositories/DocumentTypeRepository.cs
+++ b/source/backend/dal/Repositories/DocumentTypeRepository.cs
@@ -30,6 +30,18 @@ public DocumentTypeRepository(PimsContext dbContext, ClaimsPrincipal user, ILogg
#region Methods
+ ///
+ /// Get the PimsDocumetType by Id.
+ ///
+ /// The Document Type Id.
+ ///
+ public PimsDocumentTyp GetById(long id)
+ {
+ return this.Context.PimsDocumentTyps.AsNoTracking()
+ .Where(x => x.DocumentTypeId == id)
+ .FirstOrDefault() ?? throw new KeyNotFoundException();
+ }
+
///
/// Get a list of all the document types.
///
@@ -85,6 +97,7 @@ public PimsDocumentTyp Update(PimsDocumentTyp documentType)
this.Context.PimsDocumentTyps.FirstOrDefault(dt => documentType.DocumentTypeId == dt.DocumentTypeId) ?? throw new KeyNotFoundException($"Failed to find documentType for mayan ID: {documentType.MayanId}");
existingDocumentType.DocumentTypeDescription = documentType.DocumentTypeDescription;
+ existingDocumentType.DocumentTypeDefinition = documentType.DocumentTypeDefinition;
existingDocumentType.MayanId = documentType.MayanId;
existingDocumentType.DisplayOrder = documentType.DisplayOrder;
existingDocumentType.IsDisabled = documentType.IsDisabled;
diff --git a/source/backend/dal/Repositories/Interfaces/IAcquisitionFileRepository.cs b/source/backend/dal/Repositories/Interfaces/IAcquisitionFileRepository.cs
index c522192bf2..4264a4f246 100644
--- a/source/backend/dal/Repositories/Interfaces/IAcquisitionFileRepository.cs
+++ b/source/backend/dal/Repositories/Interfaces/IAcquisitionFileRepository.cs
@@ -31,5 +31,7 @@ public interface IAcquisitionFileRepository : IRepository
PimsProperty GetProperty(long acquisitionFilePropertyId);
List GetAcquisitionFileExportDeep(AcquisitionFilter filter, HashSet regions, long? contractorPersonId = null);
+
+ List GetAcquisitionSubFiles(long acquisitionFileId, HashSet regions, long? contractorPersonId = null);
}
}
diff --git a/source/backend/dal/Repositories/Interfaces/ICompReqFinancialRepository.cs b/source/backend/dal/Repositories/Interfaces/ICompReqFinancialRepository.cs
index ae0c500ad5..3e1c23d933 100644
--- a/source/backend/dal/Repositories/Interfaces/ICompReqFinancialRepository.cs
+++ b/source/backend/dal/Repositories/Interfaces/ICompReqFinancialRepository.cs
@@ -10,6 +10,6 @@ public interface ICompReqFinancialRepository : IRepository
IEnumerable GetAllByLeaseFileId(long leaseFileId, bool? finalOnly);
- IEnumerable SearchCompensationRequisitionFinancials(AcquisitionReportFilterModel filter);
+ IEnumerable SearchCompensationRequisitionFinancials(AcquisitionReportFilterModel filter, bool includeAcquisitions = true, bool includeLeases = true);
}
}
diff --git a/source/backend/dal/Repositories/Interfaces/IDocumentTypeRepository.cs b/source/backend/dal/Repositories/Interfaces/IDocumentTypeRepository.cs
index acabda4918..670ff906de 100644
--- a/source/backend/dal/Repositories/Interfaces/IDocumentTypeRepository.cs
+++ b/source/backend/dal/Repositories/Interfaces/IDocumentTypeRepository.cs
@@ -8,6 +8,8 @@ namespace Pims.Dal.Repositories
///
public interface IDocumentTypeRepository : IRepository
{
+ PimsDocumentTyp GetById(long id);
+
IList GetAll();
IList GetByCategory(string category);
diff --git a/source/backend/dal/Repositories/Interfaces/ILookupRepository.cs b/source/backend/dal/Repositories/Interfaces/ILookupRepository.cs
index 353aa2112c..ba895f0898 100644
--- a/source/backend/dal/Repositories/Interfaces/ILookupRepository.cs
+++ b/source/backend/dal/Repositories/Interfaces/ILookupRepository.cs
@@ -155,5 +155,9 @@ public interface ILookupRepository : IRepository
IEnumerable GetAllLeaseChecklistSectionTypes();
IEnumerable GetAllLeasePaymentCategoryTypes();
+
+ IEnumerable GetAllConsultationOutcomeTypes();
+
+ IEnumerable GetAllSubfileInterestTypes();
}
}
diff --git a/source/backend/dal/Repositories/Interfaces/IPropertyLeaseRepository.cs b/source/backend/dal/Repositories/Interfaces/IPropertyLeaseRepository.cs
index 3338e12e22..b9bb4edeb5 100644
--- a/source/backend/dal/Repositories/Interfaces/IPropertyLeaseRepository.cs
+++ b/source/backend/dal/Repositories/Interfaces/IPropertyLeaseRepository.cs
@@ -13,5 +13,7 @@ public interface IPropertyLeaseRepository : IRepository
IEnumerable GetAllByLeaseId(long leaseId);
IEnumerable UpdatePropertyLeases(long leaseId, ICollection pimsPropertyLeases);
+
+ bool LeaseFilePropertyInCompensationReq(long propertyLeaseFileId);
}
}
diff --git a/source/backend/dal/Repositories/LeasePaymentRepository.cs b/source/backend/dal/Repositories/LeasePaymentRepository.cs
index fc59e6fcbc..49587e6b90 100644
--- a/source/backend/dal/Repositories/LeasePaymentRepository.cs
+++ b/source/backend/dal/Repositories/LeasePaymentRepository.cs
@@ -47,40 +47,10 @@ public IEnumerable GetAllTracking(DateTime startDate, DateTime
return this.Context.PimsLeasePayments
.AsSplitQuery()
.Include(p => p.LeasePaymentCategoryTypeCodeNavigation)
- .Include(p => p.LeasePeriod)
- .ThenInclude(t => t.Lease)
- .ThenInclude(p => p.PimsPropertyLeases)
- .ThenInclude(p => p.Property)
- .ThenInclude(p => p.PimsHistoricalFileNumbers)
- .ThenInclude(h => h.HistoricalFileNumberTypeCodeNavigation)
- .Include(p => p.LeasePeriod)
- .ThenInclude(t => t.Lease)
- .ThenInclude(p => p.RegionCodeNavigation)
- .Include(p => p.LeasePeriod)
- .ThenInclude(t => t.Lease)
- .ThenInclude(t => t.LeaseStatusTypeCodeNavigation)
- .Include(p => p.LeasePeriod)
- .ThenInclude(t => t.Lease)
- .ThenInclude(t => t.LeasePayRvblTypeCodeNavigation)
- .Include(p => p.LeasePeriod)
- .ThenInclude(t => t.Lease)
- .ThenInclude(t => t.PimsLeaseStakeholders)
- .ThenInclude(t => t.Person)
- .Include(p => p.LeasePeriod)
- .ThenInclude(t => t.Lease)
- .ThenInclude(t => t.LeaseProgramTypeCodeNavigation)
- .Include(p => p.LeasePeriod)
- .ThenInclude(t => t.Lease)
- .ThenInclude(p => p.PimsLeaseLeasePurposes)
- .ThenInclude(c => c.LeasePurposeTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.LeasePeriodStatusTypeCodeNavigation)
.Include(p => p.LeasePeriod)
.ThenInclude(t => t.LeasePmtFreqTypeCodeNavigation)
- .Include(p => p.LeasePeriod)
- .ThenInclude(t => t.Lease)
- .ThenInclude(t => t.PimsLeasePeriods)
- .ThenInclude(t => t.PimsLeasePayments)
.Where(p => p.PaymentReceivedDate <= endDate && p.PaymentReceivedDate >= startDate);
}
}
diff --git a/source/backend/dal/Repositories/LeaseRepository.cs b/source/backend/dal/Repositories/LeaseRepository.cs
index dfccdad31c..cbb49cf8e4 100644
--- a/source/backend/dal/Repositories/LeaseRepository.cs
+++ b/source/backend/dal/Repositories/LeaseRepository.cs
@@ -121,6 +121,9 @@ public IEnumerable GetAllByIds(IEnumerable leaseIds)
IEnumerable leases = this.Context.PimsLeases.AsSplitQuery().AsNoTracking()
.Include(l => l.PimsPropertyLeases)
+ .ThenInclude(p => p.Property)
+ .ThenInclude(p => p.PimsHistoricalFileNumbers)
+ .ThenInclude(h => h.HistoricalFileNumberTypeCodeNavigation)
.Include(l => l.RegionCodeNavigation)
.Include(l => l.LeaseProgramTypeCodeNavigation)
.Include(l => l.LeasePayRvblTypeCodeNavigation)
@@ -131,6 +134,7 @@ public IEnumerable GetAllByIds(IEnumerable leaseIds)
.ThenInclude(p => p.LeasePurposeTypeCodeNavigation)
.Include(l => l.LeaseStatusTypeCodeNavigation)
.Include(l => l.PimsLeaseStakeholders)
+ .ThenInclude(t => t.Person)
.Include(t => t.PimsPropertyImprovements)
.Include(l => l.PimsInsurances)
.Include(l => l.PimsSecurityDeposits)
diff --git a/source/backend/dal/Repositories/LookupRepository.cs b/source/backend/dal/Repositories/LookupRepository.cs
index fdeaac0d7d..3c6d6eb813 100644
--- a/source/backend/dal/Repositories/LookupRepository.cs
+++ b/source/backend/dal/Repositories/LookupRepository.cs
@@ -435,6 +435,16 @@ public IEnumerable GetAllLeasePaymentCategoryTypes
return Context.PimsLeasePaymentCategoryTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToArray();
}
+ public IEnumerable GetAllConsultationOutcomeTypes()
+ {
+ return Context.PimsConsultationOutcomeTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToArray();
+ }
+
+ public IEnumerable GetAllSubfileInterestTypes()
+ {
+ return Context.PimsSubfileInterestTypes.AsNoTracking().OrderBy(a => a.DisplayOrder).ToList();
+ }
+
#endregion
}
}
diff --git a/source/backend/dal/Repositories/PropertyLeaseRepository.cs b/source/backend/dal/Repositories/PropertyLeaseRepository.cs
index 9b565c5143..566f3bf52f 100644
--- a/source/backend/dal/Repositories/PropertyLeaseRepository.cs
+++ b/source/backend/dal/Repositories/PropertyLeaseRepository.cs
@@ -86,6 +86,16 @@ public IEnumerable UpdatePropertyLeases(long leaseId, ICollec
return GetAllByLeaseId(leaseId);
}
+ ///
+ /// Check the existence of a LeaseProperty assigned to a Lease Compensation Requisition.
+ ///
+ ///
+ /// True if exists.
+ public bool LeaseFilePropertyInCompensationReq(long propertyLeaseFileId)
+ {
+ return Context.PimsPropLeaseCompReqs.Where(x => x.PropertyLeaseId == propertyLeaseFileId).AsNoTracking().Any();
+ }
+
#endregion
}
}
diff --git a/source/backend/dal/Repositories/PropertyRepository.cs b/source/backend/dal/Repositories/PropertyRepository.cs
index 364117144a..8e176ebe73 100644
--- a/source/backend/dal/Repositories/PropertyRepository.cs
+++ b/source/backend/dal/Repositories/PropertyRepository.cs
@@ -532,11 +532,10 @@ public HashSet GetMatchingIds(PropertyFilterCriteria filter)
}
if (filter.IsOtherInterest)
{
- var today = DateOnly.FromDateTime(DateTime.Now);
- ownershipBuilder.Or(p => p.PimsPropertyAcquisitionFiles.Any(x => x.PimsTakes.Any(t => t.TakeStatusTypeCode == "COMPLETE" && t.IsNewLandAct && authorizationTypes.Contains(t.LandActTypeCode) && t.LandActEndDt >= today)));
- ownershipBuilder.Or(p => p.PimsPropertyAcquisitionFiles.Any(x => x.PimsTakes.Any(t => t.TakeStatusTypeCode == "COMPLETE" && t.IsNewInterestInSrw && t.SrwEndDt >= today)));
- ownershipBuilder.Or(p => p.PimsPropertyAcquisitionFiles.Any(x => x.PimsTakes.Any(t => t.TakeStatusTypeCode == "COMPLETE" && t.IsNewLicenseToConstruct && t.LtcEndDt >= today)));
- ownershipBuilder.Or(p => p.PimsPropertyAcquisitionFiles.Any(x => x.PimsTakes.Any(t => t.TakeStatusTypeCode == "COMPLETE" && t.IsActiveLease && t.ActiveLeaseEndDt >= today)));
+ ownershipBuilder.Or(p => p.PimsPropertyAcquisitionFiles.Any(x => x.PimsTakes.Any(t => t.TakeStatusTypeCode == "COMPLETE" && t.IsNewLandAct && authorizationTypes.Contains(t.LandActTypeCode))));
+ ownershipBuilder.Or(p => p.PimsPropertyAcquisitionFiles.Any(x => x.PimsTakes.Any(t => t.TakeStatusTypeCode == "COMPLETE" && t.IsNewInterestInSrw)));
+ ownershipBuilder.Or(p => p.PimsPropertyAcquisitionFiles.Any(x => x.PimsTakes.Any(t => t.TakeStatusTypeCode == "COMPLETE" && t.IsNewLicenseToConstruct)));
+ ownershipBuilder.Or(p => p.PimsPropertyAcquisitionFiles.Any(x => x.PimsTakes.Any(t => t.TakeStatusTypeCode == "COMPLETE" && t.IsActiveLease)));
}
if (filter.IsDisposed)
{
diff --git a/source/backend/entities/Partials/ConsultationOutcomeTypeCode.cs b/source/backend/entities/Partials/ConsultationOutcomeTypeCode.cs
new file mode 100644
index 0000000000..ffefd9aebe
--- /dev/null
+++ b/source/backend/entities/Partials/ConsultationOutcomeTypeCode.cs
@@ -0,0 +1,33 @@
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Pims.Dal.Entities
+{
+ ///
+ /// PimsConsultationOutcomeType class, provides an entity for the datamodel to manage Consultation outcome types.
+ ///
+ public partial class PimsConsultationOutcomeType : ITypeEntity
+ {
+ #region Properties
+
+ ///
+ /// get/set - Primary key to identify Consultation outcome type.
+ ///
+ [NotMapped]
+ public string Id { get => ConsultationOutcomeTypeCode; set => ConsultationOutcomeTypeCode = value; }
+ #endregion
+
+ #region Constructors
+
+ public PimsConsultationOutcomeType() { }
+
+ ///
+ /// Create a new instance of a PimsConsultationOutcomeType class.
+ ///
+ ///
+ public PimsConsultationOutcomeType(string id)
+ {
+ Id = id;
+ }
+ #endregion
+ }
+}
diff --git a/source/backend/entities/Partials/SubfileInterestType.cs b/source/backend/entities/Partials/SubfileInterestType.cs
new file mode 100644
index 0000000000..c2d442b3f8
--- /dev/null
+++ b/source/backend/entities/Partials/SubfileInterestType.cs
@@ -0,0 +1,26 @@
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Pims.Dal.Entities
+{
+ ///
+ /// PimsSubfileInterestType class, provides an entity for the datamodel to manage acquisition sub file interest types.
+ ///
+ public partial class PimsSubfileInterestType : ITypeEntity
+ {
+ public PimsSubfileInterestType(string id)
+ : this()
+ {
+ Id = id;
+ }
+
+ public PimsSubfileInterestType()
+ {
+ }
+
+ ///
+ /// get/set - Primary key to identify acquisition sub file interets type.
+ ///
+ [NotMapped]
+ public string Id { get => SubfileInterestTypeCode; set => SubfileInterestTypeCode = value; }
+ }
+}
diff --git a/source/backend/entities/PimsBaseContext.cs b/source/backend/entities/PimsBaseContext.cs
index 44f2deb602..53b90aff65 100644
--- a/source/backend/entities/PimsBaseContext.cs
+++ b/source/backend/entities/PimsBaseContext.cs
@@ -102,6 +102,8 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsCompensationRequisitionHists { get; set; }
+ public virtual DbSet PimsConsultationOutcomeTypes { get; set; }
+
public virtual DbSet PimsConsultationStatusTypes { get; set; }
public virtual DbSet PimsConsultationTypes { get; set; }
@@ -186,6 +188,12 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsDocumentHists { get; set; }
+ public virtual DbSet PimsDocumentQueues { get; set; }
+
+ public virtual DbSet PimsDocumentQueueHists { get; set; }
+
+ public virtual DbSet PimsDocumentQueueStatusTypes { get; set; }
+
public virtual DbSet PimsDocumentStatusTypes { get; set; }
public virtual DbSet PimsDocumentTyps { get; set; }
@@ -462,6 +470,8 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsPropertyAnomalyTypes { get; set; }
+ public virtual DbSet PimsPropertyBoundaryLiteVws { get; set; }
+
public virtual DbSet PimsPropertyBoundaryVws { get; set; }
public virtual DbSet PimsPropertyContacts { get; set; }
@@ -480,6 +490,8 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsPropertyLeaseHists { get; set; }
+ public virtual DbSet PimsPropertyLocationLiteVws { get; set; }
+
public virtual DbSet PimsPropertyLocationVws { get; set; }
public virtual DbSet PimsPropertyOperations { get; set; }
@@ -576,6 +588,8 @@ public PimsBaseContext(DbContextOptions options)
public virtual DbSet PimsStaticVariableHists { get; set; }
+ public virtual DbSet PimsSubfileInterestTypes { get; set; }
+
public virtual DbSet PimsSurplusDeclarationTypes { get; set; }
public virtual DbSet PimsSurveyPlanTypes { get; set; }
@@ -881,22 +895,53 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
tb.HasTrigger("PIMS_ACQNFL_I_S_U_TR");
});
- entity.Property(e => e.AcquisitionFileId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_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.AcquisitionFileId)
+ .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_ACQUISITION_FILE_ID_SEQ])")
+ .HasComment("Generated surrogate primary key.");
+ entity.Property(e => e.AcqPhysFileStatusTypeCode).HasComment("Foreign key to the PIMS_ACQ_PHYS_FILE_STATUS_TYPE table.");
+ entity.Property(e => e.AcquisitionFileStatusTypeCode).HasComment("Foreign key to the PIMS_ACQUISITION_FILE_STATUS_TYPE table.");
+ entity.Property(e => e.AcquisitionFundingTypeCode).HasComment("Foreign key to the PIMS_ACQUISITION_FUNDING_TYPE table.");
+ entity.Property(e => e.AcquisitionTypeCode).HasComment("Foreign key to the PIMS_ACQUISITION_TYPE 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.AssignedDate)
.HasDefaultValueSql("(getutcdate())")
.HasComment("Date of file assignment.");
- 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.DeliveryDate).HasComment("Date of file delivery.");
+ entity.Property(e => e.EstCompletionDt).HasComment("Estimated date by which the acquisition would be completed.");
entity.Property(e => e.FileName).HasComment("Descriptive name given to the acquisition file.");
entity.Property(e => e.FileNo)
.HasDefaultValueSql("(NEXT VALUE FOR [PIMS_ACQUISITION_FILE_NO_SEQ])")
@@ -907,10 +952,16 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.FundingOther).HasComment("Description of other funding type.");
entity.Property(e => e.LegacyFileNumber).HasComment("Legacy formatted file number assigned to the acquisition file. Format follows YY-XXXXXX-ZZ where YY = MoTI region number, XXXXXX = generated integer sequence number, and ZZ = file suffix number (defaulting to '01'). Required due to some files having t");
entity.Property(e => e.LegacyStakeholder).HasComment("Legacy stakeholders imported from PAIMS.");
+ entity.Property(e => e.OtherSubfileInterestType).HasComment("If the user selects ?Other? then they will need to provide a subfile type description, which will be displayed as 'Other - ");
entity.Property(e => e.PaimsAcquisitionFileId).HasComment("Legacy Acquisition File ID from the PAIMS system.");
+ entity.Property(e => e.PossessionDt).HasComment("Date of possession following acquisition completion.");
+ entity.Property(e => e.PrntAcquisitionFileId).HasComment("Link to the parent acquisition file.");
+ entity.Property(e => e.ProductId).HasComment("Foreign key to the PIMS_PRODUCT table.");
+ entity.Property(e => e.ProjectId).HasComment("Foreign key to the PIMS_PROJECT table.");
entity.Property(e => e.RegionCode)
.HasDefaultValue((short)-1)
.HasComment("Region responsible for oversight of the acquisition.");
+ entity.Property(e => e.SubfileInterestTypeCode).HasComment("Foreign key to the PIMS_SUBFILE_INTEREST_TYPE table.");
entity.Property(e => e.TotalAllowableCompensation).HasComment("The maximum allowable compensation for the acquisition file. This amount should not be exceeded by the total of all assiciated H120's.");
entity.HasOne(d => d.AcqPhysFileStatusTypeCodeNavigation).WithMany(p => p.PimsAcquisitionFiles).HasConstraintName("PIM_ACQPFS_PIM_ACQNFL_FK");
@@ -925,6 +976,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_ACQTYP_PIM_ACQNFL_FK");
+ entity.HasOne(d => d.PrntAcquisitionFile).WithMany(p => p.InversePrntAcquisitionFile).HasConstraintName("PIM_ACQNFL_PIM_ACQNFL_FK");
+
entity.HasOne(d => d.Product).WithMany(p => p.PimsAcquisitionFiles).HasConstraintName("PIM_PRODCT_PIM_ACQNFL_FK");
entity.HasOne(d => d.Project).WithMany(p => p.PimsAcquisitionFiles).HasConstraintName("PIM_PROJCT_PIM_ACQNFL_FK");
@@ -932,6 +985,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.HasOne(d => d.RegionCodeNavigation).WithMany(p => p.PimsAcquisitionFiles)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_REGION_PIM_ACQNFL_FK");
+
+ entity.HasOne(d => d.SubfileInterestTypeCodeNavigation).WithMany(p => p.PimsAcquisitionFiles).HasConstraintName("PIM_SBFLIT_PIM_ACQNFL_FK");
});
modelBuilder.Entity(entity =>
@@ -1698,6 +1753,38 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.ConsultationOutcomeTypeCode).HasName("OUTCMT_PK");
+
+ entity.ToTable("PIMS_CONSULTATION_OUTCOME_TYPE", tb =>
+ {
+ tb.HasComment("Description of the consultation outcome type for a lease or license.");
+ tb.HasTrigger("PIMS_OUTCMT_I_S_I_TR");
+ tb.HasTrigger("PIMS_OUTCMT_I_S_U_TR");
+ });
+
+ entity.Property(e => e.ConsultationOutcomeTypeCode).HasComment("Code value of the consultation outcome 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 consultation outcome type.");
+ entity.Property(e => e.DisplayOrder).HasComment("Onscreen display order of the code types.");
+ entity.Property(e => e.IsDisabled).HasComment("Indicates if the code type is active.");
+ });
+
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.ConsultationStatusTypeCode).HasName("CONSTY_PK");
@@ -2909,6 +2996,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
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.DocumentExternalId).HasComment("Fluid key used to uniquely identify document in external system.");
entity.Property(e => e.DocumentStatusTypeCode).HasDefaultValue("NONE");
entity.Property(e => e.FileName)
.HasDefaultValue("")
@@ -3009,6 +3097,107 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.DocumentQueueId).HasName("DOCQUE_PK");
+
+ entity.ToTable("PIMS_DOCUMENT_QUEUE", tb =>
+ {
+ tb.HasComment("Table providing progress tracking of document inclusion into the MAYAN EDMS.");
+ tb.HasTrigger("PIMS_DOCQUE_A_S_IUD_TR");
+ tb.HasTrigger("PIMS_DOCQUE_I_S_I_TR");
+ tb.HasTrigger("PIMS_DOCQUE_I_S_U_TR");
+ });
+
+ entity.Property(e => e.DocumentQueueId)
+ .HasDefaultValueSql("(NEXT VALUE FOR [PIMS_DOCUMENT_QUEUE_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.DataSourceTypeCode).HasComment("Code value that refers to the source system the document originated in.");
+ 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.DocProcessEndDt).HasComment("When the document?s processing finishes, this will be populated");
+ entity.Property(e => e.DocProcessRetries).HasComment("The number of times that this document has been queued for upload.");
+ entity.Property(e => e.DocProcessStartDt).HasComment("When the document is sent to the backend for processing, this will be populated.");
+ entity.Property(e => e.Document).HasComment("The actual document blob, stored temporarily until after processing completes.");
+ entity.Property(e => e.DocumentExternalId).HasComment("Fluid key used to uniquely identify document in external system.");
+ entity.Property(e => e.DocumentId).HasComment("Foreign key to the PIMS_DOCUMENT table.");
+ entity.Property(e => e.DocumentQueueStatusTypeCode).HasComment("Code value that represents the current status of the document as it is processed by PIMS/MAYAN");
+ entity.Property(e => e.MayanError).HasComment("If the upload process fails, the error corresponding to the failure will be displayed here.");
+
+ entity.HasOne(d => d.DataSourceTypeCodeNavigation).WithMany(p => p.PimsDocumentQueues)
+ .OnDelete(DeleteBehavior.ClientSetNull)
+ .HasConstraintName("PIM_PIDSRT_PIM_DOCQUE_FK");
+
+ entity.HasOne(d => d.DocumentNavigation).WithMany(p => p.PimsDocumentQueues).HasConstraintName("PIM_DOCMNT_PIM_DOCQUE_FK");
+
+ entity.HasOne(d => d.DocumentQueueStatusTypeCodeNavigation).WithMany(p => p.PimsDocumentQueues)
+ .OnDelete(DeleteBehavior.ClientSetNull)
+ .HasConstraintName("PIM_DOCQST_PIM_DOCQUE_FK");
+ });
+
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.DocumentQueueHistId).HasName("PIMS_DOCQUE_H_PK");
+
+ entity.Property(e => e.DocumentQueueHistId).HasDefaultValueSql("(NEXT VALUE FOR [PIMS_DOCUMENT_QUEUE_H_ID_SEQ])");
+ entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
+ });
+
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.DocumentQueueStatusTypeCode).HasName("DOCQST_PK");
+
+ entity.ToTable("PIMS_DOCUMENT_QUEUE_STATUS_TYPE", tb =>
+ {
+ tb.HasComment("Table describing the status of the document in the queue for MAYAN EDMS assimilation.");
+ tb.HasTrigger("PIMS_DOCQST_I_S_I_TR");
+ tb.HasTrigger("PIMS_DOCQST_I_S_U_TR");
+ });
+
+ entity.Property(e => e.DocumentQueueStatusTypeCode).HasComment("Code value of the document queue status.");
+ 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 document queue status.");
+ entity.Property(e => e.DisplayOrder).HasComment("Order in which to display the code values, if required.");
+ entity.Property(e => e.IsDisabled).HasComment("Indicates if the code value is still active or is now disabled.");
+ });
+
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.DocumentStatusTypeCode).HasName("DOCSTY_PK");
@@ -3061,6 +3250,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.DocumentType)
.HasDefaultValue("")
.HasComment("Code value of the available document types.");
+ entity.Property(e => e.DocumentTypeDefinition).HasComment("Describes the purpose of the document.");
entity.Property(e => e.DocumentTypeDescription)
.HasDefaultValue("")
.HasComment("Description of the available document types.");
@@ -4345,6 +4535,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
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.ConsultationOutcomeTypeCode)
+ .HasDefaultValue("INPROGRESS")
+ .HasComment("Foreign key to the PIMS_CONSULTATION_OUTCOME_TYPE table.");
entity.Property(e => e.ConsultationStatusTypeCode)
.HasDefaultValue("UNKNOWN")
.HasComment("Foreign key to the PIMS_CONSULTATION_STATUS_TYPE table.");
@@ -4373,6 +4566,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.RequestedOn).HasComment("Date that the approval / consultation request was sent.");
entity.Property(e => e.ResponseReceivedDate).HasComment("Date that the consultation request response was received.");
+ entity.HasOne(d => d.ConsultationOutcomeTypeCodeNavigation).WithMany(p => p.PimsLeaseConsultations)
+ .OnDelete(DeleteBehavior.ClientSetNull)
+ .HasConstraintName("PIM_OUTCMT_PIM_LESCON_FK");
+
entity.HasOne(d => d.ConsultationStatusTypeCodeNavigation).WithMany(p => p.PimsLeaseConsultations)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("PIM_CONSTY_PIM_LESCON_FK");
@@ -6845,6 +7042,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.IsDisabled).HasComment("Indicates if the code is disabled.");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.ToView("PIMS_PROPERTY_BOUNDARY_LITE_VW");
+ });
+
modelBuilder.Entity(entity =>
{
entity.ToView("PIMS_PROPERTY_BOUNDARY_VW");
@@ -7019,6 +7221,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.ToView("PIMS_PROPERTY_LOCATION_LITE_VW");
+ });
+
modelBuilder.Entity(entity =>
{
entity.ToView("PIMS_PROPERTY_LOCATION_VW");
@@ -7538,7 +7745,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Entity(entity =>
{
- entity.HasKey(e => new { e.ResearchFileNoteId, e.ResearchFileId }).HasName("RFLNOT_PK");
+ entity.HasKey(e => e.ResearchFileNoteId).HasName("RFLNOT_PK");
entity.ToTable("PIMS_RESEARCH_FILE_NOTE", tb =>
{
@@ -8042,6 +8249,38 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.EffectiveDateHist).HasDefaultValueSql("(getutcdate())");
});
+ modelBuilder.Entity(entity =>
+ {
+ entity.HasKey(e => e.SubfileInterestTypeCode).HasName("SBFLIT_PK");
+
+ entity.ToTable("PIMS_SUBFILE_INTEREST_TYPE", tb =>
+ {
+ tb.HasComment("Codified values for the subfile interest type.");
+ tb.HasTrigger("PIMS_SBFLIT_I_S_I_TR");
+ tb.HasTrigger("PIMS_SBFLIT_I_S_U_TR");
+ });
+
+ entity.Property(e => e.SubfileInterestTypeCode).HasComment("Code value of the subfile interest 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 subfile interest type.");
+ entity.Property(e => e.DisplayOrder).HasComment("Designates a preferred presentation order of the code descriptions.");
+ entity.Property(e => e.IsDisabled).HasComment("Indicates if the code value is inactive.");
+ });
+
modelBuilder.Entity(entity =>
{
entity.HasKey(e => e.SurplusDeclarationTypeCode).HasName("SPDCLT_PK");
@@ -8785,6 +9024,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.HasSequence("PIMS_DOCUMENT_ID_SEQ")
.HasMin(1L)
.HasMax(2147483647L);
+ modelBuilder.HasSequence("PIMS_DOCUMENT_QUEUE_H_ID_SEQ")
+ .HasMin(1L)
+ .HasMax(2147483647L);
+ modelBuilder.HasSequence("PIMS_DOCUMENT_QUEUE_ID_SEQ")
+ .HasMin(1L)
+ .HasMax(2147483647L);
modelBuilder.HasSequence("PIMS_DOCUMENT_TYP_H_ID_SEQ")
.HasMin(1L)
.HasMax(2147483647L);
diff --git a/source/backend/entities/ef/PimsAcquisitionFile.cs b/source/backend/entities/ef/PimsAcquisitionFile.cs
index bf4011dfee..2eb08110c1 100644
--- a/source/backend/entities/ef/PimsAcquisitionFile.cs
+++ b/source/backend/entities/ef/PimsAcquisitionFile.cs
@@ -16,35 +16,64 @@ namespace Pims.Dal.Entities;
[Index("AcqPhysFileStatusTypeCode", Name = "ACQNFL_ACQ_PHYS_FILE_STATUS_TYPE_CODE_IDX")]
[Index("FileNumber", Name = "ACQNFL_FILE_NUMBER_IDX")]
[Index("LegacyFileNumber", Name = "ACQNFL_LEGACY_FILE_NUMBER_IDX")]
+[Index("PrntAcquisitionFileId", Name = "ACQNFL_PRNT_ACQUISITION_FILE_ID_IDX")]
[Index("ProductId", Name = "ACQNFL_PRODUCT_ID_IDX")]
[Index("ProjectId", Name = "ACQNFL_PROJECT_ID_IDX")]
[Index("RegionCode", Name = "ACQNFL_REGION_CODE_IDX")]
+[Index("SubfileInterestTypeCode", Name = "ACQNFL_SUBFILE_INTEREST_TYPE_CODE_IDX")]
public partial class PimsAcquisitionFile
{
+ ///
+ /// Generated surrogate primary key.
+ ///
[Key]
[Column("ACQUISITION_FILE_ID")]
public long AcquisitionFileId { get; set; }
+ ///
+ /// Link to the parent acquisition file.
+ ///
+ [Column("PRNT_ACQUISITION_FILE_ID")]
+ public long? PrntAcquisitionFileId { get; set; }
+
+ ///
+ /// Foreign key to the PIMS_PROJECT table.
+ ///
[Column("PROJECT_ID")]
public long? ProjectId { get; set; }
+ ///
+ /// Foreign key to the PIMS_PRODUCT table.
+ ///
[Column("PRODUCT_ID")]
public long? ProductId { get; set; }
+ ///
+ /// Foreign key to the PIMS_ACQUISITION_FILE_STATUS_TYPE table.
+ ///
[Required]
[Column("ACQUISITION_FILE_STATUS_TYPE_CODE")]
[StringLength(20)]
public string AcquisitionFileStatusTypeCode { get; set; }
+ ///
+ /// Foreign key to the PIMS_ACQUISITION_TYPE table.
+ ///
[Required]
[Column("ACQUISITION_TYPE_CODE")]
[StringLength(20)]
public string AcquisitionTypeCode { get; set; }
+ ///
+ /// Foreign key to the PIMS_ACQUISITION_FUNDING_TYPE table.
+ ///
[Column("ACQUISITION_FUNDING_TYPE_CODE")]
[StringLength(20)]
public string AcquisitionFundingTypeCode { get; set; }
+ ///
+ /// Foreign key to the PIMS_ACQ_PHYS_FILE_STATUS_TYPE table.
+ ///
[Column("ACQ_PHYS_FILE_STATUS_TYPE_CODE")]
[StringLength(20)]
public string AcqPhysFileStatusTypeCode { get; set; }
@@ -55,6 +84,13 @@ public partial class PimsAcquisitionFile
[Column("REGION_CODE")]
public short RegionCode { get; set; }
+ ///
+ /// Foreign key to the PIMS_SUBFILE_INTEREST_TYPE table.
+ ///
+ [Column("SUBFILE_INTEREST_TYPE_CODE")]
+ [StringLength(20)]
+ public string SubfileInterestTypeCode { get; set; }
+
///
/// Descriptive name given to the acquisition file.
///
@@ -122,52 +158,110 @@ public partial class PimsAcquisitionFile
[Column("TOTAL_ALLOWABLE_COMPENSATION", TypeName = "money")]
public decimal? TotalAllowableCompensation { get; set; }
+ ///
+ /// If the user selects ?Other? then they will need to provide a subfile type description, which will be displayed as 'Other - <description>
+ ///
+ [Column("OTHER_SUBFILE_INTEREST_TYPE")]
+ [StringLength(200)]
+ public string OtherSubfileInterestType { get; set; }
+
+ ///
+ /// Estimated date by which the acquisition would be completed.
+ ///
+ [Column("EST_COMPLETION_DT", TypeName = "datetime")]
+ public DateTime? EstCompletionDt { get; set; }
+
+ ///
+ /// Date of possession following acquisition completion.
+ ///
+ [Column("POSSESSION_DT", TypeName = "datetime")]
+ public DateTime? PossessionDt { 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)]
@@ -189,6 +283,9 @@ public partial class PimsAcquisitionFile
[InverseProperty("PimsAcquisitionFiles")]
public virtual PimsAcquisitionType AcquisitionTypeCodeNavigation { get; set; }
+ [InverseProperty("PrntAcquisitionFile")]
+ public virtual ICollection InversePrntAcquisitionFile { get; set; } = new List();
+
[InverseProperty("AcquisitionFile")]
public virtual ICollection PimsAcquisitionChecklistItems { get; set; } = new List();
@@ -222,6 +319,10 @@ public partial class PimsAcquisitionFile
[InverseProperty("AcquisitionFile")]
public virtual ICollection PimsPropertyAcquisitionFiles { get; set; } = new List();
+ [ForeignKey("PrntAcquisitionFileId")]
+ [InverseProperty("InversePrntAcquisitionFile")]
+ public virtual PimsAcquisitionFile PrntAcquisitionFile { get; set; }
+
[ForeignKey("ProductId")]
[InverseProperty("PimsAcquisitionFiles")]
public virtual PimsProduct Product { get; set; }
@@ -233,4 +334,8 @@ public partial class PimsAcquisitionFile
[ForeignKey("RegionCode")]
[InverseProperty("PimsAcquisitionFiles")]
public virtual PimsRegion RegionCodeNavigation { get; set; }
+
+ [ForeignKey("SubfileInterestTypeCode")]
+ [InverseProperty("PimsAcquisitionFiles")]
+ public virtual PimsSubfileInterestType SubfileInterestTypeCodeNavigation { get; set; }
}
diff --git a/source/backend/entities/ef/PimsAcquisitionFileHist.cs b/source/backend/entities/ef/PimsAcquisitionFileHist.cs
index 13e4ee3ea3..16a8997b6f 100644
--- a/source/backend/entities/ef/PimsAcquisitionFileHist.cs
+++ b/source/backend/entities/ef/PimsAcquisitionFileHist.cs
@@ -23,6 +23,9 @@ public partial class PimsAcquisitionFileHist
[Column("ACQUISITION_FILE_ID")]
public long AcquisitionFileId { get; set; }
+ [Column("PRNT_ACQUISITION_FILE_ID")]
+ public long? PrntAcquisitionFileId { get; set; }
+
[Column("PROJECT_ID")]
public long? ProjectId { get; set; }
@@ -50,6 +53,10 @@ public partial class PimsAcquisitionFileHist
[Column("REGION_CODE")]
public short RegionCode { get; set; }
+ [Column("SUBFILE_INTEREST_TYPE_CODE")]
+ [StringLength(20)]
+ public string SubfileInterestTypeCode { get; set; }
+
[Required]
[Column("FILE_NAME")]
[StringLength(500)]
@@ -87,6 +94,16 @@ public partial class PimsAcquisitionFileHist
[Column("TOTAL_ALLOWABLE_COMPENSATION", TypeName = "money")]
public decimal? TotalAllowableCompensation { get; set; }
+ [Column("OTHER_SUBFILE_INTEREST_TYPE")]
+ [StringLength(200)]
+ public string OtherSubfileInterestType { get; set; }
+
+ [Column("EST_COMPLETION_DT", TypeName = "datetime")]
+ public DateTime? EstCompletionDt { get; set; }
+
+ [Column("POSSESSION_DT", TypeName = "datetime")]
+ public DateTime? PossessionDt { get; set; }
+
[Column("CONCURRENCY_CONTROL_NUMBER")]
public long ConcurrencyControlNumber { get; set; }
diff --git a/source/backend/entities/ef/PimsConsultationOutcomeType.cs b/source/backend/entities/ef/PimsConsultationOutcomeType.cs
new file mode 100644
index 0000000000..1153c3dd73
--- /dev/null
+++ b/source/backend/entities/ef/PimsConsultationOutcomeType.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+///
+/// Description of the consultation outcome type for a lease or license.
+///
+[Table("PIMS_CONSULTATION_OUTCOME_TYPE")]
+public partial class PimsConsultationOutcomeType
+{
+ ///
+ /// Code value of the consultation outcome type.
+ ///
+ [Key]
+ [Column("CONSULTATION_OUTCOME_TYPE_CODE")]
+ [StringLength(20)]
+ public string ConsultationOutcomeTypeCode { get; set; }
+
+ ///
+ /// Description of the consultation outcome type.
+ ///
+ [Required]
+ [Column("DESCRIPTION")]
+ [StringLength(200)]
+ public string Description { get; set; }
+
+ ///
+ /// Onscreen display order of the code types.
+ ///
+ [Column("DISPLAY_ORDER")]
+ public int? DisplayOrder { get; set; }
+
+ ///
+ /// Indicates if the code type is active.
+ ///
+ [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("ConsultationOutcomeTypeCodeNavigation")]
+ public virtual ICollection PimsLeaseConsultations { get; set; } = new List();
+}
diff --git a/source/backend/entities/ef/PimsDataSourceType.cs b/source/backend/entities/ef/PimsDataSourceType.cs
index 8b97c8e5b2..8075a0bf79 100644
--- a/source/backend/entities/ef/PimsDataSourceType.cs
+++ b/source/backend/entities/ef/PimsDataSourceType.cs
@@ -59,6 +59,9 @@ public partial class PimsDataSourceType
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+ [InverseProperty("DataSourceTypeCodeNavigation")]
+ public virtual ICollection PimsDocumentQueues { get; set; } = new List();
+
[InverseProperty("DataSourceTypeCodeNavigation")]
public virtual ICollection PimsHistoricalFileNumbers { get; set; } = new List();
diff --git a/source/backend/entities/ef/PimsDocument.cs b/source/backend/entities/ef/PimsDocument.cs
index 1cdd487b2b..04f99b89bd 100644
--- a/source/backend/entities/ef/PimsDocument.cs
+++ b/source/backend/entities/ef/PimsDocument.cs
@@ -91,6 +91,13 @@ public partial class PimsDocument
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+ ///
+ /// Fluid key used to uniquely identify document in external system.
+ ///
+ [Column("DOCUMENT_EXTERNAL_ID")]
+ [StringLength(1000)]
+ public string DocumentExternalId { get; set; }
+
[ForeignKey("DocumentStatusTypeCode")]
[InverseProperty("PimsDocuments")]
public virtual PimsDocumentStatusType DocumentStatusTypeCodeNavigation { get; set; }
@@ -105,6 +112,9 @@ public partial class PimsDocument
[InverseProperty("Document")]
public virtual ICollection PimsDispositionFileDocuments { get; set; } = new List();
+ [InverseProperty("DocumentNavigation")]
+ public virtual ICollection PimsDocumentQueues { get; set; } = new List();
+
[InverseProperty("Document")]
public virtual ICollection PimsFormTypes { get; set; } = new List();
diff --git a/source/backend/entities/ef/PimsDocumentHist.cs b/source/backend/entities/ef/PimsDocumentHist.cs
index a24c8c67b3..9358571e99 100644
--- a/source/backend/entities/ef/PimsDocumentHist.cs
+++ b/source/backend/entities/ef/PimsDocumentHist.cs
@@ -89,4 +89,8 @@ public partial class PimsDocumentHist
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+
+ [Column("DOCUMENT_EXTERNAL_ID")]
+ [StringLength(1000)]
+ public string DocumentExternalId { get; set; }
}
diff --git a/source/backend/entities/ef/PimsDocumentQueue.cs b/source/backend/entities/ef/PimsDocumentQueue.cs
new file mode 100644
index 0000000000..9b14f389c4
--- /dev/null
+++ b/source/backend/entities/ef/PimsDocumentQueue.cs
@@ -0,0 +1,186 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+///
+/// Table providing progress tracking of document inclusion into the MAYAN EDMS.
+///
+[Table("PIMS_DOCUMENT_QUEUE")]
+[Index("DataSourceTypeCode", Name = "DOCQUE_DATA_SOURCE_TYPE_CODE_IDX")]
+[Index("DocumentId", Name = "DOCQUE_DOCUMENT_ID_IDX")]
+[Index("DocumentQueueStatusTypeCode", Name = "DOCQUE_DOCUMENT_QUEUE_STATUS_TYPE_CODE_IDX")]
+public partial class PimsDocumentQueue
+{
+ ///
+ /// Generated surrogate primary key.
+ ///
+ [Key]
+ [Column("DOCUMENT_QUEUE_ID")]
+ public long DocumentQueueId { get; set; }
+
+ ///
+ /// Foreign key to the PIMS_DOCUMENT table.
+ ///
+ [Column("DOCUMENT_ID")]
+ public long? DocumentId { get; set; }
+
+ ///
+ /// Code value that represents the current status of the document as it is processed by PIMS/MAYAN
+ ///
+ [Required]
+ [Column("DOCUMENT_QUEUE_STATUS_TYPE_CODE")]
+ [StringLength(20)]
+ public string DocumentQueueStatusTypeCode { get; set; }
+
+ ///
+ /// Code value that refers to the source system the document originated in.
+ ///
+ [Required]
+ [Column("DATA_SOURCE_TYPE_CODE")]
+ [StringLength(20)]
+ public string DataSourceTypeCode { get; set; }
+
+ ///
+ /// Fluid key used to uniquely identify document in external system.
+ ///
+ [Column("DOCUMENT_EXTERNAL_ID")]
+ [StringLength(1000)]
+ public string DocumentExternalId { get; set; }
+
+ ///
+ /// When the document is sent to the backend for processing, this will be populated.
+ ///
+ [Column("DOC_PROCESS_START_DT", TypeName = "datetime")]
+ public DateTime? DocProcessStartDt { get; set; }
+
+ ///
+ /// When the document?s processing finishes, this will be populated
+ ///
+ [Column("DOC_PROCESS_END_DT", TypeName = "datetime")]
+ public DateTime? DocProcessEndDt { get; set; }
+
+ ///
+ /// The number of times that this document has been queued for upload.
+ ///
+ [Column("DOC_PROCESS_RETRIES")]
+ public int? DocProcessRetries { get; set; }
+
+ ///
+ /// If the upload process fails, the error corresponding to the failure will be displayed here.
+ ///
+ [Column("MAYAN_ERROR")]
+ [StringLength(4000)]
+ public string MayanError { get; set; }
+
+ ///
+ /// The actual document blob, stored temporarily until after processing completes.
+ ///
+ [Column("DOCUMENT")]
+ public byte[] Document { 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("DataSourceTypeCode")]
+ [InverseProperty("PimsDocumentQueues")]
+ public virtual PimsDataSourceType DataSourceTypeCodeNavigation { get; set; }
+
+ [ForeignKey("DocumentId")]
+ [InverseProperty("PimsDocumentQueues")]
+ public virtual PimsDocument DocumentNavigation { get; set; }
+
+ [ForeignKey("DocumentQueueStatusTypeCode")]
+ [InverseProperty("PimsDocumentQueues")]
+ public virtual PimsDocumentQueueStatusType DocumentQueueStatusTypeCodeNavigation { get; set; }
+}
diff --git a/source/backend/entities/ef/PimsDocumentQueueHist.cs b/source/backend/entities/ef/PimsDocumentQueueHist.cs
new file mode 100644
index 0000000000..1320ff0aaf
--- /dev/null
+++ b/source/backend/entities/ef/PimsDocumentQueueHist.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+[Table("PIMS_DOCUMENT_QUEUE_HIST")]
+[Index("DocumentQueueHistId", "EndDateHist", Name = "PIMS_DOCQUE_H_UK", IsUnique = true)]
+public partial class PimsDocumentQueueHist
+{
+ [Key]
+ [Column("_DOCUMENT_QUEUE_HIST_ID")]
+ public long DocumentQueueHistId { 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("DOCUMENT_QUEUE_ID")]
+ public long DocumentQueueId { get; set; }
+
+ [Column("DOCUMENT_ID")]
+ public long? DocumentId { get; set; }
+
+ [Required]
+ [Column("DOCUMENT_QUEUE_STATUS_TYPE_CODE")]
+ [StringLength(20)]
+ public string DocumentQueueStatusTypeCode { get; set; }
+
+ [Required]
+ [Column("DATA_SOURCE_TYPE_CODE")]
+ [StringLength(20)]
+ public string DataSourceTypeCode { get; set; }
+
+ [Column("DOCUMENT_EXTERNAL_ID")]
+ [StringLength(1000)]
+ public string DocumentExternalId { get; set; }
+
+ [Column("DOC_PROCESS_START_DT", TypeName = "datetime")]
+ public DateTime? DocProcessStartDt { get; set; }
+
+ [Column("DOC_PROCESS_END_DT", TypeName = "datetime")]
+ public DateTime? DocProcessEndDt { get; set; }
+
+ [Column("DOC_PROCESS_RETRIES")]
+ public int? DocProcessRetries { get; set; }
+
+ [Column("MAYAN_ERROR")]
+ [StringLength(4000)]
+ public string MayanError { 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/PimsDocumentQueueStatusType.cs b/source/backend/entities/ef/PimsDocumentQueueStatusType.cs
new file mode 100644
index 0000000000..f413674147
--- /dev/null
+++ b/source/backend/entities/ef/PimsDocumentQueueStatusType.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+///
+/// Table describing the status of the document in the queue for MAYAN EDMS assimilation.
+///
+[Table("PIMS_DOCUMENT_QUEUE_STATUS_TYPE")]
+public partial class PimsDocumentQueueStatusType
+{
+ ///
+ /// Code value of the document queue status.
+ ///
+ [Key]
+ [Column("DOCUMENT_QUEUE_STATUS_TYPE_CODE")]
+ [StringLength(20)]
+ public string DocumentQueueStatusTypeCode { get; set; }
+
+ ///
+ /// Description of the document queue status.
+ ///
+ [Required]
+ [Column("DESCRIPTION")]
+ [StringLength(200)]
+ public string Description { get; set; }
+
+ ///
+ /// Indicates if the code value is still active or is now disabled.
+ ///
+ [Column("IS_DISABLED")]
+ public bool IsDisabled { get; set; }
+
+ ///
+ /// Order in which to display the code values, if required.
+ ///
+ [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("DocumentQueueStatusTypeCodeNavigation")]
+ public virtual ICollection PimsDocumentQueues { get; set; } = new List();
+}
diff --git a/source/backend/entities/ef/PimsDocumentTyp.cs b/source/backend/entities/ef/PimsDocumentTyp.cs
index f0a9297bd1..57e4f33d5a 100644
--- a/source/backend/entities/ef/PimsDocumentTyp.cs
+++ b/source/backend/entities/ef/PimsDocumentTyp.cs
@@ -38,6 +38,13 @@ public partial class PimsDocumentTyp
[StringLength(200)]
public string DocumentTypeDescription { get; set; }
+ ///
+ /// Describes the purpose of the document.
+ ///
+ [Column("DOCUMENT_TYPE_DEFINITION")]
+ [StringLength(500)]
+ public string DocumentTypeDefinition { get; set; }
+
///
/// Indicates if the code is still in use.
///
diff --git a/source/backend/entities/ef/PimsDocumentTypHist.cs b/source/backend/entities/ef/PimsDocumentTypHist.cs
index 0584a830d4..74955953d6 100644
--- a/source/backend/entities/ef/PimsDocumentTypHist.cs
+++ b/source/backend/entities/ef/PimsDocumentTypHist.cs
@@ -36,6 +36,10 @@ public partial class PimsDocumentTypHist
[StringLength(200)]
public string DocumentTypeDescription { get; set; }
+ [Column("DOCUMENT_TYPE_DEFINITION")]
+ [StringLength(500)]
+ public string DocumentTypeDefinition { get; set; }
+
[Column("IS_DISABLED")]
public bool IsDisabled { get; set; }
diff --git a/source/backend/entities/ef/PimsLeaseConsultation.cs b/source/backend/entities/ef/PimsLeaseConsultation.cs
index fbf1ebe80b..8f2abaa7bc 100644
--- a/source/backend/entities/ef/PimsLeaseConsultation.cs
+++ b/source/backend/entities/ef/PimsLeaseConsultation.cs
@@ -7,6 +7,7 @@
namespace Pims.Dal.Entities;
[Table("PIMS_LEASE_CONSULTATION")]
+[Index("ConsultationOutcomeTypeCode", Name = "LESCON_CONSULTATION_OUTCOME_TYPE_CODE_IDX")]
[Index("ConsultationStatusTypeCode", Name = "LESCON_CONSULTATION_STATUS_TYPE_CODE_IDX")]
[Index("ConsultationTypeCode", Name = "LESCON_CONSULTATION_TYPE_CODE_IDX")]
[Index("LeaseId", Name = "LESCON_LEASE_ID_IDX")]
@@ -62,6 +63,14 @@ public partial class PimsLeaseConsultation
[StringLength(20)]
public string ConsultationStatusTypeCode { get; set; }
+ ///
+ /// Foreign key to the PIMS_CONSULTATION_OUTCOME_TYPE table.
+ ///
+ [Required]
+ [Column("CONSULTATION_OUTCOME_TYPE_CODE")]
+ [StringLength(20)]
+ public string ConsultationOutcomeTypeCode { get; set; }
+
///
/// Description for the approval / consultation when "Other" consultation type is selected.
///
@@ -189,6 +198,10 @@ public partial class PimsLeaseConsultation
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+ [ForeignKey("ConsultationOutcomeTypeCode")]
+ [InverseProperty("PimsLeaseConsultations")]
+ public virtual PimsConsultationOutcomeType ConsultationOutcomeTypeCodeNavigation { get; set; }
+
[ForeignKey("ConsultationStatusTypeCode")]
[InverseProperty("PimsLeaseConsultations")]
public virtual PimsConsultationStatusType ConsultationStatusTypeCodeNavigation { get; set; }
diff --git a/source/backend/entities/ef/PimsLeaseConsultationHist.cs b/source/backend/entities/ef/PimsLeaseConsultationHist.cs
index 8e7b217888..41fdefa880 100644
--- a/source/backend/entities/ef/PimsLeaseConsultationHist.cs
+++ b/source/backend/entities/ef/PimsLeaseConsultationHist.cs
@@ -45,6 +45,11 @@ public partial class PimsLeaseConsultationHist
[StringLength(20)]
public string ConsultationStatusTypeCode { get; set; }
+ [Required]
+ [Column("CONSULTATION_OUTCOME_TYPE_CODE")]
+ [StringLength(20)]
+ public string ConsultationOutcomeTypeCode { get; set; }
+
[Column("OTHER_DESCRIPTION")]
[StringLength(2000)]
public string OtherDescription { get; set; }
diff --git a/source/backend/entities/ef/PimsPropertyActivity.cs b/source/backend/entities/ef/PimsPropertyActivity.cs
index 64421d5aa8..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(500)]
public string Description { get; set; }
///
diff --git a/source/backend/entities/ef/PimsPropertyActivityHist.cs b/source/backend/entities/ef/PimsPropertyActivityHist.cs
index 967f6fa822..1044bef873 100644
--- a/source/backend/entities/ef/PimsPropertyActivityHist.cs
+++ b/source/backend/entities/ef/PimsPropertyActivityHist.cs
@@ -50,10 +50,6 @@ public partial class PimsPropertyActivityHist
[Column("COMPLETION_DT")]
public DateOnly? CompletionDt { get; set; }
- [Column("DESCRIPTION")]
- [StringLength(500)]
- public string Description { get; set; }
-
[Column("REQUEST_SOURCE")]
[StringLength(2000)]
public string RequestSource { get; set; }
@@ -111,4 +107,8 @@ public partial class PimsPropertyActivityHist
[Column("DB_LAST_UPDATE_USERID")]
[StringLength(30)]
public string DbLastUpdateUserid { get; set; }
+
+ [Column("DESCRIPTION")]
+ [StringLength(4000)]
+ public string Description { get; set; }
}
diff --git a/source/backend/entities/ef/PimsPropertyBoundaryLiteVw.cs b/source/backend/entities/ef/PimsPropertyBoundaryLiteVw.cs
new file mode 100644
index 0000000000..f19e8dc411
--- /dev/null
+++ b/source/backend/entities/ef/PimsPropertyBoundaryLiteVw.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+using NetTopologySuite.Geometries;
+
+namespace Pims.Dal.Entities;
+
+[Keyless]
+public partial class PimsPropertyBoundaryLiteVw
+{
+ [Column("PROPERTY_ID")]
+ public long PropertyId { get; set; }
+
+ [Column("GEOMETRY", TypeName = "geometry")]
+ public Geometry Geometry { get; set; }
+
+ [Column("IS_OWNED")]
+ public bool IsOwned { get; set; }
+
+ [Column("IS_RETIRED")]
+ public bool? IsRetired { get; set; }
+
+ [Column("IS_OTHER_INTEREST")]
+ public bool? IsOtherInterest { get; set; }
+
+ [Column("IS_DISPOSED")]
+ public bool? IsDisposed { get; set; }
+
+ [Column("HAS_ACTIVE_ACQUISITION_FILE")]
+ public bool? HasActiveAcquisitionFile { get; set; }
+
+ [Column("HAS_ACTIVE_RESEARCH_FILE")]
+ public bool? HasActiveResearchFile { get; set; }
+}
diff --git a/source/backend/entities/ef/PimsPropertyLocationLiteVw.cs b/source/backend/entities/ef/PimsPropertyLocationLiteVw.cs
new file mode 100644
index 0000000000..0e2186c007
--- /dev/null
+++ b/source/backend/entities/ef/PimsPropertyLocationLiteVw.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+using NetTopologySuite.Geometries;
+
+namespace Pims.Dal.Entities;
+
+[Keyless]
+public partial class PimsPropertyLocationLiteVw
+{
+ [Column("PROPERTY_ID")]
+ public long PropertyId { get; set; }
+
+ [Column("GEOMETRY", TypeName = "geometry")]
+ public Geometry Geometry { get; set; }
+
+ [Column("IS_OWNED")]
+ public bool IsOwned { get; set; }
+
+ [Column("IS_RETIRED")]
+ public bool? IsRetired { get; set; }
+
+ [Column("IS_OTHER_INTEREST")]
+ public bool? IsOtherInterest { get; set; }
+
+ [Column("IS_DISPOSED")]
+ public bool? IsDisposed { get; set; }
+
+ [Column("HAS_ACTIVE_ACQUISITION_FILE")]
+ public bool? HasActiveAcquisitionFile { get; set; }
+
+ [Column("HAS_ACTIVE_RESEARCH_FILE")]
+ public bool? HasActiveResearchFile { get; set; }
+}
diff --git a/source/backend/entities/ef/PimsResearchFileNote.cs b/source/backend/entities/ef/PimsResearchFileNote.cs
index 58947c7cb2..9bab82edfd 100644
--- a/source/backend/entities/ef/PimsResearchFileNote.cs
+++ b/source/backend/entities/ef/PimsResearchFileNote.cs
@@ -9,7 +9,6 @@ namespace Pims.Dal.Entities;
///
/// Defines the relationship betwwen a research file and a note.
///
-[PrimaryKey("ResearchFileNoteId", "ResearchFileId")]
[Table("PIMS_RESEARCH_FILE_NOTE")]
[Index("NoteId", Name = "RFLNOT_NOTE_ID_IDX")]
[Index("ResearchFileId", Name = "RFLNOT_RESEARCH_FILE_ID_IDX")]
@@ -20,7 +19,6 @@ public partial class PimsResearchFileNote
[Column("RESEARCH_FILE_NOTE_ID")]
public long ResearchFileNoteId { get; set; }
- [Key]
[Column("RESEARCH_FILE_ID")]
public long ResearchFileId { get; set; }
diff --git a/source/backend/entities/ef/PimsSubfileInterestType.cs b/source/backend/entities/ef/PimsSubfileInterestType.cs
new file mode 100644
index 0000000000..377ca704f8
--- /dev/null
+++ b/source/backend/entities/ef/PimsSubfileInterestType.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+
+namespace Pims.Dal.Entities;
+
+///
+/// Codified values for the subfile interest type.
+///
+[Table("PIMS_SUBFILE_INTEREST_TYPE")]
+public partial class PimsSubfileInterestType
+{
+ ///
+ /// Code value of the subfile interest type.
+ ///
+ [Key]
+ [Column("SUBFILE_INTEREST_TYPE_CODE")]
+ [StringLength(20)]
+ public string SubfileInterestTypeCode { get; set; }
+
+ ///
+ /// Description of the subfile interest type.
+ ///
+ [Required]
+ [Column("DESCRIPTION")]
+ [StringLength(200)]
+ public string Description { get; set; }
+
+ ///
+ /// Indicates if the code value is inactive.
+ ///
+ [Column("IS_DISABLED")]
+ public bool IsDisabled { get; set; }
+
+ ///
+ /// Designates a preferred presentation order of the code 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("SubfileInterestTypeCodeNavigation")]
+ public virtual ICollection PimsAcquisitionFiles { get; set; } = new List();
+}
diff --git a/source/backend/tests/core/Entities/LeaseConsultationHelper.cs b/source/backend/tests/core/Entities/LeaseConsultationHelper.cs
new file mode 100644
index 0000000000..c6550b4767
--- /dev/null
+++ b/source/backend/tests/core/Entities/LeaseConsultationHelper.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Linq;
+using Pims.Dal;
+using Pims.Dal.Entities;
+using Entity = Pims.Dal.Entities;
+
+namespace Pims.Core.Test
+{
+ ///
+ /// EntityHelper static class, provides helper methods to create test entities.
+ ///
+ public static partial class EntityHelper
+ {
+ ///
+ /// Create a new instance of a lease consultation.
+ ///
+ ///
+ public static Entity.PimsLeaseConsultation CreateLeaseConsultationItem(long? leaseConsultationId = null, long? leaseId = null, long? personId = null, long? organizationId = null, PimsConsultationType type = null, PimsConsultationStatusType statusType = null, PimsConsultationOutcomeType outcomeType = null)
+ {
+ var consultationItem = new Entity.PimsLeaseConsultation()
+ {
+ Internal_Id = leaseConsultationId ?? 1,
+ LeaseId = leaseId ?? 1,
+ PersonId = personId,
+ OrganizationId = organizationId,
+ IsResponseReceived = false,
+ RequestedOn = DateTime.UtcNow,
+ ResponseReceivedDate = DateTime.UtcNow,
+ };
+ consultationItem.ConsultationOutcomeTypeCodeNavigation = outcomeType ?? new Entity.PimsConsultationOutcomeType() { Id = "APPRDENIED", Description = "Denied", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now };
+ consultationItem.ConsultationOutcomeTypeCode = consultationItem.ConsultationOutcomeTypeCodeNavigation.Id;
+ consultationItem.ConsultationStatusTypeCodeNavigation = statusType ?? new Entity.PimsConsultationStatusType() { Id = "REQCOMP", Description = "Required", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now };
+ consultationItem.ConsultationStatusTypeCode = consultationItem.ConsultationStatusTypeCodeNavigation.Id;
+ consultationItem.ConsultationTypeCodeNavigation = type ?? new Entity.PimsConsultationType() { Id = "ACTIVE", Description = "Active", DbCreateUserid = "test", DbLastUpdateUserid = "test", DbLastUpdateTimestamp = System.DateTime.Now };
+ consultationItem.ConsultationTypeCode = consultationItem.ConsultationTypeCodeNavigation.Id;
+
+ return consultationItem;
+ }
+
+ ///
+ /// Create a new instance of a lease consultation.
+ ///
+ ///
+ public static Entity.PimsLeaseConsultation CreateLeaseConsultationItem(this PimsContext context, long? leaseId = null, long? leaseConsultationId = null)
+ {
+ var statusType = context.PimsConsultationStatusTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find consultation status type.");
+ var itemType = context.PimsConsultationTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find consultation type.");
+ var outcomeType = context.PimsConsultationOutcomeTypes.FirstOrDefault() ?? throw new InvalidOperationException("Unable to find consultation outcome type.");
+ var consultation = EntityHelper.CreateLeaseConsultationItem(leaseId: leaseId, leaseConsultationId: leaseConsultationId, statusType: statusType, type: itemType, outcomeType: outcomeType);
+ context.PimsLeaseConsultations.Add(consultation);
+
+ return consultation;
+ }
+ }
+}
diff --git a/source/backend/tests/unit/api/Controllers/Document/DocumentControllerTest.cs b/source/backend/tests/unit/api/Controllers/Document/DocumentControllerTest.cs
index 5d557f6df8..d784fded03 100644
--- a/source/backend/tests/unit/api/Controllers/Document/DocumentControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/Document/DocumentControllerTest.cs
@@ -56,28 +56,28 @@ public void GetDocumentTypes_Success()
}
[Fact]
- public void UpdateDocumentMetadata_Success()
+ public void UpdateDocument_Success()
{
// Arrange
var updateRequest = new DocumentUpdateRequest() { DocumentId = 1 };
this._service.Setup(m => m.UpdateDocumentAsync(updateRequest)).ReturnsAsync(new DocumentUpdateResponse());
// Act
- var result = this._controller.UpdateDocumentMetadata(1, updateRequest);
+ var result = this._controller.UpdateDocument(1, updateRequest);
// Assert
this._service.Verify(m => m.UpdateDocumentAsync(updateRequest), Times.Once());
}
[Fact]
- public void UpdateDocumentMetadata_InvalidDocumentId()
+ public void UpdateDocument_InvalidDocumentId()
{
// Arrange
var updateRequest = new DocumentUpdateRequest() { DocumentId = 2 };
this._service.Setup(m => m.UpdateDocumentAsync(updateRequest)).ReturnsAsync(new DocumentUpdateResponse());
// Act
- Func act = async () => await this._controller.UpdateDocumentMetadata(1, updateRequest);
+ Func act = async () => await this._controller.UpdateDocument(1, updateRequest);
// Assert
act.Should().ThrowAsync();
diff --git a/source/backend/tests/unit/api/Controllers/Leases/ConsultationControllerTest.cs b/source/backend/tests/unit/api/Controllers/Leases/ConsultationControllerTest.cs
new file mode 100644
index 0000000000..b4c772c6ff
--- /dev/null
+++ b/source/backend/tests/unit/api/Controllers/Leases/ConsultationControllerTest.cs
@@ -0,0 +1,204 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using FluentAssertions;
+using MapsterMapper;
+using Microsoft.AspNetCore.Mvc;
+using Moq;
+using Pims.Api.Areas.Disposition.Controllers;
+using Pims.Api.Areas.Lease.Controllers;
+using Pims.Api.Helpers.Exceptions;
+using Pims.Api.Models.Concepts.DispositionFile;
+using Pims.Api.Models.Concepts.Lease;
+using Pims.Api.Services;
+using Pims.Core.Test;
+using Pims.Dal.Entities;
+using Pims.Dal.Exceptions;
+using Pims.Dal.Security;
+using Xunit;
+
+namespace Pims.Api.Test.Controllers
+{
+ [Trait("category", "unit")]
+ [Trait("category", "api")]
+ [Trait("group", "consultation")]
+ [ExcludeFromCodeCoverage]
+ public class ConsultationControllerTest
+ {
+ #region Variables
+ private Mock _service;
+ private ConsultationController _controller;
+ private IMapper _mapper;
+ #endregion
+
+ public ConsultationControllerTest()
+ {
+ var helper = new TestHelper();
+ this._controller = helper.CreateController(Permissions.LeaseEdit, Permissions.LeaseView);
+ this._mapper = helper.GetService();
+ this._service = helper.GetService>();
+ }
+
+ #region Tests
+ [Fact]
+ public void GetByConsultationId()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1 };
+
+ this._service.Setup(m => m.GetConsultationById(It.IsAny())).Returns(consultation);
+
+ // Act
+ var result = this._controller.GetLeaseConsultationById(1, 1);
+
+ // Assert
+ this._service.Verify(m => m.GetConsultationById(It.IsAny()), Times.Once());
+ }
+
+ [Fact]
+ public void GetByConsultationId_BadLeaseId()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation();
+
+ this._service.Setup(m => m.GetConsultationById(It.IsAny())).Returns(consultation);
+
+ // Act
+ Action act = () => this._controller.GetLeaseConsultationById(1, 1);
+ act.Should().Throw();
+ }
+
+ [Fact]
+ public void GetLeaseConsultations()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1 };
+
+ this._service.Setup(m => m.GetConsultations(It.IsAny())).Returns(new List() { consultation });
+
+ // Act
+ var result = this._controller.GetLeaseConsultations(1);
+
+ // Assert
+ this._service.Verify(m => m.GetConsultations(It.IsAny()), Times.Once());
+ }
+
+ [Fact]
+ public void AddLeaseConsultation()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1 };
+
+ this._service.Setup(m => m.AddConsultation(It.IsAny())).Returns(consultation);
+
+ // Act
+ var result = this._controller.AddLeaseConsultation(1, _mapper.Map(consultation));
+
+ // Assert
+ this._service.Verify(m => m.AddConsultation(It.IsAny()), Times.Once());
+ }
+
+ [Fact]
+ public void AddLeaseConsultation_BadLeaseId()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1 };
+
+ this._service.Setup(m => m.AddConsultation(It.IsAny())).Returns(consultation);
+
+ // Act
+ Action act = () => this._controller.AddLeaseConsultation(2, _mapper.Map(consultation));
+ act.Should().Throw();
+ }
+
+ [Fact]
+ public void UpdateLeaseConsultation()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1, LeaseConsultationId = 1 };
+
+ this._service.Setup(m => m.UpdateConsultation(It.IsAny())).Returns(consultation);
+
+ // Act
+ var result = this._controller.UpdateLeaseConsultation(1, 1, _mapper.Map(consultation));
+
+ // Assert
+ this._service.Verify(m => m.UpdateConsultation(It.IsAny()), Times.Once());
+ }
+
+ [Fact]
+ public void UpdateLeaseConsultation_BadLeaseId()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1, LeaseConsultationId = 1 };
+
+ this._service.Setup(m => m.UpdateConsultation(It.IsAny())).Returns(consultation);
+
+ // Act
+ Action act = () => this._controller.UpdateLeaseConsultation(2, 1, _mapper.Map(consultation));
+ act.Should().Throw().WithMessage("Invalid LeaseId.");
+ }
+
+ [Fact]
+ public void UpdateLeaseConsultation_BadConsultationId()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1, LeaseConsultationId = 1 };
+
+ this._service.Setup(m => m.UpdateConsultation(It.IsAny())).Returns(consultation);
+
+ // Act
+ Action act = () => this._controller.UpdateLeaseConsultation(1, 2, _mapper.Map(consultation));
+ act.Should().Throw().WithMessage("Invalid consultationId.");
+ }
+
+ [Fact]
+ public void DeleteLeaseConsultation()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1, LeaseConsultationId = 1 };
+
+ this._service.Setup(m => m.GetConsultationById(It.IsAny())).Returns(consultation);
+ this._service.Setup(m => m.DeleteConsultation(It.IsAny())).Returns(true);
+
+ // Act
+ var result = this._controller.DeleteLeaseConsultation(1, 1);
+
+ // Assert
+ this._service.Verify(m => m.DeleteConsultation(It.IsAny()), Times.Once());
+ result.Should().BeEquivalentTo(new JsonResult(true));
+ }
+
+ [Fact]
+ public void DeleteLeaseConsultation_False()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 1, LeaseConsultationId = 1 };
+
+ this._service.Setup(m => m.GetConsultationById(It.IsAny())).Returns(consultation);
+ this._service.Setup(m => m.DeleteConsultation(It.IsAny())).Returns(false);
+
+ // Act
+ var result = this._controller.DeleteLeaseConsultation(1, 1);
+
+ // Assert
+ result.Should().BeEquivalentTo(new JsonResult(false));
+ }
+
+ [Fact]
+ public void DeleteLeaseConsultation_BadLeaseId()
+ {
+ // Arrange
+ var consultation = new PimsLeaseConsultation() { LeaseId = 2, LeaseConsultationId = 1 };
+
+ this._service.Setup(m => m.GetConsultationById(It.IsAny())).Returns(consultation);
+ this._service.Setup(m => m.DeleteConsultation(It.IsAny())).Returns(true);
+
+ // Act
+ Action act = () => this._controller.DeleteLeaseConsultation(1, 1);
+ act.Should().Throw().WithMessage("Invalid lease id for the given consultation.");
+ }
+
+ #endregion
+ }
+}
diff --git a/source/backend/tests/unit/api/Controllers/LookupControllerTest.cs b/source/backend/tests/unit/api/Controllers/LookupControllerTest.cs
index 9cffe3d776..ee98d5066f 100644
--- a/source/backend/tests/unit/api/Controllers/LookupControllerTest.cs
+++ b/source/backend/tests/unit/api/Controllers/LookupControllerTest.cs
@@ -40,26 +40,6 @@ public LookupControllerTest()
#region Tests
- [Fact]
- public void GetRoleCodes()
- {
- // Arrange
- var role = new Entity.PimsRole
- {
- Id = 1,
- RoleUid = Guid.NewGuid(),
- Name = "Ministry of Health",
- Description = "The Ministry of Health",
- };
- this._repository.Setup(m => m.GetAllRoles()).Returns(new[] { role });
-
- // Act
- var result = this._controller.GetRoles();
-
- // Assert
- this._repository.Verify(m => m.GetAllRoles(), Times.Once());
- }
-
[Fact]
public void GetAll()
{
diff --git a/source/backend/tests/unit/api/Models/CompensationFinancialReportModelTest.cs b/source/backend/tests/unit/api/Models/CompensationFinancialReportModelTest.cs
index c3cef0a3a8..135236785b 100644
--- a/source/backend/tests/unit/api/Models/CompensationFinancialReportModelTest.cs
+++ b/source/backend/tests/unit/api/Models/CompensationFinancialReportModelTest.cs
@@ -89,7 +89,7 @@ public void CompensationFinancialReportModel_FileNumberAndName()
var model = new CompensationFinancialReportModel(testFinancial, new CompensationFinancialReportTotalsModel(new List()), new System.Security.Claims.ClaimsPrincipal());
// Assert
- model.AcquisitionNumberAndName.Should().Be("9999 - test");
+ model.FileNumberAndName.Should().Be("9999 - test");
}
[Fact]
@@ -101,6 +101,7 @@ public void CompensationFinancialReportModel_FileNumberAndName_Null()
CompensationRequisition = new PimsCompensationRequisition()
{
AcquisitionFile = null,
+ Lease = null,
},
};
@@ -108,7 +109,7 @@ public void CompensationFinancialReportModel_FileNumberAndName_Null()
var model = new CompensationFinancialReportModel(testFinancial, new CompensationFinancialReportTotalsModel(new List()), new System.Security.Claims.ClaimsPrincipal());
// Assert
- model.AcquisitionNumberAndName.Should().Be(string.Empty);
+ model.FileNumberAndName.Should().Be(string.Empty);
}
[Fact]
diff --git a/source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs b/source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs
index 42877a92cd..5063351fd2 100644
--- a/source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs
+++ b/source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs
@@ -614,6 +614,46 @@ public void Update_DraftsNotComplete_NoViolation()
act.Should().NotThrow();
}
+ [Fact]
+ public void Update_SubFile_Violation()
+ {
+ // Arrange
+ var service = this.CreateAcquisitionServiceWithPermissions(Permissions.AcquisitionFileEdit);
+
+ var acqFile = EntityHelper.CreateAcquisitionFile();
+ acqFile.AcquisitionFileStatusTypeCode = AcquisitionStatusTypes.ACTIVE.ToString();
+ acqFile.ProjectId = 1;
+ acqFile.ProductId = 1;
+
+ var repository = this._helper.GetService>();
+ repository.Setup(x => x.GetRowVersion(It.IsAny())).Returns(1);
+ repository.Setup(x => x.GetRegion(It.IsAny())).Returns((short)(acqFile.RegionCode));
+ repository.Setup(x => x.GetById(It.IsAny())).Returns(acqFile);
+
+ var userRepository = this._helper.GetService>();
+ userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(EntityHelper.CreateUser("Test"));
+
+ var agreementRepository = this._helper.GetService>();
+ agreementRepository.Setup(x => x.GetAgreementsByAcquisitionFile(It.IsAny())).Returns(new List());
+
+ var compReqRepository = this._helper.GetService>();
+ compReqRepository.Setup(x => x.GetAllByAcquisitionFileId(It.IsAny())).Returns(new List());
+
+ var solver = this._helper.GetService>();
+ solver.Setup(x => x.CanEditDetails(It.IsAny())).Returns(true);
+
+ // Act
+ var pimsAcquisitionUpdate = EntityHelper.CreateAcquisitionFile(acqFile.AcquisitionFileId, acqFile.FileName);
+ pimsAcquisitionUpdate.ProjectId = 99;
+ pimsAcquisitionUpdate.ProductId = 88;
+ Action act = () => service.Update(pimsAcquisitionUpdate, new List());
+
+ // Assert
+ var ex = act.Should().Throw();
+ ex.Which.UserOverride.Should().Be(UserOverrideCode.UpdateSubFilesProjectProduct);
+ repository.Verify(x => x.Update(It.IsAny()), Times.Never);
+ }
+
[Fact]
public void Update_Success_Region_UserOverride()
{
@@ -649,6 +689,47 @@ public void Update_Success_Region_UserOverride()
repository.Verify(x => x.Update(It.IsAny()), Times.Once);
}
+ [Fact]
+ public void Update_Success_SubFile_UserOverride()
+ {
+ // Arrange
+ var service = this.CreateAcquisitionServiceWithPermissions(Permissions.AcquisitionFileEdit);
+
+ var acqFile = EntityHelper.CreateAcquisitionFile();
+ acqFile.AcquisitionFileStatusTypeCode = AcquisitionStatusTypes.ACTIVE.ToString();
+ acqFile.ProjectId = 1;
+ acqFile.ProductId = 1;
+
+ var repository = this._helper.GetService>();
+ repository.Setup(x => x.GetRowVersion(It.IsAny())).Returns(1);
+ repository.Setup(x => x.GetRegion(It.IsAny())).Returns((short)(acqFile.RegionCode));
+ repository.Setup(x => x.GetById(It.IsAny())).Returns(acqFile);
+
+ var lookupRepository = this._helper.GetService>();
+ lookupRepository.Setup(x => x.GetAllRegions()).Returns(new List() { new PimsRegion() { Code = 4, RegionName = "Cannot determine" } });
+
+ var userRepository = this._helper.GetService>();
+ userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(EntityHelper.CreateUser("Test"));
+
+ var agreementRepository = this._helper.GetService>();
+ agreementRepository.Setup(x => x.GetAgreementsByAcquisitionFile(It.IsAny())).Returns(new List());
+
+ var compReqRepository = this._helper.GetService>();
+ compReqRepository.Setup(x => x.GetAllByAcquisitionFileId(It.IsAny())).Returns(new List());
+
+ var solver = this._helper.GetService>();
+ solver.Setup(x => x.CanEditDetails(It.IsAny())).Returns(true);
+
+ // Act
+ var pimsAcquisitionUpdate = EntityHelper.CreateAcquisitionFile(acqFile.AcquisitionFileId, acqFile.FileName);
+ pimsAcquisitionUpdate.ProjectId = 99;
+ pimsAcquisitionUpdate.ProductId = 88;
+ var result = service.Update(pimsAcquisitionUpdate, new List() { UserOverrideCode.UpdateSubFilesProjectProduct });
+
+ // Assert
+ repository.Verify(x => x.Update(It.IsAny()), Times.Once);
+ }
+
[Fact]
public void Update_Success_AddsNote()
{
@@ -2862,6 +2943,66 @@ public void GetAcquisitionFileExport_Success_FlatProperties()
#endregion
+ #region SubFiles
+
+ [Fact]
+ public void GetSubFiles_NoPermissions()
+ {
+ // Arrange
+ var service = this.CreateAcquisitionServiceWithPermissions();
+
+ // Act
+ Action act = () => service.GetAcquisitionSubFiles(1);
+
+ // Assert
+ act.Should().Throw();
+ }
+
+ [Fact]
+ public void GetSubFiles_NotAuthorized_Contractor()
+ {
+ // Arrange
+ var service = this.CreateAcquisitionServiceWithPermissions(Permissions.AcquisitionFileView);
+
+ var userRepository = this._helper.GetService>();
+ var contractorUser = EntityHelper.CreateUser(1, Guid.NewGuid(), username: "Test", isContractor: true);
+ userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(contractorUser);
+
+ var acqFileRepository = this._helper.GetService>();
+ acqFileRepository.Setup(x => x.GetById(It.IsAny())).Returns(EntityHelper.CreateAcquisitionFile());
+
+ // Act
+ Action act = () => service.GetAcquisitionSubFiles(1);
+
+ // Assert
+ act.Should().Throw();
+ }
+
+ [Fact]
+ public void GetSubFiles_Fail_FileIsSubFile()
+ {
+ // Arrange
+ var service = this.CreateAcquisitionServiceWithPermissions(Permissions.AcquisitionFileView);
+
+ var userRepository = this._helper.GetService>();
+ var contractorUser = EntityHelper.CreateUser(1, Guid.NewGuid(), username: "Test", isContractor: false);
+ userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(contractorUser);
+
+ var mockCurrentAcquisitionFile = EntityHelper.CreateAcquisitionFile();
+ mockCurrentAcquisitionFile.PrntAcquisitionFileId = 200;
+
+ var acqFileRepository = this._helper.GetService>();
+ acqFileRepository.Setup(x => x.GetById(It.IsAny())).Returns(mockCurrentAcquisitionFile);
+
+ // Act
+ Action act = () => service.GetAcquisitionSubFiles(1);
+
+ // Assert
+ act.Should().Throw().WithMessage("Acquisition file should not be a sub-file.");
+ }
+
+ #endregion
+
#endregion
}
}
diff --git a/source/backend/tests/unit/api/Services/CompReqFinancialServiceTest.cs b/source/backend/tests/unit/api/Services/CompReqFinancialServiceTest.cs
index d7f8cfd341..206c4556ad 100644
--- a/source/backend/tests/unit/api/Services/CompReqFinancialServiceTest.cs
+++ b/source/backend/tests/unit/api/Services/CompReqFinancialServiceTest.cs
@@ -76,13 +76,19 @@ public void SearchCompensationRequisitionFinancials_Unauthorized()
public void SearchCompensationRequisitionFinancials_Success()
{
// Arrange
- var service = this.CreateWithPermissions(Permissions.CompensationRequisitionView, Permissions.AcquisitionFileView, Permissions.ProjectView);
+ var service = this.CreateWithPermissions(Permissions.CompensationRequisitionView, Permissions.AcquisitionFileView, Permissions.ProjectView, Permissions.LeaseView);
+
+ // Compensation requisitions can be associated to Acquisition Files or Leases
+ var acquisitionFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { AcquisitionFile = new PimsAcquisitionFile { RegionCode = 1 } } };
+ var leaseFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { Lease = new PimsLease { RegionCode = 2 } } };
+
var repo = this._helper.GetService>();
- repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny())).Returns(new List());
+ repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new List() { acquisitionFinancial, leaseFinancial });
- var contractorUser = EntityHelper.CreateUser(1, Guid.NewGuid(), username: "Test", isContractor: true);
+ var user = EntityHelper.CreateUser(1, Guid.NewGuid(), username: "Test", isContractor: false);
+ user.PimsRegionUsers = new List { new PimsRegionUser { RegionCode = 1 }, new PimsRegionUser { RegionCode = 2 } };
var userRepository = this._helper.GetService>();
- userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(contractorUser);
+ userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(user);
var filter = new AcquisitionReportFilterModel();
@@ -90,7 +96,7 @@ public void SearchCompensationRequisitionFinancials_Success()
var financials = service.SearchCompensationRequisitionFinancials(filter);
// Assert
- financials.Should().BeEmpty();
+ financials.Should().HaveCount(2);
}
[Fact]
@@ -102,7 +108,7 @@ public void SearchCompensationRequisitionFinancials_Region_Success()
var matchingFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { AcquisitionFile = new PimsAcquisitionFile { RegionCode = 1 } } };
var nonMatchingFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { AcquisitionFile = new PimsAcquisitionFile { RegionCode = 2 } } };
var repo = this._helper.GetService>();
- repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny())).Returns(new List { matchingFinancial, nonMatchingFinancial });
+ repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new List { matchingFinancial, nonMatchingFinancial });
var user = EntityHelper.CreateUser(1, Guid.NewGuid(), username: "Test", isContractor: false);
user.PimsRegionUsers = new List { new PimsRegionUser { RegionCode = 1 } };
@@ -119,6 +125,34 @@ public void SearchCompensationRequisitionFinancials_Region_Success()
financials.FirstOrDefault().CompensationRequisition.AcquisitionFile.RegionCode.Should().Be(1);
}
+ [Fact]
+ public void SearchCompensationRequisitionFinancials_Region_Leases_Success()
+ {
+ // Arrange
+ var service = this.CreateWithPermissions(Permissions.CompensationRequisitionView, Permissions.AcquisitionFileView, Permissions.ProjectView);
+
+ var matchingFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { Lease = new PimsLease { RegionCode = 1 } } };
+ var nonMatchingFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { Lease = new PimsLease { RegionCode = 2 } } };
+ var noRegionLeaseFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { Lease = new PimsLease { RegionCode = null } } }; // Region is OPTIONAL for leases and can be NULL
+
+ var repo = this._helper.GetService>();
+ repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new List { noRegionLeaseFinancial, matchingFinancial, nonMatchingFinancial });
+
+ var user = EntityHelper.CreateUser(1, Guid.NewGuid(), username: "Test", isContractor: false);
+ user.PimsRegionUsers = new List { new PimsRegionUser { RegionCode = 1 } };
+ var userRepository = this._helper.GetService>();
+ userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(user);
+
+ var filter = new AcquisitionReportFilterModel();
+
+ // Act
+ var financials = service.SearchCompensationRequisitionFinancials(filter);
+
+ // Assert - for Leases without region, export them regardless of the users' region. Otherwise filter lease data by the user’s region.
+ financials.Should().HaveCount(2);
+ financials.FirstOrDefault().CompensationRequisition.Lease.RegionCode.Should().BeNull();
+ }
+
[Fact]
public void SearchCompensationRequisitionFinancials_Contractor_Filter()
{
@@ -139,7 +173,7 @@ public void SearchCompensationRequisitionFinancials_Contractor_Filter()
};
var nonMatchingFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { AcquisitionFile = new PimsAcquisitionFile { } } };
var repo = this._helper.GetService>();
- repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny())).Returns(new List { matchingFinancial, nonMatchingFinancial });
+ repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new List { matchingFinancial, nonMatchingFinancial });
contractorUser.PimsRegionUsers = new List { new PimsRegionUser { RegionCode = 1 } };
var userRepository = this._helper.GetService>();
@@ -155,6 +189,38 @@ public void SearchCompensationRequisitionFinancials_Contractor_Filter()
financials.FirstOrDefault().CompensationRequisition.AcquisitionFile.PimsAcquisitionFileTeams.FirstOrDefault().PersonId.Should().Be(contractorUser.PersonId);
}
+ [Theory]
+ [InlineData(new Permissions[] { Permissions.AcquisitionFileView }, 1)]
+ [InlineData(new Permissions[] { Permissions.LeaseView }, 1)]
+ [InlineData(new Permissions[] { Permissions.AcquisitionFileView, Permissions.LeaseView }, 2)]
+ public void SearchCompensationRequisitionFinancials_Returns_FileTypes_Based_On_UserPermissions(Permissions[] permissions, int expected)
+ {
+ // Arrange
+ Permissions[] basePermissions = { Permissions.CompensationRequisitionView, Permissions.ProjectView };
+ var service = this.CreateWithPermissions(basePermissions.Concat(permissions).ToArray());
+
+ // Compensation requisitions can be associated to Acquisition Files or Leases
+ var acquisitionFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { AcquisitionFile = new PimsAcquisitionFile { RegionCode = 1 } } };
+ var leaseFinancial = new PimsCompReqFinancial { CompensationRequisition = new PimsCompensationRequisition { Lease = new PimsLease { RegionCode = 2 } } };
+
+ var repo = this._helper.GetService>();
+ repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny(), true, false)).Returns(new List() { acquisitionFinancial });
+ repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny(), false, true)).Returns(new List() { leaseFinancial });
+ repo.Setup(x => x.SearchCompensationRequisitionFinancials(It.IsAny(), true, true)).Returns(new List() { acquisitionFinancial, leaseFinancial });
+
+ var user = EntityHelper.CreateUser(1, Guid.NewGuid(), username: "Test", isContractor: false);
+ user.PimsRegionUsers = new List { new PimsRegionUser { RegionCode = 1 }, new PimsRegionUser { RegionCode = 2 } };
+ var userRepository = this._helper.GetService>();
+ userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(user);
+
+ var filter = new AcquisitionReportFilterModel();
+
+ // Act
+ var financials = service.SearchCompensationRequisitionFinancials(filter);
+
+ // Assert
+ financials.Should().HaveCount(expected);
+ }
private CompReqFinancialService CreateWithPermissions(params Permissions[] permissions)
{
var user = PrincipalHelper.CreateForPermission(permissions);
diff --git a/source/backend/tests/unit/api/Services/DocumentServiceTest.cs b/source/backend/tests/unit/api/Services/DocumentServiceTest.cs
index d0934c482e..b21695aea4 100644
--- a/source/backend/tests/unit/api/Services/DocumentServiceTest.cs
+++ b/source/backend/tests/unit/api/Services/DocumentServiceTest.cs
@@ -413,7 +413,6 @@ public async void UpdateDocumentAsync_ShouldThrowException_Metadata_Delete_Suces
documentStorageRepository.Setup(x => x.TryDeleteDocumentMetadataAsync(It.IsAny(), It.IsAny()))
.ReturnsAsync(new ExternalResponse()
{
-
HttpStatusCode = System.Net.HttpStatusCode.OK,
Status = ExternalResponseStatus.Success,
Message = "Ok",
@@ -442,6 +441,85 @@ public async void UpdateDocumentAsync_ShouldThrowException_Metadata_Delete_Suces
documentStorageRepository.Verify(x => x.TryDeleteDocumentMetadataAsync(It.IsAny(), It.IsAny