diff --git a/.github/workflows/api-dotnetcore.yml b/.github/workflows/api-dotnetcore.yml
index d28e8f2dc9..5224a81b4d 100644
--- a/.github/workflows/api-dotnetcore.yml
+++ b/.github/workflows/api-dotnetcore.yml
@@ -1,4 +1,4 @@
-name: API (.NET 6)
+name: API (.NET 8)
on:
push:
@@ -39,10 +39,10 @@ jobs:
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch
- - name: Setup .NET 6
+ - name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
- dotnet-version: "6.0.x"
+ dotnet-version: "8.0.x"
- name: Install dependencies
run: dotnet restore
@@ -120,7 +120,7 @@ jobs:
# Specify whether or not CI build should fail if Codecov runs into an error during upload
fail_ci_if_error: true
- - name: SonarScanner for .NET 6 with pull request decoration support
+ - name: SonarScanner for .NET 8 with pull request decoration support
id: scan
uses: highbyte/sonarscan-dotnet@v2.1.2
if: ${{ github.event_name == 'push' }}
diff --git a/.github/workflows/ci-cd-pims-dev.yml b/.github/workflows/ci-cd-pims-dev.yml
index c42a1d2bde..17baf742df 100644
--- a/.github/workflows/ci-cd-pims-dev.yml
+++ b/.github/workflows/ci-cd-pims-dev.yml
@@ -133,10 +133,10 @@ jobs:
- name: Checkout Source Code
uses: actions/checkout@v3
- - name: Setup .NET 6
- uses: actions/setup-dotnet@v2
+ - name: Setup .NET 8
+ uses: actions/setup-dotnet@v3
with:
- dotnet-version: "6.0.x"
+ dotnet-version: "8.0.x"
- name: Install dependencies for keycloak sync
run: dotnet restore
@@ -150,6 +150,30 @@ jobs:
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:
+ name: sync mayan
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-dev
+ - name: call scripts to sync mayan
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-dev-only-4700 -p MAYAN_SYNC_URL=https://pims-app-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan/metadatatype -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/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)
+
+
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
diff --git a/.github/workflows/depoy-prod-start.yml b/.github/workflows/depoy-prod-start.yml
index 9ed633005f..0ef2cb883d 100644
--- a/.github/workflows/depoy-prod-start.yml
+++ b/.github/workflows/depoy-prod-start.yml
@@ -5,6 +5,10 @@ env:
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
OPENSHIFT_TOOLS_NAMESPACE: "3cd915-tools"
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
DESTINATION: "prod"
@@ -70,3 +74,74 @@ jobs:
[[ -z ${{github.event.inputs.OVERRIDE_VERSION}} ]] && RELEASE_VERSION=${{steps.previoustag.outputs.tag}}-master || RELEASE_VERSION=${{github.event.inputs.OVERRIDE_VERSION}}-master
RELEASE_TAG=$RELEASE_VERSION ./openshift/4.0/player.sh deploy api $DESTINATION -apply
RELEASE_TAG=$RELEASE_VERSION ./openshift/4.0/player.sh deploy app $DESTINATION -apply
+
+ # the command:
+ # 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
+ # 2) greps the generated name from the previous step.
+ # 3) waits for the job to complete using the generated name.
+ database-upgrade:
+ name: Upgrade database
+ needs: [deploy]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-prod
+ - name: call scripts to upgrade database
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database -p GIT_BRANCH=master -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_PRD -p NAMESPACE=3cd915-prod | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
+
+ ## 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
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-prod
+ - name: call scripts to sync mayan
+ shell: bash
+ run: |
+ 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/metadatatype -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/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
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+
+ - 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}}
\ No newline at end of file
diff --git a/.github/workflows/keycloak-sync.yml b/.github/workflows/keycloak-sync.yml
new file mode 100644
index 0000000000..757ad3e6db
--- /dev/null
+++ b/.github/workflows/keycloak-sync.yml
@@ -0,0 +1,36 @@
+name: Keycloak Sync
+env:
+ OPENSHIFT_TOOLS_NAMESPACE: "3cd915-tools"
+ 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"
+
+on:
+ workflow_dispatch:
+
+jobs:
+ sync-keycloak:
+ name: Sync Keycloak
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+
+ - 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}}
diff --git a/.github/workflows/mayan-sync.yml b/.github/workflows/mayan-sync.yml
new file mode 100644
index 0000000000..c80691e2a5
--- /dev/null
+++ b/.github/workflows/mayan-sync.yml
@@ -0,0 +1,51 @@
+name: Mayan Sync
+env:
+ OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
+ # service account: gitaction
+ OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
+ OPENSHIFT_TOOLS_NAMESPACE: "3cd915-dev"
+ MS_TEAMS_WEBHOOK_BUILD_CHANNEL: ${{ secrets.MS_TEAMS_WEBHOOK_URI_BUILD_CHANNEL }}
+ AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET }}
+ ASPNETCORE_ENVIRONMENT: "Development"
+
+ ## variables for scripts under git\openshift\4.0\scripts\oc-*.sh
+ APP_PORT: 8080
+ DESTINATION: "dev"
+ OC_JOB_NAME: "dev"
+ GIT_URL: "${{github.server_url}}/${{github.repository}}"
+ GIT_BRANCH: "${{github.ref}}"
+ APP_NAME: "pims"
+ PROJ_PREFIX: "3cd915"
+ PROJ_TOOLS: "3cd915-tools"
+ PROJ_DEV: "dev"
+ PROJ_TEST: "test"
+ PROJ_PROD: "prod"
+ TAG_DEV: "dev"
+ TAG_TEST: "test"
+ TAG_PROD: "prod"
+
+on:
+ workflow_dispatch:
+
+## 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.
+jobs:
+ mayan-sync:
+ name: mayan-sync
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-dev
+ - name: call scripts to sync mayan
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-dev-only-4700 -p MAYAN_SYNC_URL=https://pims-app-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan/metadatatype -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/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)
diff --git a/.github/workflows/retag-dev-to-test.yml b/.github/workflows/retag-dev-to-test.yml
index 8da2e51f9b..690a7b8e52 100644
--- a/.github/workflows/retag-dev-to-test.yml
+++ b/.github/workflows/retag-dev-to-test.yml
@@ -96,10 +96,10 @@ jobs:
- name: Checkout Source Code
uses: actions/checkout@v3
- - name: Setup .NET 6
- uses: actions/setup-dotnet@v2
+ - name: Setup .NET 8
+ uses: actions/setup-dotnet@v3
with:
- dotnet-version: "6.0.x"
+ dotnet-version: "8.0.x"
- name: Install dependencies for keycloak sync
run: dotnet restore
@@ -112,7 +112,29 @@ jobs:
- 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:
+ name: sync mayan
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-dev
+ - name: call scripts to sync mayan
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan/metadatatype -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
+ oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/documenttype -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
+ oc process -f ./openshift/4.0/templates/jobs/mayan-sync.yaml -p NAMESPACE=3cd915-dev -p TOKEN_URL=https://dev.loginproxy.gov.bc.ca:443/auth/realms/standard/protocol/openid-connect/token -p CLIENT_ID=property-services-project-api-4380 -p MAYAN_SYNC_URL=https://pims-app-test-3cd915-dev.apps.silver.devops.gov.bc.ca:443/api/documents/sync/mayan -p KEYCLOAK_SECRET_NAME=pims-api-sso-test | oc create -f - | grep -oP "(?<=\/)[^\s]*" | (read TASK_NAME; oc wait --for=condition=succeeded taskruns/$TASK_NAME --timeout=80s)
+
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
diff --git a/.github/workflows/retag-test-to-uat.yml b/.github/workflows/retag-test-to-uat.yml
index f6ad08669a..45a8bf0695 100644
--- a/.github/workflows/retag-test-to-uat.yml
+++ b/.github/workflows/retag-test-to-uat.yml
@@ -8,6 +8,7 @@ env:
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
APP_PORT: 8080
@@ -86,10 +87,59 @@ 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.
+ mayan-sync:
+ name: sync mayan
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-test
+ - name: call scripts to sync mayan
+ shell: bash
+ run: |
+ 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/metadatatype -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/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
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+
+ - 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}}
+
ci-cd-end-notification:
name: CI-CD End Notification to Teams Channel
runs-on: ubuntu-latest
- needs: database-upgrade
+ needs: [sync-keycloak, mayan-sync]
+ if: always()
steps:
- name: check workflow status
uses: martialonline/workflow-status@v4
diff --git a/.github/workflows/uat_hotfix.yml b/.github/workflows/uat_hotfix.yml
new file mode 100644
index 0000000000..d9e82f9ca8
--- /dev/null
+++ b/.github/workflows/uat_hotfix.yml
@@ -0,0 +1,190 @@
+name: UAT Hotfix
+env:
+ OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
+ # service account: gitaction
+ OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
+ OPENSHIFT_TOOLS_NAMESPACE: "3cd915-tools"
+ 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
+ APP_PORT: 8080
+ DESTINATION: "uat"
+ OC_JOB_NAME: "test"
+ GIT_URL: "${{github.server_url}}/${{github.repository}}"
+ GIT_BRANCH: "test"
+ APP_NAME: "pims"
+ PROJ_PREFIX: "3cd915"
+ PROJ_TOOLS: "3cd915-tools"
+ PROJ_DEV: "dev"
+ PROJ_TEST: "test"
+ PROJ_PROD: "prod"
+ TAG_DEV: "dev"
+ TAG_TEST: "test"
+ TAG_PROD: "prod"
+ INSTANCE: "-uat"
+ NAMESPACE_OVERRIDE: "3cd915-test"
+
+on:
+ workflow_dispatch:
+
+jobs:
+ ci-cd-start-notification:
+ name: CI-CD Start Notification to Teams Channel
+ runs-on: ubuntu-latest
+ steps:
+ - name: Start notification to Teams Channel
+ uses: dragos-cojocari/ms-teams-notification@v1.0.2
+ with:
+ github-token: ${{ github.token }}
+ ms-teams-webhook-uri: ${{ env.MS_TEAMS_WEBHOOK_BUILD_CHANNEL }}
+ notification-summary: PIMS UAT Hotfix started.
+ notification-color: 17a2b8
+ timezone: America/Los_Angeles
+
+ build-frontend:
+ name: Build frontend
+ needs: ci-cd-start-notification
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
+ - name: Call script to build frontend (pims-app and pims-app-base)
+ run: |
+ ./openshift/4.0/player.sh build app-base -apply
+ ./openshift/4.0/player.sh build app -apply
+
+ build-api:
+ name: Build api
+ needs: ci-cd-start-notification
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
+ - name: Call script to build backend (pims-api)
+ run: |
+ ./openshift/4.0/player.sh build api -apply
+
+ deploy:
+ name: Deploy frontend and api to OpenShift
+ needs: [build-frontend, build-api]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
+ - name: call scripts to deploy api and frontend
+ run: |
+ ./openshift/4.0/player.sh deploy api $DESTINATION -apply
+ ./openshift/4.0/player.sh deploy app $DESTINATION -apply
+
+ # the command:
+ # 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
+ # 2) greps the generated name from the previous step.
+ # 3) waits for the job to complete using the generated name.
+ database-upgrade:
+ name: Upgrade database
+ needs: [deploy]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-test
+ - name: call scripts to upgrade database
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-uat -p GIT_BRANCH=test -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_UAT -p NAMESPACE=3cd915-test | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
+
+## 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
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-test
+ - name: call scripts to sync mayan
+ shell: bash
+ run: |
+ 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/metadatatype -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/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
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+
+ - 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}}
+
+ ci-cd-end-notification:
+ if: always()
+ name: CI-CD End Notification to Teams Channel
+ runs-on: ubuntu-latest
+ needs: [mayan-sync, sync-keycloak]
+ steps:
+ - name: check workflow status
+ uses: martialonline/workflow-status@v4
+ id: check
+ - name: End notification to Teams Channel
+ uses: dragos-cojocari/ms-teams-notification@v1.0.2
+ with:
+ github-token: ${{ github.token }}
+ ms-teams-webhook-uri: ${{ env.MS_TEAMS_WEBHOOK_BUILD_CHANNEL }}
+ notification-summary: PIMS UAT Hotfix complete with status ${{ steps.check.outputs.status }}
+ notification-color: 17a2b8
+ timezone: America/Los_Angeles
diff --git a/.github/workflows/uat_pre_release_hotfix.yml b/.github/workflows/uat_pre_release_hotfix.yml
new file mode 100644
index 0000000000..6e5ba86564
--- /dev/null
+++ b/.github/workflows/uat_pre_release_hotfix.yml
@@ -0,0 +1,237 @@
+name: UAT Pre-Release Hotfix
+env:
+ OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
+ # service account: gitaction
+ OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
+ OPENSHIFT_TOOLS_NAMESPACE: "3cd915-tools"
+ 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
+ APP_PORT: 8080
+ DESTINATION: "uat"
+ OC_JOB_NAME: "test"
+ GIT_URL: "${{github.server_url}}/${{github.repository}}"
+ GIT_BRANCH: "test"
+ APP_NAME: "pims"
+ PROJ_PREFIX: "3cd915"
+ PROJ_TOOLS: "3cd915-tools"
+ PROJ_DEV: "dev"
+ PROJ_TEST: "test"
+ PROJ_PROD: "prod"
+ TAG_DEV: "dev"
+ TAG_TEST: "test"
+ TAG_PROD: "prod"
+ INSTANCE: "-uat"
+ NAMESPACE_OVERRIDE: "3cd915-test"
+
+on:
+ workflow_dispatch:
+ inputs:
+ HOTFIX_BRANCH:
+ description: "Enter the name of the branch containing the hotfix"
+ required: true
+
+jobs:
+ ci-cd-start-notification:
+ name: CI-CD Start Notification to Teams Channel
+ runs-on: ubuntu-latest
+ steps:
+ - name: Start notification to Teams Channel
+ uses: dragos-cojocari/ms-teams-notification@v1.0.2
+ with:
+ github-token: ${{ github.token }}
+ ms-teams-webhook-uri: ${{ env.MS_TEAMS_WEBHOOK_BUILD_CHANNEL }}
+ notification-summary: PIMS UAT Pre-Release Hotfix started.
+ notification-color: 17a2b8
+ timezone: America/Los_Angeles
+
+ create-builds:
+ name: create builds
+ needs: ci-cd-start-notification
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-tools
+ - name: create all PSP build configurations for branch
+ shell: bash
+ run: |
+ oc process -f ./openshift/s2i/nginx-runtime/nginx-runtime.yaml -p GIT_REF=${{github.event.inputs.HOTFIX_BRANCH}} -p OUTPUT_IMAGE_TAG="latest-${{github.event.inputs.HOTFIX_BRANCH}}" | oc create --selector ci_cd=true -f -
+ oc process -f ./openshift/4.0/templates/api/build.yaml -p GIT_REF=${{github.event.inputs.HOTFIX_BRANCH}} -p OUTPUT_IMAGE_TAG="latest-${{github.event.inputs.HOTFIX_BRANCH}}" | oc create --selector ci_cd=true -f -
+ oc process -f ./openshift/4.0/templates/app/build.yaml -p GIT_REF=${{github.event.inputs.HOTFIX_BRANCH}} -p OUTPUT_IMAGE_TAG="latest-${{github.event.inputs.HOTFIX_BRANCH}}" -p RUNTIMEIMAGE_TAG="latest-${{github.event.inputs.HOTFIX_BRANCH}}" | oc create --selector ci_cd=true -f -
+
+ build-frontend:
+ name: Build frontend
+ needs: create-builds
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
+ - name: Call script to build frontend (pims-app and pims-app-base)
+ run: |
+ OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} && export OVERRIDE_APP_NAME=true && ./openshift/4.0/player.sh build nginx-runtime -apply
+ OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} && unset OVERRIDE_APP_NAME && ./openshift/4.0/player.sh build app-base -apply
+ OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} && ./openshift/4.0/player.sh build app -apply
+
+ build-api:
+ name: Build api
+ needs: create-builds
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
+ - name: Call script to build backend (pims-api)
+ run: |
+ OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} && ./openshift/4.0/player.sh build api -apply
+
+ deploy:
+ name: Deploy frontend and api to OpenShift
+ needs: [build-frontend, build-api]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
+ - name: call scripts to deploy api and frontend
+ run: |
+ OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} &&./openshift/4.0/player.sh deploy api $DESTINATION -apply
+ OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} &&./openshift/4.0/player.sh deploy app $DESTINATION -apply
+
+ # the command:
+ # 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
+ # 2) greps the generated name from the previous step.
+ # 3) waits for the job to complete using the generated name.
+ database-upgrade:
+ name: Upgrade database
+ needs: [deploy]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-test
+ - name: call scripts to upgrade database
+ shell: bash
+ run: |
+ oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-uat -p GIT_BRANCH=${{github.event.inputs.HOTFIX_BRANCH}} -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.
+ mayan-sync:
+ name: sync mayan
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-test
+ - name: call scripts to sync mayan
+ shell: bash
+ run: |
+ 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/metadatatype -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/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
+ needs: database-upgrade
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+
+ - 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}}
+
+ ci-cd-end-notification:
+ if: always()
+ name: CI-CD End Notification to Teams Channel
+ runs-on: ubuntu-latest
+ needs: [mayan-sync, sync-keycloak]
+ steps:
+ - name: check workflow status
+ uses: martialonline/workflow-status@v4
+ id: check
+ - name: End notification to Teams Channel
+ uses: dragos-cojocari/ms-teams-notification@v1.0.2
+ with:
+ github-token: ${{ github.token }}
+ ms-teams-webhook-uri: ${{ env.MS_TEAMS_WEBHOOK_BUILD_CHANNEL }}
+ notification-summary: PIMS UAT Pre-Release Hotfix complete with status ${{ steps.check.outputs.status }}
+ notification-color: 17a2b8
+ timezone: America/Los_Angeles
+
+ cleanup-builds:
+ if: always()
+ name: cleanup builds
+ needs: ci-cd-end-notification
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Source Code
+ uses: actions/checkout@v3
+ - name: Login to OpenShift
+ uses: redhat-actions/oc-login@v1
+ with:
+ openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
+ openshift_token: ${{ env.OPENSHIFT_TOKEN }}
+ insecure_skip_tls_verify: true
+ namespace: 3cd915-tools
+ - name: create all PSP build configurations for branch
+ shell: bash
+ run: |
+ oc delete bc --selector ci_cd=true
diff --git a/docker-compose.yml b/docker-compose.yml
index d56ead7f18..574db82761 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -97,7 +97,7 @@ services:
####################### Networks Definition #######################
networks:
psp:
- name: psp-net
+ name: psp
driver: bridge
####################### Volumes Definition #######################
diff --git a/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/LIS_DISPOSITION_PIMS_LOAD.dtsx b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/LIS_DISPOSITION_PIMS_LOAD.dtsx
new file mode 100644
index 0000000000..09d0f45591
--- /dev/null
+++ b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/LIS_DISPOSITION_PIMS_LOAD.dtsx
@@ -0,0 +1,11189 @@
+
+
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [etl].[ETL_ERROR_LOG]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [etl].[ETL_ERROR_LOG]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ INSERT INTO PIMS_DISPOSITION_FILE (
+
+ DISPOSITION_STATUS_TYPE_CODE,
+ DISPOSITION_FILE_STATUS_TYPE_CODE,
+ DISPOSITION_TYPE_CODE,
+ DISPOSITION_FUNDING_TYPE_CODE,
+ DISPOSITION_INITIATING_DOC_TYPE_CODE,
+ DSP_PHYS_FILE_STATUS_TYPE_CODE,
+ DSP_INITIATING_BRANCH_TYPE_CODE,
+ REGION_CODE,
+ FILE_NUMBER,
+ FILE_NAME,
+ FILE_REFERENCE,
+ OTHER_DISPOSITION_TYPE,
+ OTHER_INITIATING_DOC_TYPE,
+ ASSIGNED_DT,
+ COMPLETED_DT,
+ INITIATING_DOCUMENT_DT,
+ APP_CREATE_USERID,
+ APP_LAST_UPDATE_USERID
+)
+VALUES (
+
+ ?, -- DISPOSITION_STATUS_TYPE_CODE
+ ?, -- DISPOSITION_FILE_STATUS_TYPE_CODE
+ ?, -- DISPOSITION_TYPE_CODE
+ ?, -- DISPOSITION_FUNDING_TYPE_CODE
+ ?, -- DISPOSITION_INITIATING_DOC_TYPE_CODE
+ ?, -- DSP_PHYS_FILE_STATUS_TYPE_CODE
+ ?, -- DSP_INITIATING_BRANCH_TYPE_CODE
+ ?, -- REGION_CODE
+ NEXT VALUE FOR dbo.PIMS_DISPOSITION_FILE_NO_SEQ, -- FILE_NUMBER using the sequence
+ ?, -- FILE_NAME
+ ?, -- FILE_REFERENCE
+ ?, -- OTHER_DISPOSITION_TYPE
+ ?, -- OTHER_INITIATING_DOC_TYPE
+ ?, -- ASSIGNED_DT
+ ?, -- COMPLETED_DT
+ ?, -- INITIATING_DOCUMENT_DT
+ ?, -- APP_CREATE_USERID
+ ? -- APP_LAST_UPDATE_USERID
+);
+
+ 1252
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 17
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT FILE_REFERENCE, APP_CREATE_USERID FROM
+dbo.PIMS_DISPOSITION_FILE
+ select * from (SELECT FILE_REFERENCE, APP_CREATE_USERID FROM
+dbo.PIMS_DISPOSITION_FILE) [refTable]
+where [refTable].[FILE_REFERENCE] = ? and [refTable].[APP_CREATE_USERID] = ?
+ 0
+ 0
+ 1
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="FILE_REFERENCE" dataType="DT_WSTR" length="200" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_CREATE_USERID" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\1_PIMS_DISPOSITION_FILE_LOAD\Data Conversion.Outputs[Data Conversion Output].Columns[Copy of FILE_REFERENCE]};#{Package\1_PIMS_DISPOSITION_FILE_LOAD\Data Conversion.Outputs[Data Conversion Output].Columns[APP_CREATE_USERID]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ FILE_REFERENCE
+
+
+
+
+
+ APP_CREATE_USERID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ with x as
+(
+SELECT DISTINCT
+CASE
+ WHEN fs.Marketing_Status = 'S' THEN 'SOLD'
+ WHEN fs.Marketing_Status = 'T' THEN 'SOLD'
+ WHEN fs.Marketing_Status = 'H' THEN 'ONHOLD'
+ WHEN fs.Marketing_Status = 'P' THEN 'LISTED'
+ WHEN fs.Marketing_Status = 'A' THEN 'LISTED'
+ WHEN fs.Marketing_Status = 'U' THEN 'LISTED'
+ ELSE 'LISTED'
+ END AS DISPOSITION_STATUS_TYPE_CODE, -- 1 (Q) (FK)
+CASE
+ WHEN fs.Marketing_Status = 'S' THEN 'COMPLETE'
+ WHEN fs.Marketing_Status = 'T' THEN 'COMPLETE'
+ WHEN fs.Marketing_Status = 'H' THEN 'HOLD'
+ ELSE 'ACTIVE'
+ END AS DISPOSITION_FILE_STATUS_TYPE_CODE, -- 2 (Q) (FK)
+case
+ when m.Marketing_Responsibility ='Road Closures' then 'CLOSURE'
+ --when m.Marketing_Responsibility IS NULL THEN NULL
+ --when m.Marketing_Responsibility = '' THEN NULL
+ else 'OTHER' end as DISPOSITION_TYPE_CODE, -- 3 (Q) (FK)
+NULL as DISPOSITION_FUNDING_TYPE_CODE, -- 4 (Q) (FK)
+NULL as DISPOSITION_INITIATING_DOC_TYPE_CODE, -- 5 (Q) (FK)
+NULL as DSP_PHYS_FILE_STATUS_TYPE_CODE, -- 6 (Q) (FK)
+NULL as DSP_INITIATING_BRANCH_TYPE_CODE, -- 7 (Q) (FK)
+CASE
+ WHEN CAST(LEFT(fm.MoTH_Region_Cd, 1) AS int) = 1 THEN 1
+ WHEN CAST(LEFT(fm.MoTH_Region_Cd, 1) AS int) = 6 THEN 1
+ WHEN CAST(LEFT(fm.MoTH_Region_Cd, 1) AS int) = 2 THEN 2
+ WHEN CAST(LEFT(fm.MoTH_Region_Cd, 1) AS int) = 2 THEN 3
+ WHEN CAST(LEFT(fm.MoTH_Region_Cd, 1) AS int) = 4 THEN 3
+ ELSE 4
+ END AS REGION_CODE, -- 8 (Q)
+--REPLACE(STR(fm.TFA_File_Number,4),SPACE(1),'0') AS FILE_NUMBER, -- 9 (Q)
+'LEGACY_LIS-'+ CONVERT(nvarchar(50), fs.FileSubLookup_Id) +'-'+CONVERT(nvarchar(50), fs.PID)+'-'+CONVERT(nvarchar(50), fs.Subfile_Sequence_Code) +'-'+CONVERT(nvarchar(50), fm.TFA_File_Number) AS [FILE_NAME], -- 10
+CONCAT(REPLACE(STR(fm.TFA_File_Number,4),SPACE(1),'0') ,'-',REPLACE(STR(fs.Subfile_Sequence_Code,3),SPACE(1),'0')) as FILE_REFERENCE, -- 11
+case
+ when m.Marketing_Responsibility = 'LMB' then 'OTHER-LMB'
+ when m.Marketing_Responsibility = 'LWBC' then 'OTHER-LWBC'
+ else NULL
+ end AS OTHER_DISPOSITION_TYPE, -- 12 (Q)
+NULL AS OTHER_INITIATING_DOC_TYPE, -- 13 (Q)
+convert(date, m.BCAL_Sent_Date) as ASSIGNED_DT, -- 14
+convert(date, m.Sale_Date) as COMPLETED_DT, -- 15
+NULL AS INITIATING_DOCUMENT_DT -- 16 (Q)
+FROM
+ t_fileSub fs join t_fileSubLookup fsl on fsl.FileSubLookup_Id = fs.FileSubLookup_Id
+ join t_fileMain fm on fm.FileMain_SKey = fsl.FileMain_SKey
+ left join t_marketing m on m.FileSubLookup_Id =fs.FileSubLookup_Id
+
+)
+select * FROM x WHERE (FILE_REFERENCE IS NOT NULL AND [FILE_NAME] IS NOT NULL AND FILE_REFERENCE<> '0000-000')
+AND DISPOSITION_TYPE_CODE IS NOT NULL
+ORDER BY FILE_REFERENCE
+;
+
+ 1252
+ false
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ UPDATE [dbo].[PIMS_DISPOSITION_FILE]
+SET
+ [DISPOSITION_STATUS_TYPE_CODE] = ?,
+ [DISPOSITION_FILE_STATUS_TYPE_CODE] =?,
+ [DISPOSITION_TYPE_CODE] =?,
+ [DISPOSITION_FUNDING_TYPE_CODE] =?,
+ [DISPOSITION_INITIATING_DOC_TYPE_CODE] =?,
+ [DSP_PHYS_FILE_STATUS_TYPE_CODE] =?,
+ [DSP_INITIATING_BRANCH_TYPE_CODE] =?,
+ [REGION_CODE] =?,
+ [FILE_NAME] =?,
+ [OTHER_DISPOSITION_TYPE] =?,
+ [OTHER_INITIATING_DOC_TYPE] =?,
+ [ASSIGNED_DT] =?,
+ [COMPLETED_DT] =?,
+ [INITIATING_DOCUMENT_DT] =?,
+ [CONCURRENCY_CONTROL_NUMBER] = CONCURRENCY_CONTROL_NUMBER + 1,
+ [APP_LAST_UPDATE_TIMESTAMP] = GETUTCDATE()
+ WHERE
+ [APP_LAST_UPDATE_USERID] = ? AND
+ [FILE_REFERENCE] =?
+ 1252
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ 1
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 17
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 1
+
+
+
+
+ 65
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [etl].[ETL_ERROR_LOG]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [etl].[ETL_ERROR_LOG]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [dbo].[PIMS_DISPOSITION_SALE]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS,FIRE_TRIGGERS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT [FILE_REFERENCE], [DISPOSITION_FILE_ID] FROM [PIMS_DISPOSITION_FILE]
+ select * from (SELECT [FILE_REFERENCE], [DISPOSITION_FILE_ID] FROM [PIMS_DISPOSITION_FILE]) [refTable]
+where [refTable].[FILE_REFERENCE] = ?
+ 0
+ 0
+ 0
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="FILE_REFERENCE" dataType="DT_WSTR" length="200" precision="0" scale="0" codePage="0"/><referenceColumn name="DISPOSITION_FILE_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\2_PIMS_DISPOSITION_SALE_LOAD\Data Conversion1.Outputs[Data Conversion Output].Columns[FILE_REFERENCE]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ FILE_REFERENCE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT DISPOSITION_FILE_ID,APP_CREATE_USERID FROM [dbo].[PIMS_DISPOSITION_SALE]
+ select * from (SELECT DISPOSITION_FILE_ID,APP_CREATE_USERID FROM [dbo].[PIMS_DISPOSITION_SALE]) [refTable]
+where [refTable].[APP_CREATE_USERID] = ? and [refTable].[DISPOSITION_FILE_ID] = ?
+ 0
+ 0
+ 1
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="DISPOSITION_FILE_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_CREATE_USERID" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\2_PIMS_DISPOSITION_SALE_LOAD\Data Conversion1.Outputs[Data Conversion Output].Columns[APP_CREATE_USERID]};#{Package\2_PIMS_DISPOSITION_SALE_LOAD\Data Conversion2.Outputs[Data Conversion Output].Columns[DISPOSITION_FILE_ID]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ DISPOSITION_FILE_ID
+
+
+
+
+
+ APP_CREATE_USERID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ with y as
+(
+SELECT DISTINCT
+ CONCAT(REPLACE(STR(fm.TFA_File_Number,4),SPACE(1),'0') ,'-',REPLACE(STR(fs.Subfile_Sequence_Code,3),SPACE(1),'0')) as FILE_REFERENCE, -- USE THIE FIELD FOR LOOK UP IN PIMS_DISPOSITION_FILE table
+ m.LastConditional_removal_Date as FINAL_CONDITION_REMOVAL_DT,
+ m.Sale_Date as SALE_COMPLETION_DT,
+ CASE
+ WHEN MONTH (m.Sale_Date) >=4 THEN YEAR(m.Sale_Date)+1
+ ELSE YEAR(m.Sale_Date)
+ END AS SALE_FISCAL_YEAR,
+ m.Sale_Price as SALE_FINAL_AMT,
+ NULL AS REALTOR_COMMISSION_AMT,
+ '0' as IS_GST_REQUIRED,
+ NULL AS GST_COLLECTED_AMT,
+ fs.Book_Value as NET_BOOK_AMT,
+ se.Actual_Amount AS TOTAL_COST_AMT, --
+ NULL AS SPP_AMT,
+ NULL AS REMEDIATION_AMT
+
+FROM
+ t_fileSub fs join t_fileSubLookup fsl on fsl.FileSubLookup_Id = fs.FileSubLookup_Id
+ join t_fileMain fm on fm.FileMain_SKey = fsl.FileMain_SKey
+ left join t_marketing m on m.FileSubLookup_Id =fs.FileSubLookup_Id
+ inner JOIN t_saleExpenses se on se.FileSubLookup_Id =fs.FileSubLookup_Id
+)
+
+select FILE_REFERENCE,FINAL_CONDITION_REMOVAL_DT,SALE_COMPLETION_DT,SALE_FISCAL_YEAR,SALE_FINAL_AMT, REALTOR_COMMISSION_AMT, IS_GST_REQUIRED,GST_COLLECTED_AMT,NET_BOOK_AMT,
+--TOTAL_COST_AMT,
+SUM(TOTAL_COST_AMT) AS TOTAL_COST_AMT,
+SPP_AMT,REMEDIATION_AMT
+FROM y where FILE_REFERENCE IS NOT NULL AND FILE_REFERENCE<> '0000-000'
+GROUP BY FILE_REFERENCE,FINAL_CONDITION_REMOVAL_DT,SALE_COMPLETION_DT,SALE_FISCAL_YEAR,SALE_FINAL_AMT, REALTOR_COMMISSION_AMT, IS_GST_REQUIRED,GST_COLLECTED_AMT,NET_BOOK_AMT, SPP_AMT,REMEDIATION_AMT
+ORDER BY FILE_REFERENCE
+
+
+ ;
+
+ 1252
+ false
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ UPDATE [dbo].[PIMS_DISPOSITION_SALE]
+SET
+ [FINAL_CONDITION_REMOVAL_DT] = ?,
+ [SALE_COMPLETION_DT] = ?,
+ [SALE_FISCAL_YEAR] = ?,
+ [SALE_FINAL_AMT] = ?,
+ [REALTOR_COMMISSION_AMT] = ?,
+ [IS_GST_REQUIRED] = ?,
+ [GST_COLLECTED_AMT] = ?,
+ [NET_BOOK_AMT] = ?,
+ [TOTAL_COST_AMT] = ?,
+ [SPP_AMT] = ?,
+ [REMEDIATION_AMT] = ?,
+ [CONCURRENCY_CONTROL_NUMBER] = CONCURRENCY_CONTROL_NUMBER + 1,
+ [APP_LAST_UPDATE_TIMESTAMP] = GETUTCDATE()
+ WHERE
+ [APP_LAST_UPDATE_USERID] = ? AND
+ [DISPOSITION_FILE_ID] = ?
+ 1252
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 65
+
+
+
+
+ 65
+
+
+
+
+ 81
+
+
+
+
+ 81
+
+
+
+
+ 81
+
+
+
+
+ 1
+
+
+
+
+ 81
+
+
+
+
+ 81
+
+
+
+
+ 81
+
+
+
+
+ 81
+
+
+
+
+ 81
+
+
+
+
+ 1
+
+
+
+
+ 17
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [etl].[ETL_ERROR_LOG]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [etl].[ETL_ERROR_LOG]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [dbo].[PIMS_DISPOSITION_APPRAISAL]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS,FIRE_TRIGGERS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT [FILE_REFERENCE], [DISPOSITION_FILE_ID] FROM [PIMS_DISPOSITION_FILE]
+ select * from (SELECT [FILE_REFERENCE], [DISPOSITION_FILE_ID] FROM [PIMS_DISPOSITION_FILE]) [refTable]
+where [refTable].[FILE_REFERENCE] = ?
+ 0
+ 0
+ 0
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="FILE_REFERENCE" dataType="DT_WSTR" length="200" precision="0" scale="0" codePage="0"/><referenceColumn name="DISPOSITION_FILE_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\3_PIMS_DISPOSITION_APPRAISAL\Data Conversion.Outputs[Data Conversion Output].Columns[FILE_REFERENCE]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ FILE_REFERENCE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT DISPOSITION_FILE_ID,APP_CREATE_USERID FROM [dbo].[PIMS_DISPOSITION_APPRAISAL]
+ select * from (SELECT DISPOSITION_FILE_ID,APP_CREATE_USERID FROM [dbo].[PIMS_DISPOSITION_APPRAISAL]) [refTable]
+where [refTable].[APP_CREATE_USERID] = ? and [refTable].[DISPOSITION_FILE_ID] = ?
+ 0
+ 0
+ 1
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="DISPOSITION_FILE_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="APP_CREATE_USERID" dataType="DT_WSTR" length="30" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\3_PIMS_DISPOSITION_APPRAISAL\AUDIT TRAIL.Outputs[Derived Column Output].Columns[APP_CREATE_USERID]};#{Package\3_PIMS_DISPOSITION_APPRAISAL\Data Conversion 1.Outputs[Data Conversion Output].Columns[DISPOSITION_FILE_ID]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ DISPOSITION_FILE_ID
+
+
+
+
+
+ APP_CREATE_USERID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ with z as
+(
+SELECT
+ distinct
+ CONCAT(REPLACE(STR(fm.TFA_File_Number,4),SPACE(1),'0') ,'-',REPLACE(STR(fs.Subfile_Sequence_Code,3),SPACE(1),'0')) as FILE_REFERENCE,
+ m.Appraisal_Value as APPRAISED_AMT, -- APPRAISED_AMT
+ CONVERT(NVARCHAR,(CONVERT(DATE, LTRIM(RTRIM(m.Appraisal_Date))))) AS APPRAISAL_DT, -- APPRAISAL_DT
+ -- NULL AS BCA_VALUE_AMT,
+ bc.[Total_value] as BCA_VALUE_AMT, --
+ null as BCA_ROLL_YEAR,
+ m.List_Price as LIST_PRICE_AMT -- LIST_PRICE_AMT
+
+FROM
+ t_fileSub fs join t_fileSubLookup fsl on fsl.FileSubLookup_Id = fs.FileSubLookup_Id
+ join t_fileMain fm on fm.FileMain_SKey = fsl.FileMain_SKey
+ left join t_marketing m on m.FileSubLookup_Id =fs.FileSubLookup_Id
+ left join t_BCAssessment bc on bc.assessment_Id = fs.BCAssessment_Id
+)
+select * FROM z
+where (FILE_REFERENCE<> '-000' AND FILE_REFERENCE <> '0000-000') and LEN(FILE_REFERENCE) >= 8
+ ORDER BY FILE_REFERENCE
+;
+
+ 1252
+ false
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ UPDATE [dbo].[PIMS_DISPOSITION_APPRAISAL]
+SET
+ [APPRAISED_AMT] = ?,
+ [APPRAISAL_DT] = ?,
+ [BCA_VALUE_AMT] = ?,
+ [BCA_ROLL_YEAR] = ?,
+ [LIST_PRICE_AMT] = ?,
+ [CONCURRENCY_CONTROL_NUMBER] = [CONCURRENCY_CONTROL_NUMBER] + 1,
+ [APP_LAST_UPDATE_TIMESTAMP] = GETUTCDATE()
+WHERE
+ [APP_LAST_UPDATE_USERID] = ? AND
+ [DISPOSITION_FILE_ID] = ?;
+ 1252
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 81
+
+
+
+
+ 65
+
+
+
+
+ 81
+
+
+
+
+ 81
+
+
+
+
+ 81
+
+
+
+
+ 1
+
+
+
+
+ 17
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [etl].[ETL_ERROR_LOG]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ [dbo].[PIMS_DISPOSITION_FILE_PROPERTY]
+
+
+ 1252
+ false
+ 3
+ false
+ false
+ TABLOCK,CHECK_CONSTRAINTS,FIRE_TRIGGERS
+ 2147483647
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT [FILE_REFERENCE], [DISPOSITION_FILE_ID] FROM [PIMS_DISPOSITION_FILE];
+ select * from (SELECT [FILE_REFERENCE], [DISPOSITION_FILE_ID] FROM [PIMS_DISPOSITION_FILE];) [refTable]
+where [refTable].[FILE_REFERENCE] = ?
+ 0
+ 0
+ 0
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="FILE_REFERENCE" dataType="DT_WSTR" length="200" precision="0" scale="0" codePage="0"/><referenceColumn name="DISPOSITION_FILE_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\4_PIMS_DISPOSITION_FILE_PROPERTY\Data Conversion 2.Outputs[Data Conversion Output].Columns[FILE_REFERENCE]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ FILE_REFERENCE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select * from [dbo].[PIMS_DISPOSITION_FILE_PROPERTY]
+ select * from (select * from [dbo].[PIMS_DISPOSITION_FILE_PROPERTY]) [refTable]
+where [refTable].[PROPERTY_ID] = ? and [refTable].[DISPOSITION_FILE_ID] = ? and [refTable].[APP_CREATE_USERID] = ?
+ 0
+ 0
+ 1
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="DISPOSITION_FILE_PROPERTY_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="DISPOSITION_FILE_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="PROPERTY_ID" dataType="DT_I8" 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\4_PIMS_DISPOSITION_FILE_PROPERTY\Lookup PIMS_PROPERTY.Outputs[Lookup Match Output].Columns[PROPERTY_ID]};#{Package\4_PIMS_DISPOSITION_FILE_PROPERTY\Lookup PIMS_DISPOSITION_FILE.Outputs[Lookup Match Output].Columns[DISPOSITION_FILE_ID]};#{Package\4_PIMS_DISPOSITION_FILE_PROPERTY\AUDIT TRAIL.Outputs[Derived Column Output].Columns[APP_CREATE_USERID]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ DISPOSITION_FILE_ID
+
+
+
+
+
+ PROPERTY_ID
+
+
+
+
+
+ APP_CREATE_USERID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT PID, PROPERTY_ID FROM dbo.PIMS_PROPERTY
+ select * from (SELECT PID, PROPERTY_ID FROM dbo.PIMS_PROPERTY) [refTable]
+where [refTable].[PID] = ?
+ 0
+ 0
+ 0
+ 0
+ 25
+ 25
+ <referenceMetadata><referenceColumns><referenceColumn name="PID" dataType="DT_I4" length="0" precision="0" scale="0" codePage="0"/><referenceColumn name="PROPERTY_ID" dataType="DT_I8" length="0" precision="0" scale="0" codePage="0"/></referenceColumns></referenceMetadata>
+ #{Package\4_PIMS_DISPOSITION_FILE_PROPERTY\SOURCE LIS PID.Outputs[OLE DB Source Output].Columns[PID]};
+ 1252
+ false
+
+
+
+
+
+
+
+
+
+ PID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ with x as
+(
+SELECT DISTINCT fs.PID,
+
+case
+ when m.Marketing_Responsibility ='Road Closures' then 'CLOSURE'
+ --when m.Marketing_Responsibility IS NULL THEN NULL
+ --when m.Marketing_Responsibility = '' THEN NULL
+ else 'OTHER' end as DISPOSITION_TYPE_CODE,
+'LEGACY_LIS-'+ CONVERT(nvarchar(50), fs.FileSubLookup_Id) +'-'+CONVERT(nvarchar(50), fs.PID)+'-'+CONVERT(nvarchar(50), fs.Subfile_Sequence_Code) +'-'+CONVERT(nvarchar(50), fm.TFA_File_Number) AS [FILE_NAME],
+CONCAT(REPLACE(STR(fm.TFA_File_Number,4),SPACE(1),'0') ,'-',REPLACE(STR(fs.Subfile_Sequence_Code,3),SPACE(1),'0')) as FILE_REFERENCE
+FROM
+ t_fileSub fs join t_fileSubLookup fsl on fsl.FileSubLookup_Id = fs.FileSubLookup_Id
+ join t_fileMain fm on fm.FileMain_SKey = fsl.FileMain_SKey
+ left join t_marketing m on m.FileSubLookup_Id =fs.FileSubLookup_Id
+
+)
+select DISTINCT PID, LTRIM(RTRIM(FILE_REFERENCE)) AS FILE_REFERENCE FROM x WHERE (FILE_REFERENCE IS NOT NULL AND [FILE_NAME] IS NOT NULL AND FILE_REFERENCE<> '0000-000')
+AND DISPOSITION_TYPE_CODE IS NOT NULL
+ORDER BY FILE_REFERENCE
+
+;
+
+ 1252
+ false
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+ [dbo].[PIMS_DISPOSITION_FILE_PROPERTY]
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ OverwriteParamsSQLProp
+ false
+
+
+ UsedTableName
+
+
+
+ TableInfoObjectType
+ 0
+
+
+ DataSourceViewID
+
+
+
+
+
+
+ DataSourceViewID
+
+
+ TableInfoObjectType
+ Table
+
+
+
+]]>
+
\ No newline at end of file
diff --git a/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.dtproj b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.dtproj
new file mode 100644
index 0000000000..0614cc8808
--- /dev/null
+++ b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.dtproj
@@ -0,0 +1,386 @@
+
+
+ Project
+ 16.0.5270.0
+ 9.0.1.0
+ $base64$PFNvdXJjZUNvbnRyb2xJbmZvIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOmRkbDI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yIiB4bWxuczpkZGwyXzI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yLzIiIHhtbG5zOmRkbDEwMF8xMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDA4L2VuZ2luZS8xMDAvMTAwIiB4bWxuczpkZGwyMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAiIHhtbG5zOmRkbDIwMF8yMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAvMjAwIiB4bWxuczpkZGwzMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAiIHhtbG5zOmRkbDMwMF8zMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAvMzAwIiB4bWxuczpkZGw0MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAiIHhtbG5zOmRkbDQwMF80MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAvNDAwIiB4bWxuczpkZGw1MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAiIHhtbG5zOmRkbDUwMF81MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAvNTAwIiB4bWxuczpkd2Q9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vRGF0YVdhcmVob3VzZS9EZXNpZ25lci8xLjAiPg0KICA8RW5hYmxlZD5mYWxzZTwvRW5hYmxlZD4NCiAgPFByb2plY3ROYW1lPjwvUHJvamVjdE5hbWU+DQogIDxBdXhQYXRoPjwvQXV4UGF0aD4NCiAgPExvY2FsUGF0aD48L0xvY2FsUGF0aD4NCiAgPFByb3ZpZGVyPjwvUHJvdmlkZXI+DQo8L1NvdXJjZUNvbnRyb2xJbmZvPg==
+
+ MOTI_LEGACY_LIS_DISPOSITION_PIMS.database
+ MOTI_LEGACY_LIS_DISPOSITION_PIMS.database
+
+
+
+
+
+
+
+ {2ac51446-4201-4600-ba20-f2070418a03d}
+ MOTI_LEGACY_LIS_DISPOSITION_PIMS
+ 0
+ 0
+ 0
+
+
+ 2024-01-06T16:30:45.8183411-08:00
+ ARIMA-DELL\smart
+ ARIMA-DELL
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ {D29EC497-76C8-4D06-8C25-C1D160E6B097}
+ Package
+ 1
+ 0
+ 94
+
+
+ {E6B1250B-4305-49A9-8E54-F3C508262F15}
+ 8
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=sqldevtst.th.gov.bc.ca;Initial Catalog=LIS_Dev;Provider=SQLOLEDB.1;Integrated Security=SSPI;Application Name=SSIS-Package-{EE8FB2DE-F7DA-4242-B96A-5C4F1BE070D9}sqldevtst.th.gov.bc.ca.LIS_Dev;Auto Translate=False;
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 1
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 5
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ LIS_Dev
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ sqldevtst.th.gov.bc.ca
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=localhost,5433;User ID=admin;Initial Catalog=pims;Provider=SQLOLEDB.1;Persist Security Info=True;Application Name=SSIS-Package-{719B66AE-B16C-45F5-A5E7-08502974E082}localhost,5433.pims.admin;Auto Translate=False;
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 1
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 5
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ pims
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ localhost,5433
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ admin
+ 18
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Development
+
+ bin
+
+
+
+
+ SQLServer2022
+ false
+
+
+
+
+
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-01-07T01:08:17.771052Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.dtproj.user b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.dtproj.user
new file mode 100644
index 0000000000..4b2dc89e28
--- /dev/null
+++ b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.dtproj.user
@@ -0,0 +1,25 @@
+
+
+
+
+ Development
+
+
+ false
+
+
+
+
+ false
+ true
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-01-07T01:08:17.7720168Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.sln b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.sln
new file mode 100644
index 0000000000..07955433a4
--- /dev/null
+++ b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/MOTI_LEGACY_LIS_DISPOSITION_PIMS.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.34031.81
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{C9674DCB-5085-4A16-B785-4C70DD1589BD}") = "MOTI_LEGACY_LIS_DISPOSITION_PIMS", "MOTI_LEGACY_LIS_DISPOSITION_PIMS.dtproj", "{5347B665-E09B-4074-9289-7A77E805733F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Development|Default = Development|Default
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5347B665-E09B-4074-9289-7A77E805733F}.Development|Default.ActiveCfg = Development
+ {5347B665-E09B-4074-9289-7A77E805733F}.Development|Default.Build.0 = Development
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {6E3DE5D1-D560-4792-BB23-486345913951}
+ EndGlobalSection
+EndGlobal
diff --git a/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/Project.params b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/Project.params
new file mode 100644
index 0000000000..680ffe30da
--- /dev/null
+++ b/etl/MOTI_LEGACY_LIS_DISPOSITION_PIMS/Project.params
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.dtproj b/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.dtproj
new file mode 100644
index 0000000000..b51c016874
--- /dev/null
+++ b/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.dtproj
@@ -0,0 +1,406 @@
+
+
+ Project
+ 16.0.5270.0
+ 9.0.1.0
+ $base64$PFNvdXJjZUNvbnRyb2xJbmZvIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOmRkbDI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yIiB4bWxuczpkZGwyXzI9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDAzL2VuZ2luZS8yLzIiIHhtbG5zOmRkbDEwMF8xMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDA4L2VuZ2luZS8xMDAvMTAwIiB4bWxuczpkZGwyMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAiIHhtbG5zOmRkbDIwMF8yMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEwL2VuZ2luZS8yMDAvMjAwIiB4bWxuczpkZGwzMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAiIHhtbG5zOmRkbDMwMF8zMDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDExL2VuZ2luZS8zMDAvMzAwIiB4bWxuczpkZGw0MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAiIHhtbG5zOmRkbDQwMF80MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEyL2VuZ2luZS80MDAvNDAwIiB4bWxuczpkZGw1MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAiIHhtbG5zOmRkbDUwMF81MDA9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vYW5hbHlzaXNzZXJ2aWNlcy8yMDEzL2VuZ2luZS81MDAvNTAwIiB4bWxuczpkd2Q9Imh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vRGF0YVdhcmVob3VzZS9EZXNpZ25lci8xLjAiPg0KICA8RW5hYmxlZD5mYWxzZTwvRW5hYmxlZD4NCiAgPFByb2plY3ROYW1lPjwvUHJvamVjdE5hbWU+DQogIDxBdXhQYXRoPjwvQXV4UGF0aD4NCiAgPExvY2FsUGF0aD48L0xvY2FsUGF0aD4NCiAgPFByb3ZpZGVyPjwvUHJvdmlkZXI+DQo8L1NvdXJjZUNvbnRyb2xJbmZvPg==
+
+ PIMS_HIST_LOAD.database
+ PIMS_HIST_LOAD.database
+
+
+
+
+
+
+
+ {7f436b59-5a46-4ae1-97c3-2aaa3c640d0b}
+ PIMS_HIST_LOAD
+ 0
+ 0
+ 0
+
+
+ 2024-01-07T01:16:19.413465-08:00
+ ARIMA-DELL\smart
+ ARIMA-DELL
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+ {D1B3A042-4FBF-494E-8606-2501133AF362}
+ Package
+ 1
+ 0
+ 22
+
+
+ {1A317677-9676-4D7C-AB1A-FB28E74DC0B8}
+ 8
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=localhost,5433;User ID=admin;Initial Catalog=pims;Provider=SQLOLEDB.1;Persist Security Info=True;Application Name=SSIS-Package-{871BCBE7-D6A1-4459-AEA3-052A22C56D27}localhost,5433.pims.admin;Auto Translate=False;
+ 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
+
+
+
+
+
+
+ {3331E02E-958E-4D7C-9414-04A8B589625D}
+ Package1
+ 1
+ 0
+ 8
+
+
+ {5A077E85-6779-406F-A57C-83565FE1589D}
+ 8
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ Data Source=localhost,5433;User ID=admin;Initial Catalog=pims;Provider=SQLOLEDB.1;Persist Security Info=True;Application Name=SSIS-Package1-{AE7797E2-7C5D-4D8F-AF85-207E5F6D785C}localhost,5433.pims.admin;Auto Translate=False;
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 1
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ 5
+ 9
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ pims
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 1
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ false
+ 3
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ localhost,5433
+ 18
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+ 0
+ admin
+ 18
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Development
+
+ bin
+
+
+
+
+ SQLServer2022
+ false
+
+
+
+
+
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-01-07T09:39:36.4285332Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.dtproj.user b/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.dtproj.user
new file mode 100644
index 0000000000..63500fa252
--- /dev/null
+++ b/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.dtproj.user
@@ -0,0 +1,27 @@
+
+
+
+
+ Development
+
+
+ false
+
+
+ ssistst.th.gov.bc.ca
+ /SSISDB/PIMS_TST/PIMS_HIST_LOAD
+
+
+ false
+ true
+
+
+ LastModifiedTime
+ LastModifiedTime
+ 2024-01-07T09:39:36.432531Z
+
+
+
+
+
+
\ No newline at end of file
diff --git a/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.sln b/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.sln
new file mode 100644
index 0000000000..45c6dd8299
--- /dev/null
+++ b/etl/PIMS_HIST_LOAD/PIMS_HIST_LOAD.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.34031.81
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{C9674DCB-5085-4A16-B785-4C70DD1589BD}") = "PIMS_HIST_LOAD", "PIMS_HIST_LOAD.dtproj", "{2FC4A6A3-EB86-43EB-A945-DBBB7F737176}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Development|Default = Development|Default
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2FC4A6A3-EB86-43EB-A945-DBBB7F737176}.Development|Default.ActiveCfg = Development
+ {2FC4A6A3-EB86-43EB-A945-DBBB7F737176}.Development|Default.Build.0 = Development
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3E862994-235C-46A6-9971-F5BE71F28B0D}
+ EndGlobalSection
+EndGlobal
diff --git a/etl/PIMS_HIST_LOAD/PIMS_HIST_TABLES_LOAD.dtsx b/etl/PIMS_HIST_LOAD/PIMS_HIST_TABLES_LOAD.dtsx
new file mode 100644
index 0000000000..c3c774f20e
--- /dev/null
+++ b/etl/PIMS_HIST_LOAD/PIMS_HIST_TABLES_LOAD.dtsx
@@ -0,0 +1,500 @@
+
+
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
\ No newline at end of file
diff --git a/etl/PIMS_HIST_LOAD/PIMS_HIST_TABLES_LOAD_LISOS_ETL_USER.dtsx b/etl/PIMS_HIST_LOAD/PIMS_HIST_TABLES_LOAD_LISOS_ETL_USER.dtsx
new file mode 100644
index 0000000000..c2f282483a
--- /dev/null
+++ b/etl/PIMS_HIST_LOAD/PIMS_HIST_TABLES_LOAD_LISOS_ETL_USER.dtsx
@@ -0,0 +1,184 @@
+
+
+ 8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]]>
+
\ No newline at end of file
diff --git a/etl/PIMS_HIST_LOAD/Project.params b/etl/PIMS_HIST_LOAD/Project.params
new file mode 100644
index 0000000000..680ffe30da
--- /dev/null
+++ b/etl/PIMS_HIST_LOAD/Project.params
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/openshift/4.0/scripts/oc-build.sh b/openshift/4.0/scripts/oc-build.sh
index 2ae03641f9..27dece290f 100755
--- a/openshift/4.0/scripts/oc-build.sh
+++ b/openshift/4.0/scripts/oc-build.sh
@@ -34,7 +34,11 @@ SHORTNAME=${1:-}
# E.g. pims-api.dev
#
-BUILD_NAME="${APP_NAME}-${SHORTNAME}.${OC_JOB_NAME}"
+if [ ! -z ${OVERRIDE_APP_NAME:-} ]; then
+ BUILD_NAME="${SHORTNAME}.${OC_JOB_NAME}"
+else
+ BUILD_NAME="${APP_NAME}-${SHORTNAME}.${OC_JOB_NAME}"
+fi
# Cancel non complete builds and start a new build (apply or don't run)
#
diff --git a/openshift/4.0/templates/api/build.yaml b/openshift/4.0/templates/api/build.yaml
index 95fc49f8e6..13eb04fe88 100644
--- a/openshift/4.0/templates/api/build.yaml
+++ b/openshift/4.0/templates/api/build.yaml
@@ -2,7 +2,7 @@
# It will build a new image from the specified source control repo
# that will run your application.
kind: Template
-apiVersion: v1
+apiVersion: template.openshift.io/v1
metadata:
name: pims-api-build
annotations:
@@ -38,11 +38,11 @@ parameters:
- name: BUILDIMAGE_NAME
displayName: "Source Image Name"
description: "The image to use as the Builder Image."
- value: "dotnet-60"
+ value: "dotnet-80"
- name: BUILDIMAGE_TAG
displayName: "Source Image Tag"
description: "The s2i image tag which is used to build the code."
- value: "6.0"
+ value: "8.0"
- name: GIT_URL
displayName: Git Repository URL
@@ -115,6 +115,7 @@ objects:
role: ${ROLE_NAME}
env: ${ENV_NAME}
branch: ${GIT_REF}
+ ci_cd: "true"
spec:
triggers:
- type: ImageChange
diff --git a/openshift/4.0/templates/app/build.yaml b/openshift/4.0/templates/app/build.yaml
index 229a7f01d0..3399173ca6 100644
--- a/openshift/4.0/templates/app/build.yaml
+++ b/openshift/4.0/templates/app/build.yaml
@@ -1,5 +1,5 @@
kind: Template
-apiVersion: v1
+apiVersion: template.openshift.io/v1
metadata:
name: pims-app-build
annotations:
@@ -35,7 +35,7 @@ parameters:
- name: BUILDIMAGE_TAG
displayName: "Source Image Tag"
description: "The s2i image tag which is used to build the code."
- value: "1-1"
+ value: "1-5"
- name: RUNTIMEIMAGE_NAME
displayName: "Source Image Name"
@@ -85,11 +85,11 @@ objects:
namespace: ${PROJECT_NAMESPACE}-${ENV_NAME}
annotations:
description: Keeps track of changes to the intermediate frontend artifacts image
- labels:
- name: ${APP_NAME}-${ROLE_NAME}-base
- app: ${APP_NAME}
- role: ${ROLE_NAME}
- env: ${ENV_NAME}
+ labels:
+ name: ${APP_NAME}-${ROLE_NAME}-base
+ app: ${APP_NAME}
+ role: ${ROLE_NAME}
+ env: ${ENV_NAME}
# The build config that will be created and be named for the branch you created it for.
- kind: BuildConfig
@@ -99,17 +99,15 @@ objects:
namespace: ${PROJECT_NAMESPACE}-${ENV_NAME}
annotations:
description: Intermediate build that generates the frontend artifacts (html, javascript, images, etc)
- labels:
- name: ${APP_NAME}-${ROLE_NAME}-base.${GIT_REF}
- app: ${APP_NAME}
- role: ${ROLE_NAME}
- env: ${ENV_NAME}
+ labels:
+ name: ${APP_NAME}-${ROLE_NAME}-base.${GIT_REF}
+ app: ${APP_NAME}
+ role: ${ROLE_NAME}
+ env: ${ENV_NAME}
+ ci_cd: "true"
spec:
runPolicy: Parallel
completionDeadlineSeconds: 1800
- triggers:
- - type: ImageChange
- - type: ConfigChange
source:
type: Git
git:
@@ -140,11 +138,11 @@ objects:
namespace: ${PROJECT_NAMESPACE}-${ENV_NAME}
annotations:
description: Keeps track of changes to the final frontend image (embedded in nginx)
- labels:
- name: ${APP_NAME}-${ROLE_NAME}
- app: ${APP_NAME}
- role: ${ROLE_NAME}
- env: ${ENV_NAME}
+ labels:
+ name: ${APP_NAME}-${ROLE_NAME}
+ app: ${APP_NAME}
+ role: ${ROLE_NAME}
+ env: ${ENV_NAME}
# The build config that will be created and be named for the branch you created it for.
- kind: BuildConfig
@@ -154,17 +152,15 @@ objects:
namespace: ${PROJECT_NAMESPACE}-${ENV_NAME}
annotations:
description: This (final) build takes the generated frontend artifacts and serves them through a static web server (nginx)
- labels:
- name: ${APP_NAME}-${ROLE_NAME}.${GIT_REF}
- app: ${APP_NAME}
- role: ${ROLE_NAME}
- env: ${ENV_NAME}
+ labels:
+ name: ${APP_NAME}-${ROLE_NAME}.${GIT_REF}
+ app: ${APP_NAME}
+ role: ${ROLE_NAME}
+ env: ${ENV_NAME}
+ ci_cd: "true"
spec:
runPolicy: Parallel
completionDeadlineSeconds: 1800
- triggers:
- - type: ImageChange
- - type: ConfigChange
source:
dockerfile: |-
FROM ${APP_NAME}-${ROLE_NAME}-base:${OUTPUT_IMAGE_TAG}
diff --git a/openshift/4.0/templates/jobs/mayan-sync-task.yaml b/openshift/4.0/templates/jobs/mayan-sync-task.yaml
new file mode 100644
index 0000000000..a994623cc4
--- /dev/null
+++ b/openshift/4.0/templates/jobs/mayan-sync-task.yaml
@@ -0,0 +1,51 @@
+apiVersion: tekton.dev/v1beta1
+kind: Task
+spec:
+ params:
+ - name: KEYCLOAK_SECRET_NAME
+ type: string
+ - name: TOKEN_URL
+ type: string
+ - name: MAYAN_SYNC_URL
+ type: string
+ - name: CLIENT_ID
+ type: string
+# This action is a generic mayan sync action that can be used to call any mayan sync endpoint with a valid token.
+# Block 1: get a valid token from keycloak for the backend requests.
+# Block 2: parse the token from the response of #1.
+# Block 3: call the mayan sync endpoint with the token from #2. Note this uses static data from the listed configmap.
+ steps:
+ - args:
+ - >-
+ RESPONSE=`curl --location "$(params.TOKEN_URL)"
+ --header 'Content-Type: application/x-www-form-urlencoded'
+ --data-urlencode "client_id=$(params.CLIENT_ID)"
+ --data-urlencode 'grant_type=client_credentials'
+ --data-urlencode "audience=$(params.CLIENT_ID)"
+ --data-urlencode "client_secret=$CLIENT_SECRET"`
+
+ && TOKEN=`echo "$RESPONSE" |
+ egrep -o "[^\"]*" | sed -n 4p` && echo "$DATA"
+
+ && curl --location --request
+ PATCH "$(params.MAYAN_SYNC_URL)"
+ --header 'Content-Type: application/json'
+ --header "Authorization: Bearer $TOKEN"
+ --data "$DATA"
+ command:
+ - sh
+ - '-c'
+ env:
+ - name: CLIENT_SECRET
+ valueFrom:
+ secretKeyRef:
+ key: KEYCLOAK_SECRET
+ name: $(params.KEYCLOAK_SECRET_NAME)
+ - name: DATA
+ valueFrom:
+ configMapKeyRef:
+ key: data
+ name: mayan-sync-config
+ image: curlimages/curl
+ name: sync-mayan
+ resources: {}
diff --git a/openshift/4.0/templates/jobs/mayan-sync.yaml b/openshift/4.0/templates/jobs/mayan-sync.yaml
new file mode 100644
index 0000000000..d92522c586
--- /dev/null
+++ b/openshift/4.0/templates/jobs/mayan-sync.yaml
@@ -0,0 +1,43 @@
+kind: Template
+apiVersion: template.openshift.io/v1
+metadata:
+ name: mayan-sync
+ annotations:
+ description: "This template creates a task to deploy mayan configuration."
+ tags: "mayan,upgrade,document"
+objects:
+ - kind: TaskRun
+ apiVersion: tekton.dev/v1beta1
+ metadata:
+ generateName: mayan-sync-
+ namespace: ${NAMESPACE}
+ spec:
+ params:
+ - name: TOKEN_URL
+ value: ${TOKEN_URL}
+ - name: CLIENT_ID
+ value: ${CLIENT_ID}
+ - name: MAYAN_SYNC_URL
+ value: ${MAYAN_SYNC_URL}
+ - name: KEYCLOAK_SECRET_NAME
+ value: ${KEYCLOAK_SECRET_NAME}
+ serviceAccountName: pipeline
+ taskRef:
+ kind: Task
+ name: mayan-sync
+parameters:
+ - name: TOKEN_URL
+ description: The keycloak token endpoint
+ required: true
+ - name: CLIENT_ID
+ description: The id of the keycloak client
+ required: true
+ - name: MAYAN_SYNC_URL
+ description: The endpoint that will be used to sync the documents
+ required: true
+ - name: KEYCLOAK_SECRET_NAME
+ description: The name of the Openshift secret that contains the keycloak credentials
+ required: true
+ - name: NAMESPACE
+ description: The namespace to deploy this template
+ required: true
diff --git a/openshift/s2i/nginx-runtime/nginx-runtime.yaml b/openshift/s2i/nginx-runtime/nginx-runtime.yaml
index 81d5839138..59396ec558 100644
--- a/openshift/s2i/nginx-runtime/nginx-runtime.yaml
+++ b/openshift/s2i/nginx-runtime/nginx-runtime.yaml
@@ -1,5 +1,5 @@
kind: Template
-apiVersion: v1
+apiVersion: template.openshift.io/v1
metadata:
name: nginx-runtime
parameters:
@@ -42,19 +42,31 @@ parameters:
description: The tag of the nginx base image [e.g "mainline" or "latest"].
required: true
value: mainline
+ - name: PROJECT_NAMESPACE
+ displayName: "OpenShift Project Namespace"
+ description: "The namespace of the OpenShift project containing the application."
+ required: true
+ value: "3cd915"
+ - name: ENV_NAME
+ displayName: "Environment name"
+ description: "The name for this environment [dev, test, prod, tools]"
+ required: true
+ value: "tools"
objects:
- kind: ImageStream
apiVersion: v1
metadata:
name: ${NAME}
+ namespace: ${PROJECT_NAMESPACE}-${ENV_NAME}
- kind: BuildConfig
apiVersion: v1
metadata:
name: ${NAME}.${GIT_REF}
labels:
app: ${NAME}
+ ci_cd: "true"
spec:
- runPolicy: Serial
+ runPolicy: Parallel
source:
type: Git
git:
diff --git a/source/backend/Directory.Build.props b/source/backend/Directory.Build.props
index 6f5726513f..d9a8909ec7 100644
--- a/source/backend/Directory.Build.props
+++ b/source/backend/Directory.Build.props
@@ -1,7 +1,7 @@
- net6.0
- 9.0
+ net8.0
+ 11.0
Minimum
4
true
@@ -17,19 +17,19 @@
-
-
-
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
all
runtime; build; native; contentfiles; analyzers;
diff --git a/source/backend/api/Areas/Acquisition/Controllers/ChecklistController.cs b/source/backend/api/Areas/Acquisition/Controllers/ChecklistController.cs
index 8765d529ea..0dd7935589 100644
--- a/source/backend/api/Areas/Acquisition/Controllers/ChecklistController.cs
+++ b/source/backend/api/Areas/Acquisition/Controllers/ChecklistController.cs
@@ -3,6 +3,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models.Concepts.AcquisitionFile;
+using Pims.Api.Models.Concepts.File;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Dal.Security;
@@ -50,12 +51,12 @@ public ChecklistController(IAcquisitionFileService acquisitionService, IMapper m
[HttpGet("{id:long}/checklist")]
[HasPermission(Permissions.AcquisitionFileView)]
[Produces("application/json")]
- [ProducesResponseType(typeof(IEnumerable), 200)]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
public IActionResult GetAcquisitionFileChecklist([FromRoute] long id)
{
var checklist = _acquisitionService.GetChecklistItems(id);
- return new JsonResult(_mapper.Map>(checklist));
+ return new JsonResult(_mapper.Map>(checklist));
}
///
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/AddressModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/AddressModel.cs
index 6ff7509ee5..c28cfa8853 100644
--- a/source/backend/api/Areas/Contacts/Models/Contact/AddressModel.cs
+++ b/source/backend/api/Areas/Contacts/Models/Contact/AddressModel.cs
@@ -22,7 +22,7 @@ public class AddressModel
///
/// get/set - The address type.
///
- public TypeModel AddressType { get; set; }
+ public CodeTypeModel AddressType { get; set; }
///
/// get/set - The street address.
diff --git a/source/backend/api/Areas/Contacts/Models/Contact/ContactMethodModel.cs b/source/backend/api/Areas/Contacts/Models/Contact/ContactMethodModel.cs
index 0d7e382ac4..27fb8e4e61 100644
--- a/source/backend/api/Areas/Contacts/Models/Contact/ContactMethodModel.cs
+++ b/source/backend/api/Areas/Contacts/Models/Contact/ContactMethodModel.cs
@@ -22,7 +22,7 @@ public class ContactMethodModel
///
/// get/set - The contact method type.
///
- public TypeModel ContactMethodType { get; set; }
+ public CodeTypeModel ContactMethodType { get; set; }
///
/// get/set - The contact method value.
diff --git a/source/backend/api/Areas/Disposition/Controllers/ChecklistController.cs b/source/backend/api/Areas/Disposition/Controllers/ChecklistController.cs
new file mode 100644
index 0000000000..62c3cfbdae
--- /dev/null
+++ b/source/backend/api/Areas/Disposition/Controllers/ChecklistController.cs
@@ -0,0 +1,80 @@
+using System.Collections.Generic;
+using MapsterMapper;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Pims.Api.Models.Concepts.DispositionFile;
+using Pims.Api.Models.Concepts.File;
+using Pims.Api.Policies;
+using Pims.Api.Services;
+using Pims.Dal.Security;
+using Swashbuckle.AspNetCore.Annotations;
+
+namespace Pims.Api.Areas.Disposition.Controllers
+{
+ ///
+ /// ChecklistController class, provides endpoints for interacting with disposition files checklists.
+ ///
+ [Authorize]
+ [ApiController]
+ [ApiVersion("1.0")]
+ [Area("dispositionfiles")]
+ [Route("v{version:apiVersion}/[area]")]
+ [Route("[area]")]
+ public class ChecklistController : ControllerBase
+ {
+ #region Variables
+ private readonly IDispositionFileService _dispositionService;
+ private readonly IMapper _mapper;
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Creates a new instance of a ChecklistController class, initializes it with the specified arguments.
+ ///
+ ///
+ ///
+ ///
+ public ChecklistController(IDispositionFileService dispositionService, IMapper mapper)
+ {
+ _dispositionService = dispositionService;
+ _mapper = mapper;
+ }
+ #endregion
+
+ #region Endpoints
+
+ ///
+ /// Get the disposition file checklist.
+ ///
+ /// The checklist items.
+ [HttpGet("{id:long}/checklist")]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ public IActionResult GetDispositionFileChecklist([FromRoute] long id)
+ {
+ var checklist = _dispositionService.GetChecklistItems(id);
+ return new JsonResult(_mapper.Map>(checklist));
+ }
+
+ ///
+ /// Update the disposition file checklist.
+ ///
+ /// The updated checklist items.
+ [HttpPut("{id:long}/checklist")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ public IActionResult UpdateDispositionFileChecklist([FromBody] DispositionFileModel dispositionFileModel)
+ {
+ var dispositionFileEntity = _mapper.Map(dispositionFileModel);
+ var dispositionFile = _dispositionService.UpdateChecklistItems(dispositionFileEntity);
+ return new JsonResult(_mapper.Map(dispositionFile));
+ }
+
+ #endregion
+ }
+}
diff --git a/source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs b/source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs
new file mode 100644
index 0000000000..c50258d7fe
--- /dev/null
+++ b/source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs
@@ -0,0 +1,504 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MapsterMapper;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using Pims.Api.Helpers.Exceptions;
+using Pims.Api.Models.Concepts.AcquisitionFile;
+using Pims.Api.Models.Concepts.DispositionFile;
+using Pims.Api.Policies;
+using Pims.Api.Services;
+using Pims.Core.Exceptions;
+using Pims.Core.Extensions;
+using Pims.Core.Json;
+using Pims.Dal.Exceptions;
+using Pims.Dal.Security;
+using Swashbuckle.AspNetCore.Annotations;
+
+namespace Pims.Api.Areas.Disposition.Controllers
+{
+ ///
+ /// DispositionFileController class, provides endpoints for interacting with disposition files.
+ ///
+ [Authorize]
+ [ApiController]
+ [ApiVersion("1.0")]
+ [Area("dispositionfiles")]
+ [Route("v{version:apiVersion}/[area]")]
+ [Route("[area]")]
+ public class DispositionFileController : ControllerBase
+ {
+ #region Variables
+ private readonly IDispositionFileService _dispositionService;
+ private readonly IMapper _mapper;
+ private readonly ILogger _logger;
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Creates a new instance of a DispositionFileController class, initializes it with the specified arguments.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public DispositionFileController(IDispositionFileService dispositionService, IMapper mapper, ILogger logger)
+ {
+ _dispositionService = dispositionService;
+ _mapper = mapper;
+ _logger = logger;
+ }
+ #endregion
+
+ #region Endpoints
+
+ ///
+ /// Gets the specified disposition file.
+ ///
+ ///
+ [HttpGet("{id:long}")]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetDispositionFile(long id)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(GetDispositionFile),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionFile = _dispositionService.GetById(id);
+ return new JsonResult(_mapper.Map(dispositionFile));
+ }
+
+ ///
+ /// Creates a new Disposition File entity.
+ ///
+ ///
+ [HttpPost]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ [HasPermission(Permissions.DispositionAdd)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ public IActionResult AddDispositionFile([FromBody] DispositionFileModel model, [FromQuery] string[] userOverrideCodes)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(AddDispositionFile),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionFileEntity = _mapper.Map(model);
+ var dispositionFile = _dispositionService.Add(dispositionFileEntity, userOverrideCodes.Select(oc => UserOverrideCode.Parse(oc)));
+
+ return new JsonResult(_mapper.Map(dispositionFile));
+ }
+
+ [HttpPut("{id:long}")]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ public IActionResult UpdateDispositionFile([FromRoute] long id, [FromBody] DispositionFileModel model, [FromQuery] string[] userOverrideCodes)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(UpdateDispositionFile),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionFileEntity = _mapper.Map(model);
+ var dispositionFile = _dispositionService.Update(id, dispositionFileEntity, userOverrideCodes.Select(oc => UserOverrideCode.Parse(oc)));
+
+ return new JsonResult(_mapper.Map(dispositionFile));
+ }
+
+ ///
+ /// Gets the specified disposition file last updated-by information.
+ ///
+ ///
+ [HttpGet("{id:long}/updateInfo")]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(Dal.Entities.Models.LastUpdatedByModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetLastUpdatedBy(long id)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(GetLastUpdatedBy),
+ User.GetUsername(),
+ DateTime.Now);
+
+ var lastUpdated = _dispositionService.GetLastUpdateInformation(id);
+ return new JsonResult(lastUpdated);
+ }
+
+ ///
+ /// Get the disposition file properties.
+ ///
+ ///
+ [HttpGet("{id:long}/properties")]
+ [HasPermission(Permissions.DispositionView, Permissions.PropertyView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetDispositionFileProperties(long id)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(GetDispositionFileProperties),
+ User.GetUsername(),
+ DateTime.Now);
+
+ var dispositionfileProperties = _dispositionService.GetProperties(id);
+
+ return new JsonResult(_mapper.Map>(dispositionfileProperties));
+ }
+
+ ///
+ /// Get all unique persons and organizations that belong to at least one disposition file as a team member.
+ ///
+ ///
+ [HttpGet("team-members")]
+ [HasPermission(Permissions.DispositionView)]
+ [HasPermission(Permissions.ContactView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ public IActionResult GetDispositionTeamMembers()
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(GetDispositionTeamMembers),
+ User.GetUsername(),
+ DateTime.Now);
+
+ var team = _dispositionService.GetTeamMembers();
+
+ return new JsonResult(_mapper.Map>(team));
+ }
+
+ [HttpGet("{id:long}/offers")]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetDispositionFileOffers([FromRoute] long id)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(GetDispositionFileOffers),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionOffers = _dispositionService.GetOffers(id);
+ return new JsonResult(_mapper.Map>(dispositionOffers));
+ }
+
+ [HttpGet("{id:long}/offers/{offerId:long}")]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileOfferModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetDispositionFileOfferById([FromRoute] long id, [FromRoute] long offerId)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(GetDispositionFileOfferById),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionOffer = _dispositionService.GetDispositionOfferById(id, offerId);
+
+ return new JsonResult(_mapper.Map(dispositionOffer));
+ }
+
+ [HttpPost("{id:long}/offers")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileOfferModel), 201)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult AddDispositionFileOffer([FromRoute] long id, [FromBody] DispositionFileOfferModel dispositionFileOffer)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(AddDispositionFileOffer),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ try
+ {
+ var dispositionOfferEntity = _mapper.Map(dispositionFileOffer);
+ var newDispositionOffer = _dispositionService.AddDispositionFileOffer(id, dispositionOfferEntity);
+
+ return new JsonResult(_mapper.Map(newDispositionOffer));
+ }
+ catch (DuplicateEntityException e)
+ {
+ return Conflict(e.Message);
+ }
+ }
+
+ [HttpPut("{id:long}/offers/{offerId:long}")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileOfferModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult UpdateDispositionFileOffer([FromRoute] long id, [FromRoute] long offerId, [FromBody] DispositionFileOfferModel dispositionFileOffer)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(UpdateDispositionFileOffer),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ try
+ {
+ var dispositionOfferEntity = _mapper.Map(dispositionFileOffer);
+ var updatedOffer = _dispositionService.UpdateDispositionFileOffer(id, offerId, dispositionOfferEntity);
+
+ return new JsonResult(_mapper.Map(updatedOffer));
+ }
+ catch (DuplicateEntityException e)
+ {
+ return Conflict(e.Message);
+ }
+ }
+
+ [HttpDelete("{id:long}/offers/{offerId:long}")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(bool), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult DeleteDispositionFileOffer([FromRoute] long id, [FromRoute] long offerId)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(DeleteDispositionFileOffer),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var result = _dispositionService.DeleteDispositionFileOffer(id, offerId);
+ return new JsonResult(result);
+ }
+
+ [HttpGet("{id:long}/sale")]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileSaleModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetDispositionFileSales([FromRoute] long id)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(GetDispositionFileSales),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionSale = _dispositionService.GetDispositionFileSale(id);
+ return new JsonResult(_mapper.Map(dispositionSale));
+ }
+
+ [HttpPost("{id:long}/sale")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileSaleModel), 201)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult AddDispositionFileSale([FromRoute] long id, [FromBody] DispositionFileSaleModel dispositionFileSale)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(AddDispositionFileSale),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ try
+ {
+ if (id != dispositionFileSale.DispositionFileId)
+ {
+ throw new BadRequestException("Invalid dispositionFileId.");
+ }
+
+ var dispositionSaleEntity = _mapper.Map(dispositionFileSale);
+ var newDispositionSale = _dispositionService.AddDispositionFileSale(dispositionSaleEntity);
+
+ return new JsonResult(_mapper.Map(newDispositionSale));
+ }
+ catch (DuplicateEntityException e)
+ {
+ return Conflict(e.Message);
+ }
+ }
+
+ [HttpPut("{id:long}/sale/{saleId:long}")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileSaleModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult UpdateDispositionFileSale([FromRoute]long id, [FromRoute]long saleId, [FromBody] DispositionFileSaleModel dispositionFileSale)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(UpdateDispositionFileSale),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ if (id != dispositionFileSale.DispositionFileId || dispositionFileSale.Id != saleId)
+ {
+ throw new BadRequestException("Invalid dispositionFileId.");
+ }
+
+ var dispositionSaleEntity = _mapper.Map(dispositionFileSale);
+ var updatedSale = _dispositionService.UpdateDispositionFileSale(dispositionSaleEntity);
+
+ return new JsonResult(_mapper.Map(updatedSale));
+ }
+
+ [HttpGet("{id:long}/appraisal")]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileAppraisalModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult GetDispositionFileAppraisal([FromRoute] long id)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(GetDispositionFileAppraisal),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionSale = _dispositionService.GetDispositionFileAppraisal(id);
+ return new JsonResult(_mapper.Map(dispositionSale));
+ }
+
+ [HttpPost("{id:long}/appraisal")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileAppraisalModel), 201)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult AddDispositionFileAppraisal([FromRoute] long id, [FromBody] DispositionFileAppraisalModel dispositionFileAppraisal)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(AddDispositionFileAppraisal),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ try
+ {
+ var dispositionAppraisalEntity = _mapper.Map(dispositionFileAppraisal);
+ var newDispositionAppraisal = _dispositionService.AddDispositionFileAppraisal(id, dispositionAppraisalEntity);
+
+ return new JsonResult(_mapper.Map(newDispositionAppraisal));
+ }
+ catch (DuplicateEntityException e)
+ {
+ return Conflict(e.Message);
+ }
+ }
+
+ [HttpPut("{id:long}/appraisal/{appraisalId:long}")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileAppraisalModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ [TypeFilter(typeof(NullJsonResultFilter))]
+ public IActionResult UpdateDispositionFileAppraisal([FromRoute] long id, [FromRoute] long appraisalId, [FromBody] DispositionFileAppraisalModel dispositionFileAppraisal)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionFileController),
+ nameof(UpdateDispositionFileAppraisal),
+ User.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionAppraisalEntity = _mapper.Map(dispositionFileAppraisal);
+ var updatedOffer = _dispositionService.UpdateDispositionFileAppraisal(id, appraisalId, dispositionAppraisalEntity);
+
+ return new JsonResult(_mapper.Map(updatedOffer));
+ }
+
+ ///
+ /// Update the disposition file properties.
+ ///
+ ///
+ [HttpPut("{id:long}/properties")]
+ [HasPermission(Permissions.DispositionEdit)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(DispositionFileModel), 200)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ public IActionResult UpdateDispositionFileProperties([FromBody] DispositionFileModel dispositionFileModel, [FromQuery] string[] userOverrideCodes)
+ {
+ var dispositionFileEntity = _mapper.Map(dispositionFileModel);
+ var dispositionFile = _dispositionService.UpdateProperties(dispositionFileEntity, userOverrideCodes.Select(oc => UserOverrideCode.Parse(oc)));
+ return new JsonResult(_mapper.Map(dispositionFile));
+ }
+
+ #endregion
+ }
+}
diff --git a/source/backend/api/Areas/Disposition/Controllers/SearchController.cs b/source/backend/api/Areas/Disposition/Controllers/SearchController.cs
new file mode 100644
index 0000000000..ebe88062d4
--- /dev/null
+++ b/source/backend/api/Areas/Disposition/Controllers/SearchController.cs
@@ -0,0 +1,108 @@
+using System;
+using System.Collections.Generic;
+using MapsterMapper;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http.Extensions;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using Pims.Api.Areas.Disposition.Models.Search;
+using Pims.Api.Helpers.Exceptions;
+using Pims.Api.Helpers.Extensions;
+using Pims.Api.Models.Base;
+using Pims.Api.Models.Concepts.DispositionFile;
+using Pims.Api.Policies;
+using Pims.Api.Services;
+using Pims.Core.Extensions;
+using Pims.Dal.Entities.Models;
+using Pims.Dal.Security;
+using Swashbuckle.AspNetCore.Annotations;
+
+namespace Pims.Api.Areas.Disposition.Controllers
+{
+ ///
+ /// SearchController class, provides endpoints for searching disposition files.
+ ///
+ [Authorize]
+ [ApiController]
+ [ApiVersion("1.0")]
+ [Area("dispositionfiles")]
+ [Route("v{version:apiVersion}/[area]/search")]
+ [Route("[area]/search")]
+ public class SearchController : ControllerBase
+ {
+ #region Variables
+ private readonly IDispositionFileService _dispositionService;
+ private readonly IMapper _mapper;
+ private readonly ILogger _logger;
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Creates a new instance of a SearchController class, initializes it with the specified arguments.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public SearchController(IDispositionFileService dispositionService, IMapper mapper, ILogger logger)
+ {
+ _dispositionService = dispositionService;
+ _mapper = mapper;
+ _logger = logger;
+ }
+ #endregion
+
+ #region Disposition List View Endpoints
+
+ ///
+ /// Gets all the Disposition Files that satisfy the filter parameters.
+ ///
+ /// An array of Disposition Files matching the filter.
+ [HttpGet]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
+ [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ public IActionResult GetDispositionFiles()
+ {
+ var uri = new Uri(Request.GetDisplayUrl());
+ var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query);
+ return GetDispositionFiles(new DispositionFilterModel(query));
+ }
+
+ ///
+ /// Gets all the Disposition Files that satisfy the filter parameters.
+ ///
+ /// An array of Disposition Files matching the filter.
+ [HttpPost("filter")]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces("application/json")]
+ [ProducesResponseType(typeof(IEnumerable), 200)]
+ [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
+ [SwaggerOperation(Tags = new[] { "dispositionfile" })]
+ public IActionResult GetDispositionFiles([FromBody] DispositionFilterModel filter)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(SearchController),
+ nameof(GetDispositionFiles),
+ User.GetUsername(),
+ DateTime.Now);
+
+ filter.ThrowBadRequestIfNull($"The request must include a filter.");
+ if (!filter.IsValid())
+ {
+ throw new BadRequestException("Disposition filter must contain valid values.");
+ }
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());
+
+ var dispositionFiles = _dispositionService.GetPage((DispositionFilter)filter);
+ return new JsonResult(_mapper.Map>(dispositionFiles));
+ }
+
+ #endregion
+ }
+}
diff --git a/source/backend/api/Areas/Disposition/Models/DispositionFilterModel.cs b/source/backend/api/Areas/Disposition/Models/DispositionFilterModel.cs
new file mode 100644
index 0000000000..ea76ca7d00
--- /dev/null
+++ b/source/backend/api/Areas/Disposition/Models/DispositionFilterModel.cs
@@ -0,0 +1,130 @@
+using System;
+using System.Collections.Generic;
+using Pims.Core.Extensions;
+using Pims.Dal.Entities.Models;
+
+namespace Pims.Api.Areas.Disposition.Models.Search
+{
+ public class DispositionFilterModel : PageFilter
+ {
+ #region Properties
+
+ ///
+ /// get/set - The pid identifier to search by.
+ ///
+ public string Pid { get; set; }
+
+ ///
+ /// get/set - The pin identifier to search by.
+ ///
+ public string Pin { get; set; }
+
+ ///
+ /// get/set - The address to search by.
+ ///
+ public string Address { get; set; }
+
+ ///
+ /// get/set - The disposition file name or the file number or the legacy reference number, search for all simultaneously.
+ ///
+ public string FileNameOrNumberOrReference { get; set; }
+
+ ///
+ /// get/set - The status of the disposition file.
+ ///
+ public string DispositionFileStatusCode { get; set; }
+
+ ///
+ /// get/set - The disposition status.
+ ///
+ public string DispositionStatusCode { get; set; }
+
+ ///
+ /// get/set - The type of the disposition.
+ ///
+ public string DispositionTypeCode { get; set; }
+
+ ///
+ /// get/set - The MOTI person id to search by for disposition team members.
+ ///
+ public long? TeamMemberPersonId { get; set; }
+
+ ///
+ /// get/set - The MOTI Organization id to search by for disposition team members.
+ ///
+ public long? TeamMemberOrganizationId { get; set; }
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Creates a new instance of a DispositionFilterModel class.
+ ///
+ public DispositionFilterModel()
+ {
+ }
+
+ ///
+ /// Creates a new instance of a DispositionFilterModel class, initializes with the specified arguments.
+ ///
+ ///
+ public DispositionFilterModel(Dictionary query)
+ : base(query)
+ {
+ // We want case-insensitive query parameter properties.
+ var filter = new Dictionary(query, StringComparer.OrdinalIgnoreCase);
+
+ this.Pid = filter.GetStringValue(nameof(this.Pid));
+ this.Pin = filter.GetStringValue(nameof(this.Pin));
+ this.Address = filter.GetStringValue(nameof(this.Address));
+ this.FileNameOrNumberOrReference = filter.GetStringValue(nameof(this.FileNameOrNumberOrReference));
+ this.DispositionFileStatusCode = filter.GetStringValue(nameof(this.DispositionFileStatusCode));
+ this.DispositionStatusCode = filter.GetStringValue(nameof(this.DispositionStatusCode));
+ this.DispositionTypeCode = filter.GetStringValue(nameof(this.DispositionTypeCode));
+ this.TeamMemberPersonId = filter.GetLongNullValue(nameof(this.TeamMemberPersonId));
+ this.TeamMemberOrganizationId = filter.GetLongNullValue(nameof(this.TeamMemberOrganizationId));
+
+ this.Sort = filter.GetStringArrayValue(nameof(this.Sort));
+ }
+ #endregion
+
+ #region Methods
+
+ ///
+ /// Convert to a DispositionFilter.
+ ///
+ ///
+ public static explicit operator DispositionFilter(DispositionFilterModel model)
+ {
+ var filter = new DispositionFilter
+ {
+ Page = model.Page,
+ Quantity = model.Quantity,
+
+ Pid = model.Pid,
+ Pin = model.Pin,
+ Address = model.Address,
+ FileNameOrNumberOrReference = model.FileNameOrNumberOrReference,
+ DispositionFileStatusCode = model.DispositionFileStatusCode,
+ DispositionStatusCode = model.DispositionStatusCode,
+ DispositionTypeCode = model.DispositionTypeCode,
+ TeamMemberPersonId = model.TeamMemberPersonId,
+ TeamMemberOrganizationId = model.TeamMemberOrganizationId,
+
+ Sort = model.Sort,
+ };
+
+ return filter;
+ }
+
+ ///
+ /// Determine if a valid filter was provided.
+ ///
+ /// true if the filter is valid, false otherwise.
+ public override bool IsValid()
+ {
+ return base.IsValid();
+ }
+ #endregion
+ }
+}
diff --git a/source/backend/api/Areas/DocumentGeneration/DocumentGenerationController.cs b/source/backend/api/Areas/DocumentGeneration/DocumentGenerationController.cs
index a8e03f303d..1dc9ed979e 100644
--- a/source/backend/api/Areas/DocumentGeneration/DocumentGenerationController.cs
+++ b/source/backend/api/Areas/DocumentGeneration/DocumentGenerationController.cs
@@ -2,9 +2,10 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
-using Pims.Api.Models.Concepts.Http;
+
using Pims.Api.Models.DocumentGeneration;
-using Pims.Api.Models.Download;
+
+using Pims.Api.Models.Requests.Http;
using Pims.Api.Services;
using Swashbuckle.AspNetCore.Annotations;
@@ -46,7 +47,7 @@ public DocumentGenerationController(IDocumentGenerationService documentGeneratio
// [HasPermission(Permissions.GenerateDocuments)]
[Produces("application/json")]
- [ProducesResponseType(typeof(ExternalResult), 200)]
+ [ProducesResponseType(typeof(ExternalResponse), 200)]
[SwaggerOperation(Tags = new[] { "document-generation" })]
public async Task GetSupportedDocumentTypes()
{
@@ -60,7 +61,7 @@ public async Task GetSupportedDocumentTypes()
[HttpPost("template")]
// [HasPermission(Permissions.GenerateDocuments)]
- [ProducesResponseType(typeof(ExternalResult), 200)]
+ [ProducesResponseType(typeof(ExternalResponse), 200)]
[SwaggerOperation(Tags = new[] { "document-generation" })]
public async Task UploadTemplate([FromForm] IFormFile file)
{
@@ -74,7 +75,7 @@ public async Task UploadTemplate([FromForm] IFormFile file)
[HttpPost("template/generate/download-wrapped")]
// [HasPermission(Permissions.GenerateDocuments)]
- [ProducesResponseType(typeof(ExternalResult), 200)]
+ [ProducesResponseType(typeof(ExternalResponse), 200)]
[SwaggerOperation(Tags = new[] { "document-generation" })]
public async Task UploadTemplateAndDownloadWrapped([FromBody] DocumentGenerationRequest request)
{
diff --git a/source/backend/api/Areas/Documents/DocumentController.cs b/source/backend/api/Areas/Documents/DocumentController.cs
index c1ff5ae911..bb38ce59ab 100644
--- a/source/backend/api/Areas/Documents/DocumentController.cs
+++ b/source/backend/api/Areas/Documents/DocumentController.cs
@@ -4,12 +4,11 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Helpers.Exceptions;
-using Pims.Api.Models.Concepts.Document;
-using Pims.Api.Models.Concepts.Document.UpdateMetadata;
-using Pims.Api.Models.Concepts.Http;
-using Pims.Api.Models.Download;
+
using Pims.Api.Models.Mayan;
using Pims.Api.Models.Mayan.Document;
+using Pims.Api.Models.Requests.Document.UpdateMetadata;
+using Pims.Api.Models.Requests.Http;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Dal.Security;
@@ -55,12 +54,12 @@ public DocumentController(IDocumentService documentService, IMapper mapper)
[HttpGet("types")]
[HasPermission(Permissions.DocumentView)]
[Produces("application/json")]
- [ProducesResponseType(typeof(List), 200)]
+ [ProducesResponseType(typeof(List), 200)]
[SwaggerOperation(Tags = new[] { "document-types" })]
public IActionResult GetDocumentTypes()
{
var documentTypes = _documentService.GetPimsDocumentTypes();
- var mappedDocumentTypes = _mapper.Map>(documentTypes);
+ var mappedDocumentTypes = _mapper.Map>(documentTypes);
return new JsonResult(mappedDocumentTypes);
}
@@ -93,7 +92,7 @@ public async Task UpdateDocumentMetadata(
///
[HttpGet("storage/{mayanDocumentId}/files/{mayanFileId}/download-wrapped")]
[HasPermission(Permissions.DocumentView)]
- [ProducesResponseType(typeof(ExternalResult), 200)]
+ [ProducesResponseType(typeof(ExternalResponse), 200)]
[SwaggerOperation(Tags = new[] { "storage-documents" })]
public async Task DownloadWrappedFile(long mayanDocumentId, long mayanFileId)
{
@@ -127,7 +126,7 @@ public async Task DownloadFile(long mayanDocumentId, long mayanFi
[HttpGet("storage")]
[HasPermission(Permissions.DocumentView)]
[Produces("application/json")]
- [ProducesResponseType(typeof(ExternalResult>), 200)]
+ [ProducesResponseType(typeof(ExternalResponse>), 200)]
[SwaggerOperation(Tags = new[] { "storage-documents" })]
public IActionResult GetDocumentList()
{
@@ -140,7 +139,7 @@ public IActionResult GetDocumentList()
///
[HttpGet("storage/types")]
[HasPermission(Permissions.DocumentView)]
- [ProducesResponseType(typeof(ExternalResult>), 200)]
+ [ProducesResponseType(typeof(ExternalResponse>), 200)]
[SwaggerOperation(Tags = new[] { "storage-documents" })]
public IActionResult GetDocumentStorageTypes()
{
@@ -153,7 +152,7 @@ public IActionResult GetDocumentStorageTypes()
///
[HttpGet("storage/types/{mayanDocumentTypeId}/metadata")]
[HasPermission(Permissions.DocumentAdd)]
- [ProducesResponseType(typeof(ExternalResult>), 200)]
+ [ProducesResponseType(typeof(ExternalResponse>), 200)]
[SwaggerOperation(Tags = new[] { "storage-documents" })]
public async Task GetDocumentStorageTypeMetadata(long mayanDocumentTypeId)
{
@@ -166,7 +165,7 @@ public async Task GetDocumentStorageTypeMetadata(long mayanDocume
///
[HttpGet("storage/{mayanDocumentId}/detail")]
[HasPermission(Permissions.DocumentView)]
- [ProducesResponseType(typeof(ExternalResult), 200)]
+ [ProducesResponseType(typeof(ExternalResponse), 200)]
[SwaggerOperation(Tags = new[] { "storage-documents" })]
public async Task GetDocumentStorageTypeDetail(long mayanDocumentId)
{
@@ -179,7 +178,7 @@ public async Task GetDocumentStorageTypeDetail(long mayanDocument
///
[HttpGet("storage/{mayanDocumentId}/download-wrapped")]
[HasPermission(Permissions.DocumentView)]
- [ProducesResponseType(typeof(ExternalResult), 200)]
+ [ProducesResponseType(typeof(ExternalResponse), 200)]
[SwaggerOperation(Tags = new[] { "storage-documents" })]
public async Task DownloadWrappedFile(long mayanDocumentId)
{
@@ -215,7 +214,7 @@ public async Task DownloadFile(long mayanDocumentId)
///
[HttpGet("storage/{mayanDocumentId}/metadata")]
[HasPermission(Permissions.DocumentView)]
- [ProducesResponseType(typeof(ExternalResult>), 200)]
+ [ProducesResponseType(typeof(ExternalResponse>), 200)]
[SwaggerOperation(Tags = new[] { "storage-documents" })]
public async Task GetDocumentMetadata(long mayanDocumentId)
{
diff --git a/source/backend/api/Areas/Documents/DocumentRelationshipController.cs b/source/backend/api/Areas/Documents/DocumentRelationshipController.cs
index dcaca9648e..dfecbca9bf 100644
--- a/source/backend/api/Areas/Documents/DocumentRelationshipController.cs
+++ b/source/backend/api/Areas/Documents/DocumentRelationshipController.cs
@@ -5,8 +5,9 @@
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Constants;
using Pims.Api.Helpers.Exceptions;
+using Pims.Api.Models.CodeTypes;
using Pims.Api.Models.Concepts.Document;
-using Pims.Api.Models.Concepts.Document.Upload;
+using Pims.Api.Models.Requests.Document.Upload;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Dal.Entities;
@@ -92,8 +93,8 @@ public IActionResult GetRelationshipDocuments(DocumentRelationType relationshipT
var mappedResearchFileDocuments = _mapper.Map>(researchFileDocuments);
return new JsonResult(mappedResearchFileDocuments);
case DocumentRelationType.AcquisitionFiles:
- var acquistionFileDocuments = _documentFileService.GetFileDocuments(FileType.Acquisition, long.Parse(parentId));
- var mappedAcquisitionFileDocuments = _mapper.Map>(acquistionFileDocuments);
+ var acquisitionFileDocuments = _documentFileService.GetFileDocuments(FileType.Acquisition, long.Parse(parentId));
+ var mappedAcquisitionFileDocuments = _mapper.Map>(acquisitionFileDocuments);
return new JsonResult(mappedAcquisitionFileDocuments);
case DocumentRelationType.Templates:
var templateDocuments = _formDocumentService.GetFormDocumentTypes(parentId);
@@ -111,6 +112,10 @@ public IActionResult GetRelationshipDocuments(DocumentRelationType relationshipT
var managementDocuments = _documentFileService.GetFileDocuments(FileType.Management, long.Parse(parentId));
var mappedPropertyActivityDocuments = _mapper.Map>(managementDocuments);
return new JsonResult(mappedPropertyActivityDocuments);
+ case DocumentRelationType.DispositionFiles:
+ var dispositionFileDocuments = _documentFileService.GetFileDocuments(FileType.Disposition, long.Parse(parentId));
+ var mappedDispositionFileDocuments = _mapper.Map>(dispositionFileDocuments);
+ return new JsonResult(mappedDispositionFileDocuments);
default:
throw new BadRequestException("Relationship type not valid for retrieve.");
}
@@ -141,6 +146,7 @@ public async Task UploadDocumentWithParent(
DocumentRelationType.Projects => await _documentFileService.UploadProjectDocumentAsync(long.Parse(parentId), uploadRequest),
DocumentRelationType.Leases => await _documentFileService.UploadLeaseDocumentAsync(long.Parse(parentId), uploadRequest),
DocumentRelationType.ManagementFiles => await _documentFileService.UploadPropertyActivityDocumentAsync(long.Parse(parentId), uploadRequest),
+ DocumentRelationType.DispositionFiles => await _documentFileService.UploadDispositionDocumentAsync(long.Parse(parentId), uploadRequest),
_ => throw new BadRequestException("Relationship type not valid for upload."),
};
@@ -186,6 +192,10 @@ public async Task DeleteDocumentRelationship(DocumentRelationType
var propertyActivityRelationship = _mapper.Map(model);
var propertyActivityResult = await _documentFileService.DeletePropertyActivityDocumentAsync(propertyActivityRelationship);
return new JsonResult(propertyActivityResult);
+ case DocumentRelationType.DispositionFiles:
+ var dispositionRelationship = _mapper.Map(model);
+ var dispositionResult = await _documentFileService.DeleteDispositionDocumentAsync(dispositionRelationship);
+ return new JsonResult(dispositionResult);
default:
throw new BadRequestException("Relationship type not valid for delete.");
}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestOrganizationMap.cs b/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestOrganizationMap.cs
index 51e794e82f..215632d77a 100644
--- a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestOrganizationMap.cs
+++ b/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestOrganizationMap.cs
@@ -12,11 +12,11 @@ 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();
+ .Inherits, BaseAuditModel>();
config.NewConfig()
.Map(dest => dest.OrganizationId, src => src.Id)
- .Inherits();
+ .Inherits>();
}
}
}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestUserMap.cs b/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestUserMap.cs
index 65ee21d172..b5fd8c1e6c 100644
--- a/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestUserMap.cs
+++ b/source/backend/api/Areas/Keycloak/Mapping/AccessRequest/AccessRequestUserMap.cs
@@ -16,7 +16,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.Surname, src => src.Person.Surname)
.Map(dest => dest.Email, src => src.Person.GetWorkEmail())
.Map(dest => dest.UserTypeCode, src => src.UserTypeCode)
- .Inherits();
+ .Inherits, BaseAuditModel>();
}
}
}
diff --git a/source/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs b/source/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs
index ced398b2b3..149f7b486f 100644
--- a/source/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs
+++ b/source/backend/api/Areas/Keycloak/Mapping/User/UserMap.cs
@@ -23,7 +23,7 @@ public void Register(TypeAdapterConfig config)
.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();
+ .Inherits, BaseAuditModel>();
config.NewConfig()
.Map(dest => dest.Internal_Id, src => src.Id)
@@ -35,7 +35,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.Person.Surname, src => src.Surname)
.Map(dest => dest.PimsUserOrganizations, src => src.Organizations)
.Map(dest => dest.PimsUserRoles, src => src.Roles)
- .Inherits();
+ .Inherits>();
config.NewConfig()
.Map(dest => dest.Username, src => src.BusinessIdentifierValue)
diff --git a/source/backend/api/Areas/Leases/Models/Search/LeaseFilterModel.cs b/source/backend/api/Areas/Leases/Models/Search/LeaseFilterModel.cs
index 4795101b46..8671582b0c 100644
--- a/source/backend/api/Areas/Leases/Models/Search/LeaseFilterModel.cs
+++ b/source/backend/api/Areas/Leases/Models/Search/LeaseFilterModel.cs
@@ -47,12 +47,12 @@ public class LeaseFilterModel : PageFilter
///
/// get/set - The expiry filter start date.
///
- public DateTime? ExpiryStartDate { get; set; }
+ public DateOnly? ExpiryStartDate { get; set; }
///
/// get/set - The expiry filter end date.
///
- public DateTime? ExpiryEndDate { get; set; }
+ public DateOnly? ExpiryEndDate { get; set; }
///
/// get/set - The region type.
@@ -91,8 +91,8 @@ public LeaseFilterModel(Dictionary()
.Map(dest => dest.Id, src => src.LeaseId)
.Map(dest => dest.LFileNo, src => src.LFileNo)
- .Map(dest => dest.ExpiryDate, src => src.GetExpiryDate())
+ .Map(dest => dest.ExpiryDate, src => src.GetExpiryDate().ToNullableDateOnly())
.Map(dest => dest.ProgramName, src => src.GetProgramName())
.Map(dest => dest.TenantNames, src => src.PimsLeaseTenants.Select(t => t.GetTenantName()))
.Map(dest => dest.Properties, src => src.GetProperties())
diff --git a/source/backend/api/Areas/Leases/Models/Search/LeaseModel.cs b/source/backend/api/Areas/Leases/Models/Search/LeaseModel.cs
index dec586fc34..85ef14b664 100644
--- a/source/backend/api/Areas/Leases/Models/Search/LeaseModel.cs
+++ b/source/backend/api/Areas/Leases/Models/Search/LeaseModel.cs
@@ -21,7 +21,7 @@ public class LeaseModel
///
/// get/set - The expiry date time.
///
- public DateTime? ExpiryDate { get; set; }
+ public DateOnly? ExpiryDate { get; set; }
///
/// get/set - The value of the program name.
@@ -41,7 +41,7 @@ public class LeaseModel
///
/// get/set - The status of this lease.
///
- public TypeModel StatusType { get; set; }
+ public CodeTypeModel StatusType { get; set; }
#endregion
}
}
diff --git a/source/backend/api/Areas/Property/Controllers/SearchController.cs b/source/backend/api/Areas/Property/Controllers/SearchController.cs
index 9a17ac2c55..649d8b55e3 100644
--- a/source/backend/api/Areas/Property/Controllers/SearchController.cs
+++ b/source/backend/api/Areas/Property/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.Property;
using Pims.Api.Policies;
using Pims.Dal.Entities.Models;
using Pims.Dal.Repositories;
@@ -57,7 +58,7 @@ public SearchController(IPropertyRepository propertyRepository, IMapper mapper)
[HttpGet]
[HasPermission(Permissions.PropertyView)]
[Produces("application/json")]
- [ProducesResponseType(typeof(PageModel), 200)]
+ [ProducesResponseType(typeof(PageModel), 200)]
[SwaggerOperation(Tags = new[] { "property" })]
public IActionResult GetProperties()
{
@@ -74,7 +75,7 @@ public IActionResult GetProperties()
[HttpPost("filter")]
[HasPermission(Permissions.PropertyView)]
[Produces("application/json")]
- [ProducesResponseType(typeof(PageModel), 200)]
+ [ProducesResponseType(typeof(PageModel), 200)]
[SwaggerOperation(Tags = new[] { "property" })]
public IActionResult GetProperties([FromBody] PropertyFilterModel filter)
{
@@ -85,7 +86,7 @@ public IActionResult GetProperties([FromBody] PropertyFilterModel filter)
}
var page = _propertyRepository.GetPage((PropertyFilter)filter);
- var result = _mapper.Map>(page);
+ var result = _mapper.Map>(page);
return new JsonResult(result);
}
diff --git a/source/backend/api/Areas/Property/Mapping/Property/AssociationMap.cs b/source/backend/api/Areas/Property/Mapping/Property/AssociationMap.cs
index 7bfc22db46..322c662a59 100644
--- a/source/backend/api/Areas/Property/Mapping/Property/AssociationMap.cs
+++ b/source/backend/api/Areas/Property/Mapping/Property/AssociationMap.cs
@@ -14,7 +14,8 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.Pid, src => src.Pid)
.Map(dest => dest.LeaseAssociations, src => src.PimsPropertyLeases)
.Map(dest => dest.ResearchAssociations, src => src.PimsPropertyResearchFiles)
- .Map(dest => dest.AcquisitionAssociations, src => src.PimsPropertyAcquisitionFiles);
+ .Map(dest => dest.AcquisitionAssociations, src => src.PimsPropertyAcquisitionFiles)
+ .Map(dest => dest.DispositionAssociations, src => src.PimsDispositionFileProperties);
config.NewConfig()
.Map(dest => dest.Id, src => src.LeaseId)
@@ -42,6 +43,15 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.CreatedByGuid, src => src.AcquisitionFile.AppCreateUserGuid)
.Map(dest => dest.CreatedDateTime, src => src.AcquisitionFile.AppCreateTimestamp)
.Map(dest => dest.Status, src => src.AcquisitionFile.AcquisitionFileStatusTypeCodeNavigation.Description);
+
+ config.NewConfig()
+ .Map(dest => dest.Id, src => src.DispositionFileId)
+ .Map(dest => dest.FileNumber, src => "D-" + src.DispositionFile.FileNumber)
+ .Map(dest => dest.FileName, src => src.DispositionFile.FileName)
+ .Map(dest => dest.CreatedBy, src => src.DispositionFile.AppCreateUserid)
+ .Map(dest => dest.CreatedByGuid, src => src.DispositionFile.AppCreateUserGuid)
+ .Map(dest => dest.CreatedDateTime, src => src.DispositionFile.AppCreateTimestamp)
+ .Map(dest => dest.Status, src => src.DispositionFile.DispositionFileStatusTypeCodeNavigation.Description);
}
}
}
diff --git a/source/backend/api/Areas/Property/Mapping/Search/AddressMap.cs b/source/backend/api/Areas/Property/Mapping/Search/AddressMap.cs
deleted file mode 100644
index f386b1e0b8..0000000000
--- a/source/backend/api/Areas/Property/Mapping/Search/AddressMap.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Property.Models.Search;
-
-namespace Pims.Api.Areas.Property.Mapping.Search
-{
- 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.StreetAddress1)
- .Map(dest => dest.StreetAddress2, src => src.StreetAddress2)
- .Map(dest => dest.StreetAddress3, src => src.StreetAddress3)
- .Map(dest => dest.Municipality, src => src.MunicipalityName)
- .Map(dest => dest.RegionId, src => src.RegionCode)
- .Map(dest => dest.Region, src => src.RegionCodeNavigation.RegionName)
- .Map(dest => dest.DistrictId, src => src.DistrictCode)
- .Map(dest => dest.District, src => src.DistrictCodeNavigation.DistrictName)
- .Map(dest => dest.ProvinceId, src => src.ProvinceStateId)
- .Map(dest => dest.Province, src => src.ProvinceState.ProvinceStateCode)
- .Map(dest => dest.CountryId, src => src.CountryId)
- .Map(dest => dest.Country, src => src.Country.CountryCode)
- .Map(dest => dest.Postal, src => src.PostalCode);
- }
- }
-}
diff --git a/source/backend/api/Areas/Property/Mapping/Search/PropertyMap.cs b/source/backend/api/Areas/Property/Mapping/Search/PropertyMap.cs
deleted file mode 100644
index 15f8811700..0000000000
--- a/source/backend/api/Areas/Property/Mapping/Search/PropertyMap.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-namespace Pims.Api.Areas.Property.Mapping.Search
-{
- using System.Linq;
- using Mapster;
- using Entity = Pims.Dal.Entities;
- using Model = Pims.Api.Areas.Property.Models.Search;
-
- public class PropertyMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.PropertyId)
- .Map(dest => dest.RowVersion, src => src.ConcurrencyControlNumber)
- .Map(dest => dest.PID, src => src.ParcelIdentity)
- .Map(dest => dest.PIN, src => src.Pin)
- .Map(dest => dest.PropertyTypeId, src => src.PropertyTypeCode)
- .Map(dest => dest.PropertyType, src => src.PropertyTypeCodeNavigation.Description)
- .Map(dest => dest.StatusId, src => src.PropertyStatusTypeCode)
- .Map(dest => dest.Status, src => src.PropertyStatusTypeCodeNavigation.Description)
- .Map(dest => dest.DataSourceId, src => src.PropertyDataSourceTypeCode)
- .Map(dest => dest.DataSource, src => src.PropertyDataSourceTypeCodeNavigation.Description)
- .Map(dest => dest.DataSourceEffectiveDate, src => src.PropertyDataSourceEffectiveDate)
- .Map(dest => dest.ClassificationId, src => src.PropertyClassificationTypeCode)
- .Map(dest => dest.Classification, src => src.PropertyClassificationTypeCodeNavigation.Description)
- .Map(dest => dest.Tenure, src => string.Join(", ", src.PimsPropPropTenureTypes.Select(tt => tt.PropertyTenureTypeCodeNavigation.Description)))
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsSensitive, src => src.IsSensitive)
-
- .Map(dest => dest.AreaUnitId, src => src.PropertyAreaUnitTypeCode)
- .Map(dest => dest.AreaUnit, src => src.PropertyAreaUnitTypeCodeNavigation.Description)
- .Map(dest => dest.LandArea, src => src.LandArea)
- .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription)
- .Map(dest => dest.Zoning, src => src.Zoning)
- .Map(dest => dest.ZoningPotential, src => src.ZoningPotential)
-
- .Map(dest => dest.Latitude, src => src.Location.Coordinate.Y)
- .Map(dest => dest.Longitude, src => src.Location.Coordinate.X)
-
- .Map(dest => dest.AddressId, src => src.AddressId)
- .Map(dest => dest.Address, src => src.Address)
- .Map(dest => dest.RegionId, src => src.RegionCode)
- .Map(dest => dest.Region, src => src.RegionCodeNavigation != null ? src.RegionCodeNavigation.RegionName : null)
- .Map(dest => dest.DistrictId, src => src.DistrictCode)
- .Map(dest => dest.District, src => src.DistrictCodeNavigation != null ? src.DistrictCodeNavigation.DistrictName : null);
- }
- }
-}
diff --git a/source/backend/api/Areas/Property/Models/Property/PropertyAssociationModel.cs b/source/backend/api/Areas/Property/Models/Property/PropertyAssociationModel.cs
index c1f39699f9..b545cd23fb 100644
--- a/source/backend/api/Areas/Property/Models/Property/PropertyAssociationModel.cs
+++ b/source/backend/api/Areas/Property/Models/Property/PropertyAssociationModel.cs
@@ -13,5 +13,7 @@ public class PropertyAssociationModel
public IList ResearchAssociations { get; set; }
public IList AcquisitionAssociations { get; set; }
+
+ public IList DispositionAssociations { get; set; }
}
}
diff --git a/source/backend/api/Areas/Property/Models/Search/AddressModel.cs b/source/backend/api/Areas/Property/Models/Search/AddressModel.cs
deleted file mode 100644
index 40d2478123..0000000000
--- a/source/backend/api/Areas/Property/Models/Search/AddressModel.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-namespace Pims.Api.Areas.Property.Models.Search
-{
- ///
- /// AddressModel class, provides a model to represent the address of a property.
- ///
- public class AddressModel
- {
- #region Properties
-
- ///
- /// get/set - The primary key to identify the property.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The concurrency row version.
- ///
- public long RowVersion { get; set; }
-
- ///
- /// get/set - Foreign key to the address type.
- ///
- public string AddressTypeId { get; set; }
-
- ///
- /// get/set - The address type description.
- ///
- public string 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 - Foreign key to the region.
- ///
- public int? RegionId { get; set; }
-
- ///
- /// get/set - The name of the region.
- ///
- public string Region { get; set; }
-
- ///
- /// get/set - Foreign key to the district.
- ///
- public int? DistrictId { get; set; }
-
- ///
- /// get/set - The name of the district.
- ///
- public string District { get; set; }
-
- ///
- /// get/set - The name of the municipality name.
- ///
- public string Municipality { get; set; }
-
- ///
- /// get/set - Foreign key to the province.
- ///
- public int ProvinceId { get; set; }
-
- ///
- /// get/set - The name of the province.
- ///
- public string Province { get; set; }
-
- ///
- /// get/set - Foreign key to country.
- ///
- public int CountryId { get; set; }
-
- ///
- /// get/set - The name of the country.
- ///
- public string Country { get; set; }
-
- ///
- /// get/set - The postal code.
- ///
- public string Postal { get; set; }
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Property/Models/Search/PropertyFilterModel.cs b/source/backend/api/Areas/Property/Models/Search/PropertyFilterModel.cs
index 35d1c0d3a3..4a5e304b30 100644
--- a/source/backend/api/Areas/Property/Models/Search/PropertyFilterModel.cs
+++ b/source/backend/api/Areas/Property/Models/Search/PropertyFilterModel.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using Pims.Core.Extensions;
using Pims.Dal.Entities.Models;
@@ -27,6 +28,11 @@ public class PropertyFilterModel : PageFilter
///
public string PlanNumber { get; set; }
+ ///
+ /// get/set - The property ownership status.
+ ///
+ public IList Ownership { get; set; }
+
#endregion
#region Constructors
@@ -49,10 +55,32 @@ public PropertyFilterModel(Dictionary(query, StringComparer.OrdinalIgnoreCase);
this.Sort = filter.GetStringArrayValue(nameof(this.Sort));
+ var tempSort = this.Sort.ToList();
+
+ // Convert sort to db format
+ for (int i = 0; i < this.Sort.Length; i++)
+ {
+ if (tempSort[i].StartsWith("Location"))
+ {
+ tempSort[i] = tempSort[i].Replace("Location", "Address.MunicipalityName");
+ }
+ if (tempSort[i].StartsWith("Ownership"))
+ {
+ // The order will affect the display in the frontend. For now in alphabetical order.
+ // i.e. [Core Inventory, Disposed, Other Interest, Property of Interest]
+ var direction = this.Sort[i].Split(' ')[1];
+ tempSort[i] = this.Sort[i].Replace("Ownership", "IsOwned");
+ tempSort.Add($"IsDisposed {direction}");
+ tempSort.Add($"IsOtherInterest {direction}");
+ tempSort.Add($"IsPropertyOfInterest {direction}");
+ }
+ }
+ this.Sort = tempSort.ToArray();
this.PinOrPid = filter.GetStringValue(nameof(this.PinOrPid));
this.Address = filter.GetStringValue(nameof(this.Address));
this.PlanNumber = filter.GetStringValue(nameof(this.PlanNumber));
+ this.Ownership = filter.GetStringArrayValue(nameof(this.Ownership));
}
#endregion
@@ -73,6 +101,7 @@ public static explicit operator PropertyFilter(PropertyFilterModel model)
PinOrPid = model.PinOrPid,
Address = model.Address,
PlanNumber = model.PlanNumber,
+ Ownership = model.Ownership,
};
return filter;
diff --git a/source/backend/api/Areas/Property/Models/Search/PropertyModel.cs b/source/backend/api/Areas/Property/Models/Search/PropertyModel.cs
deleted file mode 100644
index c60ab29bc0..0000000000
--- a/source/backend/api/Areas/Property/Models/Search/PropertyModel.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Property.Models.Search
-{
- ///
- /// PropertyModel class, provides a model to represent the property whether Land or Building.
- ///
- public class PropertyModel
- {
- #region Properties
- #region Identification
-
- ///
- /// get/set - The primary key to identify the property.
- ///
- public long Id { get; set; }
-
- ///
- /// get/set - The concurrency row version.
- ///
- public long RowVersion { get; set; }
-
- ///
- /// get/set - The foreign key to the property type.
- ///
- public string PropertyTypeId { get; set; }
-
- ///
- /// get/set - The property type description.
- ///
- public string PropertyType { get; set; }
-
- ///
- /// get/set - The foreign key to the status type.
- ///
- public string StatusId { get; set; }
-
- ///
- /// get/set - The status description.
- ///
- public string Status { get; set; }
-
- ///
- /// get/set - The foreign key to the data source type.
- ///
- public string DataSourceId { get; set; }
-
- ///
- /// get/set - The data source description.
- ///
- public string DataSource { get; set; }
-
- ///
- /// get/set - The data source effective date.
- ///
- public DateTime DataSourceEffectiveDate { get; set; }
-
- ///
- /// get/set - The foreign key to the classification type.
- ///
- public string ClassificationId { get; set; }
-
- ///
- /// get/set - The classification description.
- ///
- public string Classification { get; set; }
-
- ///
- /// get/set - The foreign key to the tenure type.
- ///
- public string TenureId { get; set; }
-
- ///
- /// get/set - The tenure description.
- ///
- public string Tenure { get; set; }
-
- ///
- /// get/set - The GIS latitude location of the property.
- ///
- public double? Latitude { get; set; }
-
- ///
- /// get/set - The GIS latitude location of the property.
- ///
- public double? Longitude { get; set; }
-
- ///
- /// get/set - The property name.
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - The property description.
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - Whether the property is sensitive data.
- ///
- public bool IsSensitive { get; set; }
- #endregion
-
- #region Address
-
- ///
- /// get/set - The foreign key to the address.
- ///
- public long AddressId { get; set; }
-
- ///
- /// get/set - The address of the property.
- ///
- public AddressModel Address { get; set; }
-
- ///
- /// get/set - Foreign key to the region.
- ///
- public int RegionId { get; set; }
-
- ///
- /// get/set - The name of the region.
- ///
- public string Region { get; set; }
-
- ///
- /// get/set - Foreign key to the district.
- ///
- public int DistrictId { get; set; }
-
- ///
- /// get/set - The name of the district.
- ///
- public string District { get; set; }
- #endregion
-
- #region Parcel Properties
-
- ///
- /// get/set - A unique identifier for the titled parcel.
- ///
- public string PID { get; set; }
-
- ///
- /// get/set - A unique identifier for an untitled parcel.
- ///
- public string PIN { get; set; }
-
- ///
- /// get/set - Foreign key to the area unit type.
- ///
- public string AreaUnitId { get; set; }
-
- ///
- /// get/set - Area Unit name.
- ///
- public string AreaUnit { get; set; }
-
- ///
- /// get/set - The land area of the parcel.
- ///
- public float LandArea { get; set; }
-
- ///
- /// get/set - The land legal description of the parcel.
- ///
- public string LandLegalDescription { get; set; }
-
- ///
- /// get/set - The property zoning name.
- ///
- public string Zoning { get; set; }
-
- ///
- /// get/set - The property zoning potential.
- ///
- public string ZoningPotential { get; set; }
- #endregion
- #endregion
- }
-}
diff --git a/source/backend/api/Areas/Reports/Controllers/DispositionController.cs b/source/backend/api/Areas/Reports/Controllers/DispositionController.cs
new file mode 100644
index 0000000000..33ebcfa3cc
--- /dev/null
+++ b/source/backend/api/Areas/Reports/Controllers/DispositionController.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Security.Claims;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using Pims.Api.Areas.Disposition.Models.Search;
+using Pims.Api.Helpers.Constants;
+using Pims.Api.Helpers.Exceptions;
+using Pims.Api.Helpers.Extensions;
+using Pims.Api.Helpers.Reporting;
+using Pims.Api.Policies;
+using Pims.Api.Services;
+using Pims.Core.Extensions;
+using Pims.Dal.Entities.Models;
+using Pims.Dal.Security;
+using Swashbuckle.AspNetCore.Annotations;
+
+namespace Pims.Api.Areas.Reports.Controllers
+{
+ ///
+ /// DispositionController class, provides endpoints for generating reports.
+ ///
+ [Authorize]
+ [ApiController]
+ [Area("reports")]
+ [ApiVersion("1.0")]
+ [Route("v{version:apiVersion}/[area]/Disposition")]
+ [Route("[area]/Disposition")]
+ public class DispositionController : ControllerBase
+ {
+ #region Variables
+ private readonly IDispositionFileService _dispositionFileService;
+ private readonly ClaimsPrincipal _user;
+ private readonly ILogger _logger;
+ #endregion
+
+ #region Constructors
+
+ ///
+ /// Creates a new instance of a DispositionController class, initializes it with the specified arguments.
+ ///
+ ///
+ ///
+ ///
+ public DispositionController(IDispositionFileService dispositionFileService, ClaimsPrincipal user, ILogger logger)
+ {
+ _dispositionFileService = dispositionFileService;
+ _user = user;
+ _logger = logger;
+ }
+ #endregion
+
+ #region endpoints
+
+ ///
+ /// Get the Excel Report for Disposition Files.
+ ///
+ ///
+ /// Excel File Blob that matches filter criteria.
+ [HttpGet]
+ [HasPermission(Permissions.DispositionView)]
+ [Produces(ContentTypes.CONTENTTYPEEXCELX)]
+ [ProducesResponseType(200)]
+ [ProducesResponseType(204)]
+ [SwaggerOperation(Tags = new[] { "Dispositionfile", "report" })]
+ public IActionResult ExportDispositionFiles([FromQuery] DispositionFilterModel filter)
+ {
+ _logger.LogInformation(
+ "Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
+ nameof(DispositionController),
+ nameof(ExportDispositionFiles),
+ _user.GetUsername(),
+ DateTime.Now);
+
+ _logger.LogInformation("Dispatching to service: {Service}", _dispositionFileService.GetType());
+
+ filter.ThrowBadRequestIfNull($"The request must include a filter.");
+ if (!filter.IsValid())
+ {
+ throw new BadRequestException("Disposition files filter must contain valid values.");
+ }
+
+ var acceptHeader = (string)Request.Headers["Accept"];
+ if (acceptHeader != ContentTypes.CONTENTTYPEEXCEL && acceptHeader != ContentTypes.CONTENTTYPEEXCELX)
+ {
+ throw new BadRequestException($"Invalid HTTP request header 'Accept:{acceptHeader}'.");
+ }
+
+ var dispositionFileData = _dispositionFileService.GetDispositionFileExport((DispositionFilter)filter);
+ if (dispositionFileData.Count.Equals(0))
+ {
+ return NoContent();
+ }
+
+ return ReportHelper.GenerateExcel(dispositionFileData, "Disposition File Export");
+ }
+ #endregion
+ }
+}
diff --git a/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs b/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
index 0c18e83e7e..bc0eac6126 100644
--- a/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
+++ b/source/backend/api/Areas/Reports/Mapping/Lease/LeaseMap.cs
@@ -22,10 +22,10 @@ private static void MapLease((Entity.PimsLeaseTerm term, Entity.PimsLease lease,
{
dest.LFileNo = src.lease.LFileNo;
dest.MotiRegion = src.lease.RegionCodeNavigation?.RegionName;
- dest.StartDate = src.lease.OrigStartDate.FilterSqlMinDate();
- dest.EndDate = src.lease.OrigExpiryDate?.FilterSqlMinDate();
- dest.CurrentTermStartDate = src.lease.GetCurrentTermStartDate()?.FilterSqlMinDate();
- dest.CurrentTermEndDate = src.lease.GetCurrentTermEndDate()?.FilterSqlMinDate();
+ dest.StartDate = src.lease.OrigStartDate.FilterSqlMinDate().ToNullableDateOnly();
+ dest.EndDate = src.lease.OrigExpiryDate?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.CurrentTermStartDate = src.lease.GetCurrentTermStartDate()?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.CurrentTermEndDate = src.lease.GetCurrentTermEndDate()?.FilterSqlMinDate().ToNullableDateOnly();
dest.ProgramName = src.lease.LeaseProgramTypeCodeNavigation?.GetTypeDescriptionOther(src.lease.OtherLeaseProgramType);
dest.PurposeType = src.lease.LeasePurposeTypeCodeNavigation?.GetTypeDescriptionOther(src.lease.OtherLeasePurposeType);
dest.StatusType = src.lease.LeaseStatusTypeCodeNavigation?.Description;
@@ -38,9 +38,9 @@ private static void MapLease((Entity.PimsLeaseTerm term, Entity.PimsLease lease,
dest.LeaseNotes = src.lease.LeaseNotes;
dest.IsExpired = (src.lease.GetExpiryDate() < DateTime.Now).BoolToYesNo();
dest.LeaseAmount = src.term?.PaymentAmount;
- dest.TermStartDate = src.term?.TermStartDate.FilterSqlMinDate();
- dest.TermExpiryDate = src.term?.TermExpiryDate?.FilterSqlMinDate();
- dest.TermRenewalDate = src.term?.TermRenewalDate?.FilterSqlMinDate();
+ dest.TermStartDate = src.term?.TermStartDate.FilterSqlMinDate().ToNullableDateOnly();
+ dest.TermExpiryDate = src.term?.TermExpiryDate?.FilterSqlMinDate().ToNullableDateOnly();
+ dest.TermRenewalDate = src.term?.TermRenewalDate?.FilterSqlMinDate().ToNullableDateOnly();
dest.LeasePaymentFrequencyType = src.term?.LeasePmtFreqTypeCodeNavigation?.Description;
dest.CivicAddress = src.property?.Property?.Address?.FormatAddress(true);
dest.Pid = src.property?.Property?.Pid;
diff --git a/source/backend/api/Areas/Reports/Mapping/User/UserMap.cs b/source/backend/api/Areas/Reports/Mapping/User/UserMap.cs
index e74e26271a..f74c83596c 100644
--- a/source/backend/api/Areas/Reports/Mapping/User/UserMap.cs
+++ b/source/backend/api/Areas/Reports/Mapping/User/UserMap.cs
@@ -23,7 +23,7 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.UserType, src => src.UserTypeCodeNavigation.Description)
.Map(dest => dest.ApprovedBy, src => src.ApprovedById)
.Map(dest => dest.IssueOn, src => src.IssueDate)
- .Inherits();
+ .Inherits, BaseAuditModel>();
}
}
}
diff --git a/source/backend/api/Areas/Reports/Models/Acquisition/AgreementReportModel.cs b/source/backend/api/Areas/Reports/Models/Acquisition/AgreementReportModel.cs
index 0e2b68996e..8d2084a7e0 100644
--- a/source/backend/api/Areas/Reports/Models/Acquisition/AgreementReportModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Acquisition/AgreementReportModel.cs
@@ -85,7 +85,7 @@ public AgreementReportModel(PimsAgreement agreement, ClaimsPrincipal user)
FileCreatedDate = GetNullableDate(agreement.AcquisitionFile?.AppCreateTimestamp);
FileStatus = agreement.AcquisitionFile?.AcquisitionFileStatusTypeCodeNavigation?.Description;
- // AgreementStatus = !agreement.IsDraft.HasValue || agreement.IsDraft.Value ? "Draft" : "Final"; TODO: Fix this
+ AgreementStatus = agreement.AgreementStatusTypeCodeNavigation?.Description ?? string.Empty;
LegalSurveyPlan = agreement.LegalSurveyPlanNum;
AgreementType = agreement.AgreementTypeCodeNavigation?.Description ?? string.Empty;
AgreementDate = GetNullableDate(agreement.AgreementDate);
@@ -121,6 +121,11 @@ 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)
+ {
+ return dateTime.HasValue ? dateTime.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) : string.Empty;
+ }
+
private static string GetMinistryProjectName(PimsProject project)
{
if (project == null)
diff --git a/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportModel.cs b/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportModel.cs
index 692e25cfb9..38d2b3b24a 100644
--- a/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Acquisition/CompensationFinancialReportModel.cs
@@ -150,6 +150,11 @@ 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)
+ {
+ return dateTime.HasValue ? dateTime.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture) : string.Empty;
+ }
+
private static string GetMinistryProjectName(PimsProject project)
{
if (project == null)
diff --git a/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs b/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
index aff9504de1..57637c6589 100644
--- a/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
+++ b/source/backend/api/Areas/Reports/Models/Lease/LeaseModel.cs
@@ -19,19 +19,19 @@ public class LeaseModel
[DisplayName("Start Date")]
[CsvHelper.Configuration.Attributes.Name("Start Date")]
- public DateTime? StartDate { get; set; }
+ public DateOnly? StartDate { get; set; }
[DisplayName("End Date")]
[CsvHelper.Configuration.Attributes.Name("End Date")]
- public DateTime? EndDate { get; set; }
+ public DateOnly? EndDate { get; set; }
[DisplayName("Current Term Start Date")]
[CsvHelper.Configuration.Attributes.Name("Current Term Start Date")]
- public DateTime? CurrentTermStartDate { get; set; }
+ public DateOnly? CurrentTermStartDate { get; set; }
[DisplayName("Current Term End Date")]
[CsvHelper.Configuration.Attributes.Name("Current Term End Date")]
- public DateTime? CurrentTermEndDate { get; set; }
+ public DateOnly? CurrentTermEndDate { get; set; }
[DisplayName("Tenant")]
[CsvHelper.Configuration.Attributes.Name("Tenant")]
@@ -79,15 +79,15 @@ public class LeaseModel
[DisplayName("Term Start Date")]
[CsvHelper.Configuration.Attributes.Name("Term Start Date")]
- public DateTime? TermStartDate { get; set; }
+ public DateOnly? TermStartDate { get; set; }
[DisplayName("Term Renewal Date")]
[CsvHelper.Configuration.Attributes.Name("Term Renewal Date")]
- public DateTime? TermRenewalDate { get; set; }
+ public DateOnly? TermRenewalDate { get; set; }
[DisplayName("Term Expiry Date")]
[CsvHelper.Configuration.Attributes.Name("Term Expiry Date")]
- public DateTime? TermExpiryDate { get; set; }
+ public DateOnly? TermExpiryDate { get; set; }
[DisplayName("Lease Payment Frequency")]
[CsvHelper.Configuration.Attributes.Name("Lease Payment Frequency")]
diff --git a/source/backend/api/Constants/DispositionStatusTypes.cs b/source/backend/api/Constants/DispositionStatusTypes.cs
new file mode 100644
index 0000000000..46c97dcf88
--- /dev/null
+++ b/source/backend/api/Constants/DispositionStatusTypes.cs
@@ -0,0 +1,30 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+
+namespace Pims.Api.Constants
+{
+ [JsonConverter(typeof(JsonStringEnumMemberConverter))]
+ public enum DispositionStatusTypes
+ {
+ [EnumMember(Value = "ACTIVE")]
+ ACTIVE,
+
+ [EnumMember(Value = "ARCHIVED")]
+ ARCHIVED,
+
+ [EnumMember(Value = "CANCELLED")]
+ CANCELLED,
+
+ [EnumMember(Value = "CLOSED")]
+ CLOSED,
+
+ [EnumMember(Value = "COMPLETE")]
+ COMPLETE,
+
+ [EnumMember(Value = "DRAFT")]
+ DRAFT,
+
+ [EnumMember(Value = "HOLD")]
+ HOLD,
+ }
+}
diff --git a/source/backend/api/Constants/EnumDispositionFileStatusTypeCode.cs b/source/backend/api/Constants/EnumDispositionFileStatusTypeCode.cs
new file mode 100644
index 0000000000..4f562bc2ce
--- /dev/null
+++ b/source/backend/api/Constants/EnumDispositionFileStatusTypeCode.cs
@@ -0,0 +1,25 @@
+using System.Runtime.Serialization;
+
+namespace Pims.Api.Constants
+{
+ public enum EnumDispositionFileStatusTypeCode
+ {
+ [EnumMember(Value = "ACTIVE")]
+ ACTIVE,
+
+ [EnumMember(Value = "ARCHIVED")]
+ ARCHIVED,
+
+ [EnumMember(Value = "CANCELLED")]
+ CANCELLED,
+
+ [EnumMember(Value = "COMPLETE")]
+ COMPLETE,
+
+ [EnumMember(Value = "DRAFT")]
+ DRAFT,
+
+ [EnumMember(Value = "HOLD")]
+ HOLD,
+ }
+}
diff --git a/source/backend/api/Constants/EnumDispositionOfferStatusTypeCode.cs b/source/backend/api/Constants/EnumDispositionOfferStatusTypeCode.cs
new file mode 100644
index 0000000000..3d5c9fb090
--- /dev/null
+++ b/source/backend/api/Constants/EnumDispositionOfferStatusTypeCode.cs
@@ -0,0 +1,22 @@
+using System.Runtime.Serialization;
+
+namespace Pims.Api.Constants
+{
+ public enum EnumDispositionOfferStatusTypeCode
+ {
+ [EnumMember(Value = "ACCCEPTED")]
+ ACCCEPTED,
+
+ [EnumMember(Value = "COLLAPSED")]
+ COLLAPSED,
+
+ [EnumMember(Value = "COUNTERED")]
+ COUNTERED,
+
+ [EnumMember(Value = "OPEN")]
+ OPEN,
+
+ [EnumMember(Value = "REJECTED")]
+ REJECTED,
+ }
+}
diff --git a/source/backend/api/Constants/EnumDispositionStatusTypeCode.cs b/source/backend/api/Constants/EnumDispositionStatusTypeCode.cs
new file mode 100644
index 0000000000..7345b518da
--- /dev/null
+++ b/source/backend/api/Constants/EnumDispositionStatusTypeCode.cs
@@ -0,0 +1,25 @@
+using System.Runtime.Serialization;
+
+namespace Pims.Api.Constants
+{
+ public enum EnumDispositionStatusTypeCode
+ {
+ [EnumMember(Value = "LISTED")]
+ LISTED,
+
+ [EnumMember(Value = "ONHOLD")]
+ ONHOLD,
+
+ [EnumMember(Value = "PENDING")]
+ PENDING,
+
+ [EnumMember(Value = "PREMARKET")]
+ PREMARKET,
+
+ [EnumMember(Value = "SOLD")]
+ SOLD,
+
+ [EnumMember(Value = "UNKNOWN")]
+ UNKNOWN,
+ }
+}
diff --git a/source/backend/api/Constants/FileType.cs b/source/backend/api/Constants/FileType.cs
index 7c39c621bb..cc251bc576 100644
--- a/source/backend/api/Constants/FileType.cs
+++ b/source/backend/api/Constants/FileType.cs
@@ -16,6 +16,8 @@ public enum FileType
Lease,
[EnumMember(Value = "management")]
Management,
+ [EnumMember(Value = "disposition")]
+ Disposition,
[EnumMember(Value = "unknown")] // Used in tests/logic only. This does not correspond to a valid file type in the db.
Unknown,
}
diff --git a/source/backend/api/Constants/NoteType.cs b/source/backend/api/Constants/NoteType.cs
index 558d771999..4f282bc84b 100644
--- a/source/backend/api/Constants/NoteType.cs
+++ b/source/backend/api/Constants/NoteType.cs
@@ -14,5 +14,7 @@ public enum NoteType
Project,
[EnumMember(Value = "research_file")]
Research_File,
+ [EnumMember(Value = "disposition_file")]
+ Disposition_File,
}
}
diff --git a/source/backend/api/Controllers/LookupController.cs b/source/backend/api/Controllers/LookupController.cs
index 15b399f943..c55d592765 100644
--- a/source/backend/api/Controllers/LookupController.cs
+++ b/source/backend/api/Controllers/LookupController.cs
@@ -134,6 +134,18 @@ public IActionResult GetAll()
var mgmtActivityStatusTypes = _mapper.Map(_lookupRepository.GetAllPropMgmtActivityStatusTypes());
var mgmtActivitySubtypes = _mapper.Map(_lookupRepository.GetAllPropMgmtActivitySubtypes());
var mgmtActivityTypes = _mapper.Map(_lookupRepository.GetAllPropMgmtActivityTypes());
+ var dispositionStatusTypes = _mapper.Map(_lookupRepository.GetAllDispositionStatusTypes());
+ var dispositionFileFundingTypes = _mapper.Map(_lookupRepository.GetAllDispositionFileFundingTypes());
+ var dispositionFileStatusTypes = _mapper.Map(_lookupRepository.GetAllDispositionFileStatusTypes());
+ var dispositionFlTeamProfileTypes = _mapper.Map(_lookupRepository.GetAllDispositionFlTeamProfileTypes());
+ var dispositionInitiatingBranchTypes = _mapper.Map(_lookupRepository.GetAllDispositionInitiatingBranchTypes());
+ var dispositionPhysFileStatusTypes = _mapper.Map(_lookupRepository.GetAllDispositionPhysFileStatusTypes());
+ var dispositionInitiatingDocTypes = _mapper.Map(_lookupRepository.GetAllDispositionInitiatingDocTypes());
+ var dispositionTypes = _mapper.Map(_lookupRepository.GetAllDispositionTypes());
+ var dispositionOfferStatusTypes = _mapper.Map(_lookupRepository.GetAllDispositionOfferStatusTypes());
+ var dispositionChecklistItemStatusTypes = _mapper.Map(_lookupRepository.GetAllDispositionChecklistItemStatusTypes());
+ var dispositionChecklistItemTypes = _mapper.Map(_lookupRepository.GetAllDispositionChecklistItemTypes());
+ var dispositionChecklistSectionTypes = _mapper.Map(_lookupRepository.GetAllDispositionChecklistSectionTypes());
var codes = new List
public interface IEdmsDocumentRepository
{
- Task> TryCreateDocumentTypeAsync(DocumentType documentType);
+ Task> TryCreateDocumentTypeAsync(DocumentTypeModel documentType);
- Task> TryUpdateDocumentTypeAsync(DocumentType documentType);
+ Task> TryUpdateDocumentTypeAsync(DocumentTypeModel documentType);
- Task> TryDeleteDocumentTypeAsync(long documentTypeId);
+ Task> TryDeleteDocumentTypeAsync(long documentTypeId);
- Task>> TryGetDocumentTypesAsync(string ordering = "", int? page = null, int? pageSize = null);
+ Task>> TryGetDocumentTypesAsync(string ordering = "", int? page = null, int? pageSize = null);
- Task>> TryGetDocumentTypeMetadataTypesAsync(long documentTypeId, string ordering = "", int? page = null, int? pageSize = null);
+ Task>> TryGetDocumentTypeMetadataTypesAsync(long documentTypeId, string ordering = "", int? page = null, int? pageSize = null);
- Task>> TryGetDocumentsListAsync(string ordering = "", int? page = null, int? pageSize = null);
+ Task>> TryGetDocumentsListAsync(string ordering = "", int? page = null, int? pageSize = null);
- Task>> TryGetDocumentMetadataAsync(long documentId, string ordering = "", int? page = null, int? pageSize = null);
+ Task>> TryGetDocumentMetadataAsync(long documentId, string ordering = "", int? page = null, int? pageSize = null);
- Task> TryGetDocumentAsync(long documentId);
+ Task> TryGetDocumentAsync(long documentId);
- Task> TryDownloadFileAsync(long documentId, long fileId);
+ Task> TryDownloadFileAsync(long documentId, long fileId);
- Task> TryDeleteDocument(long documentId);
+ Task> TryDeleteDocument(long documentId);
- Task> TryUploadDocumentAsync(long documentType, IFormFile file);
+ Task> TryUploadDocumentAsync(long documentType, IFormFile file);
- Task> TryCreateDocumentMetadataAsync(long documentId, long metadataTypeId, string value);
+ Task> TryCreateDocumentMetadataAsync(long documentId, long metadataTypeId, string value);
- Task> TryUpdateDocumentMetadataAsync(long documentId, long metadataId, string value);
+ Task> TryUpdateDocumentMetadataAsync(long documentId, long metadataId, string value);
- Task> TryDeleteDocumentMetadataAsync(long documentId, long metadataId);
+ Task> TryDeleteDocumentMetadataAsync(long documentId, long metadataId);
- Task> TryCreateDocumentTypeMetadataTypeAsync(long documentTypeId, long metadataTypeId, bool isRequired);
+ Task> TryCreateDocumentTypeMetadataTypeAsync(long documentTypeId, long metadataTypeId, bool isRequired);
- Task> TryUpdateDocumentTypeMetadataTypeAsync(long documentTypeId, long documentTypeMetadataTypeId, bool isRequired);
+ Task> TryUpdateDocumentTypeMetadataTypeAsync(long documentTypeId, long documentTypeMetadataTypeId, bool isRequired);
- Task> TryDeleteDocumentTypeMetadataTypeAsync(long documentTypeId, long documentTypeMetadataTypeId);
+ Task> TryDeleteDocumentTypeMetadataTypeAsync(long documentTypeId, long documentTypeMetadataTypeId);
}
}
diff --git a/source/backend/api/Repositories/Mayan/IEdmsMetadataRepository.cs b/source/backend/api/Repositories/Mayan/IEdmsMetadataRepository.cs
index b1d63fecef..7e7c4ba026 100644
--- a/source/backend/api/Repositories/Mayan/IEdmsMetadataRepository.cs
+++ b/source/backend/api/Repositories/Mayan/IEdmsMetadataRepository.cs
@@ -1,7 +1,8 @@
using System.Threading.Tasks;
-using Pims.Api.Models.Concepts.Http;
+
using Pims.Api.Models.Mayan;
using Pims.Api.Models.Mayan.Metadata;
+using Pims.Api.Models.Requests.Http;
namespace Pims.Api.Repositories.Mayan
{
@@ -10,12 +11,12 @@ namespace Pims.Api.Repositories.Mayan
///
public interface IEdmsMetadataRepository
{
- Task> TryCreateMetadataTypeAsync(MetadataType metadataType);
+ Task> TryCreateMetadataTypeAsync(MetadataTypeModel metadataType);
- Task> TryUpdateMetadataTypeAsync(MetadataType metadataType);
+ Task> TryUpdateMetadataTypeAsync(MetadataTypeModel metadataType);
- Task> TryDeleteMetadataTypeAsync(long metadataTypeId);
+ Task> TryDeleteMetadataTypeAsync(long metadataTypeId);
- Task>> TryGetMetadataTypesAsync(string ordering = "", int? page = null, int? pageSize = null);
+ Task>> TryGetMetadataTypesAsync(string ordering = "", int? page = null, int? pageSize = null);
}
}
diff --git a/source/backend/api/Repositories/Mayan/MayanAuthRepository.cs b/source/backend/api/Repositories/Mayan/MayanAuthRepository.cs
index b082eb97eb..2710e37ba4 100644
--- a/source/backend/api/Repositories/Mayan/MayanAuthRepository.cs
+++ b/source/backend/api/Repositories/Mayan/MayanAuthRepository.cs
@@ -6,10 +6,10 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
-using Pims.Api.Concepts.CodeTypes;
using Pims.Api.Helpers.Exceptions;
-using Pims.Api.Models.Concepts.Http;
+using Pims.Api.Models.CodeTypes;
using Pims.Api.Models.Mayan;
+using Pims.Api.Models.Requests.Http;
namespace Pims.Api.Repositories.Mayan
{
@@ -39,19 +39,19 @@ public async Task GetTokenAsync()
{
if (string.IsNullOrEmpty(_currentToken))
{
- ExternalResult tokenResult = await TryRequestToken();
+ ExternalResponse tokenResponse = await TryRequestToken();
- if (tokenResult.Status == ExternalResultStatus.Error)
+ if (tokenResponse.Status == ExternalResponseStatus.Error)
{
- throw new AuthenticationException(tokenResult.Message);
+ throw new AuthenticationException(tokenResponse.Message);
}
- _currentToken = tokenResult.Payload.Token;
+ _currentToken = tokenResponse.Payload.Token;
}
return _currentToken;
}
- private async Task> TryRequestToken()
+ private async Task> TryRequestToken()
{
_logger.LogDebug("Getting authentication token...");
Uri endpoint = new Uri($"{_config.BaseUri}/auth/token/obtain/");
@@ -61,7 +61,7 @@ private async Task> TryRequestToken()
Password = _config.ConnectionPassword,
}), Encoding.UTF8, MediaTypeNames.Application.Json);
- ExternalResult result = await PostAsync(endpoint, credentials);
+ ExternalResponse result = await PostAsync(endpoint, credentials);
_logger.LogDebug("Finished getting authentication token");
return result;
diff --git a/source/backend/api/Repositories/Mayan/MayanDocumentRepository.cs b/source/backend/api/Repositories/Mayan/MayanDocumentRepository.cs
index b19e06e7d8..6151ab550a 100644
--- a/source/backend/api/Repositories/Mayan/MayanDocumentRepository.cs
+++ b/source/backend/api/Repositories/Mayan/MayanDocumentRepository.cs
@@ -11,12 +11,12 @@
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
-using Pims.Api.Concepts.CodeTypes;
-using Pims.Api.Models.Concepts.Http;
-using Pims.Api.Models.Download;
+using Pims.Api.Models.CodeTypes;
+
using Pims.Api.Models.Mayan;
using Pims.Api.Models.Mayan.Document;
using Pims.Api.Models.Mayan.Metadata;
+using Pims.Api.Models.Requests.Http;
namespace Pims.Api.Repositories.Mayan
{
@@ -44,7 +44,7 @@ public MayanDocumentRepository(
_authRepository = authRepository;
}
- public async Task> TryCreateDocumentTypeAsync(DocumentType documentType)
+ public async Task> TryCreateDocumentTypeAsync(DocumentTypeModel documentType)
{
_logger.LogDebug("Creating document type...");
@@ -59,14 +59,14 @@ public async Task> TryCreateDocumentTypeAsync(Docum
Uri endpoint = new($"{_config.BaseUri}/document_types/");
- var response = await PostAsync(endpoint, content, authenticationToken);
+ var response = await PostAsync(endpoint, content, authenticationToken);
_logger.LogDebug($"Finished creating a document type");
return response;
}
- public async Task> TryUpdateDocumentTypeAsync(DocumentType documentType)
+ public async Task> TryUpdateDocumentTypeAsync(DocumentTypeModel documentType)
{
_logger.LogDebug("Updating document type...");
@@ -81,14 +81,14 @@ public async Task> TryUpdateDocumentTypeAsync(Docum
Uri endpoint = new($"{_config.BaseUri}/document_types/{documentType.Id}/");
- var response = await PutAsync(endpoint, content, authenticationToken);
+ var response = await PutAsync(endpoint, content, authenticationToken);
_logger.LogDebug($"Finished updating a document type");
return response;
}
- public async Task> TryDeleteDocumentTypeAsync(long documentTypeId)
+ public async Task> TryDeleteDocumentTypeAsync(long documentTypeId)
{
_logger.LogDebug("Deleting document type...");
@@ -102,7 +102,7 @@ public async Task> TryDeleteDocumentTypeAsync(long docume
return response;
}
- public async Task>> TryGetDocumentTypesAsync(string ordering = "", int? page = null, int? pageSize = null)
+ public async Task>> TryGetDocumentTypesAsync(string ordering = "", int? page = null, int? pageSize = null)
{
_logger.LogDebug("Retrieving document types...");
@@ -112,13 +112,13 @@ public async Task>> TryGetDocumentTypes
string authenticationToken = await _authRepository.GetTokenAsync();
- ExternalResult> response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
+ ExternalResponse> response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
_logger.LogDebug("Finished retrieving document types");
return response;
}
- public async Task>> TryGetDocumentTypeMetadataTypesAsync(long documentTypeId, string ordering = "", int? page = null, int? pageSize = null)
+ public async Task>> TryGetDocumentTypeMetadataTypesAsync(long documentTypeId, string ordering = "", int? page = null, int? pageSize = null)
{
_logger.LogDebug("Retrieving document type metadata types...");
string authenticationToken = await _authRepository.GetTokenAsync();
@@ -127,13 +127,13 @@ public async Task>> TryGetD
string endpointString = $"{this._config.BaseUri}/document_types/{documentTypeId}/metadata_types/";
Uri endpoint = new(QueryHelpers.AddQueryString(endpointString, queryParams));
- var response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
+ var response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
_logger.LogDebug("Finished retrieving document type's metadata types");
return response;
}
- public async Task>> TryGetDocumentsListAsync(string ordering = "", int? page = null, int? pageSize = null)
+ public async Task>> TryGetDocumentsListAsync(string ordering = "", int? page = null, int? pageSize = null)
{
_logger.LogDebug("Retrieving document list...");
@@ -143,26 +143,26 @@ public async Task>> TryGetDocumentsLi
string endpointString = $"{_config.BaseUri}/documents/";
Uri endpoint = new(QueryHelpers.AddQueryString(endpointString, queryParams));
- var response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
+ var response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
_logger.LogDebug("Finished retrieving document list");
return response;
}
- public async Task> TryGetDocumentAsync(long documentId)
+ public async Task> TryGetDocumentAsync(long documentId)
{
_logger.LogDebug("Retrieving document...");
string authenticationToken = await _authRepository.GetTokenAsync();
Uri endpoint = new($"{this._config.BaseUri}/documents/{documentId}/");
- var response = await GetAsync(endpoint, authenticationToken).ConfigureAwait(true);
+ var response = await GetAsync(endpoint, authenticationToken).ConfigureAwait(true);
_logger.LogDebug("Finished retrieving document");
return response;
}
- public async Task>> TryGetDocumentMetadataAsync(long documentId, string ordering = "", int? page = null, int? pageSize = null)
+ public async Task>> TryGetDocumentMetadataAsync(long documentId, string ordering = "", int? page = null, int? pageSize = null)
{
_logger.LogDebug("Retrieving document metadata...");
@@ -172,13 +172,13 @@ public async Task>> TryGetDocumentM
string endpointString = $"{_config.BaseUri}/documents/{documentId}/metadata/";
Uri endpoint = new(QueryHelpers.AddQueryString(endpointString, queryParams));
- var response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
+ var response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
_logger.LogDebug("Finished retrieving document metadata");
return response;
}
- public async Task> TryDownloadFileAsync(long documentId, long fileId)
+ public async Task> TryDownloadFileAsync(long documentId, long fileId)
{
_logger.LogDebug("Downloading file...");
string authenticationToken = await _authRepository.GetTokenAsync();
@@ -188,9 +188,9 @@ public async Task> TryDownloadFileAsync(long docume
AddAuthentication(client, authenticationToken);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaTypeNames.Application.Json));
- ExternalResult result = new ExternalResult()
+ ExternalResponse result = new ExternalResponse()
{
- Status = ExternalResultStatus.Error,
+ Status = ExternalResponseStatus.Error,
};
try
@@ -201,7 +201,7 @@ public async Task> TryDownloadFileAsync(long docume
}
catch (Exception e)
{
- result.Status = ExternalResultStatus.Error;
+ result.Status = ExternalResponseStatus.Error;
result.Message = "Exception downloading file";
_logger.LogError("Unexpected exception downloading file {e}", e);
}
@@ -210,7 +210,7 @@ public async Task> TryDownloadFileAsync(long docume
return result;
}
- public async Task> TryDeleteDocument(long documentId)
+ public async Task> TryDeleteDocument(long documentId)
{
_logger.LogDebug("Deleting document...");
_logger.LogTrace("Document id {documentId}", documentId);
@@ -225,7 +225,7 @@ public async Task> TryDeleteDocument(long documentId)
return response;
}
- public async Task> TryUploadDocumentAsync(long documentType, IFormFile file)
+ public async Task> TryUploadDocumentAsync(long documentType, IFormFile file)
{
_logger.LogDebug("Uploading document...");
string authenticationToken = await _authRepository.GetTokenAsync();
@@ -245,13 +245,13 @@ public async Task> TryUploadDocumentAsync(long do
Uri endpoint = new($"{this._config.BaseUri}/documents/upload/");
- ExternalResult result = await PostAsync(endpoint, multiContent, authenticationToken);
+ ExternalResponse result = await PostAsync(endpoint, multiContent, authenticationToken);
_logger.LogDebug($"Finished uploading file");
return result;
}
- public async Task>> TryGetMetadataTypesAsync(string ordering = "", int? page = null, int? pageSize = null)
+ public async Task>> TryGetMetadataTypesAsync(string ordering = "", int? page = null, int? pageSize = null)
{
_logger.LogDebug("Retrieving metadata types...");
string authenticationToken = await _authRepository.GetTokenAsync();
@@ -260,13 +260,13 @@ public async Task>> TryGetMetadataTypes
string endpointString = $"{_config.BaseUri}/metadata_types/";
Uri endpoint = new(QueryHelpers.AddQueryString(endpointString, queryParams));
- var response = await GetAsync>(endpoint, authenticationToken);
+ var response = await GetAsync>(endpoint, authenticationToken);
_logger.LogDebug("Finished retrieving metadata types");
return response;
}
- public async Task> TryCreateDocumentTypeMetadataTypeAsync(long documentTypeId, long metadataTypeId, bool isRequired)
+ public async Task> TryCreateDocumentTypeMetadataTypeAsync(long documentTypeId, long metadataTypeId, bool isRequired)
{
_logger.LogDebug("Creating document type's metadata type...");
@@ -278,13 +278,13 @@ public async Task> TryCreateDocumentTyp
Uri endpoint = new($"{this._config.BaseUri}/document_types/{documentTypeId}/metadata_types/");
- var response = await PostAsync(endpoint, content, authenticationToken);
+ var response = await PostAsync(endpoint, content, authenticationToken);
_logger.LogDebug($"Finished creating document type's metadata type");
return response;
}
- public async Task> TryCreateDocumentMetadataAsync(long documentId, long metadataTypeId, string value)
+ public async Task> TryCreateDocumentMetadataAsync(long documentId, long metadataTypeId, string value)
{
_logger.LogDebug("Add existing metadata type with value to an existing document");
@@ -296,13 +296,13 @@ public async Task> TryCreateDocumentMetadataAsy
Uri endpoint = new($"{this._config.BaseUri}/documents/{documentId}/metadata/");
- var response = await PostAsync(endpoint, content, authenticationToken);
+ var response = await PostAsync(endpoint, content, authenticationToken);
_logger.LogDebug($"Finished adding existing metadata value to a document");
return response;
}
- public async Task> TryUpdateDocumentMetadataAsync(long documentId, long metadataId, string value)
+ public async Task> TryUpdateDocumentMetadataAsync(long documentId, long metadataId, string value)
{
_logger.LogDebug("Update existing metadata type with value to an existing document");
@@ -314,13 +314,13 @@ public async Task> TryUpdateDocumentMetadataAsy
Uri endpoint = new($"{this._config.BaseUri}/documents/{documentId}/metadata/{metadataId}/");
- var response = await PutAsync(endpoint, content, authenticationToken);
+ var response = await PutAsync(endpoint, content, authenticationToken);
_logger.LogDebug($"Finished updating existing metadata value to a document");
return response;
}
- public async Task> TryDeleteDocumentMetadataAsync(long documentId, long metadataId)
+ public async Task> TryDeleteDocumentMetadataAsync(long documentId, long metadataId)
{
_logger.LogDebug("Delete existing metadata type from an existing document");
@@ -333,7 +333,7 @@ public async Task> TryDeleteDocumentMetadataAsync(long do
return response;
}
- public async Task> TryUpdateDocumentTypeMetadataTypeAsync(long documentTypeId, long documentTypeMetadataTypeId, bool isRequired)
+ public async Task> TryUpdateDocumentTypeMetadataTypeAsync(long documentTypeId, long documentTypeMetadataTypeId, bool isRequired)
{
_logger.LogDebug("Updating document type and metadata type...");
@@ -345,13 +345,13 @@ public async Task> TryUpdateDocumentTyp
Uri endpoint = new($"{this._config.BaseUri}/document_types/{documentTypeId}/metadata_types/{documentTypeMetadataTypeId}/");
- var response = await PutAsync(endpoint, form, authenticationToken);
+ var response = await PutAsync(endpoint, form, authenticationToken);
_logger.LogDebug($"Finished update document type with a metadata type");
return response;
}
- public async Task> TryDeleteDocumentTypeMetadataTypeAsync(long documentTypeId, long documentTypeMetadataTypeId)
+ public async Task> TryDeleteDocumentTypeMetadataTypeAsync(long documentTypeId, long documentTypeMetadataTypeId)
{
_logger.LogDebug("Deleting document type's metadata type...");
diff --git a/source/backend/api/Repositories/Mayan/MayanMetadataRepository.cs b/source/backend/api/Repositories/Mayan/MayanMetadataRepository.cs
index 20bd821af7..353539f0b5 100644
--- a/source/backend/api/Repositories/Mayan/MayanMetadataRepository.cs
+++ b/source/backend/api/Repositories/Mayan/MayanMetadataRepository.cs
@@ -7,9 +7,10 @@
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
-using Pims.Api.Models.Concepts.Http;
+
using Pims.Api.Models.Mayan;
using Pims.Api.Models.Mayan.Metadata;
+using Pims.Api.Models.Requests.Http;
namespace Pims.Api.Repositories.Mayan
{
@@ -37,7 +38,7 @@ public MayanMetadataRepository(
_authRepository = authRepository;
}
- public async Task>> TryGetMetadataTypesAsync(string ordering = "", int? page = null, int? pageSize = null)
+ public async Task>> TryGetMetadataTypesAsync(string ordering = "", int? page = null, int? pageSize = null)
{
_logger.LogDebug("Retrieving metadata types...");
@@ -47,13 +48,13 @@ public async Task>> TryGetMetadataTypes
string endpointString = $"{_config.BaseUri}/metadata_types/";
Uri endpoint = new(QueryHelpers.AddQueryString(endpointString, queryParams));
- var response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
+ var response = await GetAsync>(endpoint, authenticationToken).ConfigureAwait(true);
_logger.LogDebug("Finished retrieving metadata types");
return response;
}
- public async Task> TryCreateMetadataTypeAsync(MetadataType metadataType)
+ public async Task> TryCreateMetadataTypeAsync(MetadataTypeModel metadataType)
{
_logger.LogDebug("Creating metadata type...");
@@ -69,13 +70,13 @@ public async Task> TryCreateMetadataTypeAsync(Metad
Uri endpoint = new($"{this._config.BaseUri}/metadata_types/");
- var response = await PostAsync(endpoint, content, authenticationToken).ConfigureAwait(true);
+ var response = await PostAsync(endpoint, content, authenticationToken).ConfigureAwait(true);
this._logger.LogDebug($"Finished creating a metadata type");
return response;
}
- public async Task> TryUpdateMetadataTypeAsync(MetadataType metadataType)
+ public async Task> TryUpdateMetadataTypeAsync(MetadataTypeModel metadataType)
{
_logger.LogDebug("Updating metadata type {id}...", metadataType.Id);
@@ -91,13 +92,13 @@ public async Task> TryUpdateMetadataTypeAsync(Metad
Uri endpoint = new($"{this._config.BaseUri}/metadata_types/{metadataType.Id}/");
- var response = await PutAsync(endpoint, content, authenticationToken).ConfigureAwait(true);
+ var response = await PutAsync(endpoint, content, authenticationToken).ConfigureAwait(true);
this._logger.LogDebug($"Finished updating a metadata type", metadataType.Id);
return response;
}
- public async Task> TryDeleteMetadataTypeAsync(long metadataTypeId)
+ public async Task> TryDeleteMetadataTypeAsync(long metadataTypeId)
{
_logger.LogDebug("Deleting metadata type...");
diff --git a/source/backend/api/Repositories/RestCommon/BaseRestRepository.cs b/source/backend/api/Repositories/RestCommon/BaseRestRepository.cs
index 8c477b5fa0..dde3037db1 100644
--- a/source/backend/api/Repositories/RestCommon/BaseRestRepository.cs
+++ b/source/backend/api/Repositories/RestCommon/BaseRestRepository.cs
@@ -10,9 +10,9 @@
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
-using Pims.Api.Concepts.CodeTypes;
-using Pims.Api.Models.Concepts.Http;
-using Pims.Api.Models.Download;
+using Pims.Api.Models.CodeTypes;
+
+using Pims.Api.Models.Requests.Http;
namespace Pims.Api.Repositories.Rest
{
@@ -39,7 +39,7 @@ protected BaseRestRepository(
public abstract void AddAuthentication(HttpClient client, string authenticationToken = null);
- public async Task> GetAsync(Uri endpoint, string authenticationToken)
+ public async Task> GetAsync(Uri endpoint, string authenticationToken)
{
using HttpClient client = _httpClientFactory.CreateClient("Pims.Api.Logging");
client.DefaultRequestHeaders.Accept.Clear();
@@ -54,15 +54,15 @@ public async Task> GetAsync(Uri endpoint, string authentica
catch (Exception e)
{
_logger.LogError("Unexpected exception during Get {e}", e);
- return new ExternalResult()
+ return new ExternalResponse()
{
- Status = ExternalResultStatus.Error,
+ Status = ExternalResponseStatus.Error,
Message = "Exception during Get",
};
}
}
- public async Task> PostAsync(Uri endpoint, HttpContent content, string authenticationToken = null)
+ public async Task> PostAsync(Uri endpoint, HttpContent content, string authenticationToken = null)
{
using HttpClient client = _httpClientFactory.CreateClient("Pims.Api.Logging");
client.DefaultRequestHeaders.Accept.Clear();
@@ -78,15 +78,15 @@ public async Task> PostAsync(Uri endpoint, HttpContent cont
catch (Exception e)
{
_logger.LogError("Unexpected exception during post {e}", e);
- return new ExternalResult()
+ return new ExternalResponse()
{
- Status = ExternalResultStatus.Error,
+ Status = ExternalResponseStatus.Error,
Message = "Exception during Post",
};
}
}
- public async Task> PutAsync(Uri endpoint, HttpContent content, string authenticationToken = null)
+ public async Task> PutAsync(Uri endpoint, HttpContent content, string authenticationToken = null)
{
using HttpClient client = _httpClientFactory.CreateClient("Pims.Api.Logging");
client.DefaultRequestHeaders.Accept.Clear();
@@ -102,24 +102,24 @@ public async Task> PutAsync(Uri endpoint, HttpContent conte
catch (Exception e)
{
_logger.LogError("Unexpected exception during put {e}", e);
- return new ExternalResult()
+ return new ExternalResponse()
{
- Status = ExternalResultStatus.Error,
+ Status = ExternalResponseStatus.Error,
Message = "Exception during Put",
};
}
}
- public async Task> DeleteAsync(Uri endpoint, string authenticationToken = null)
+ public async Task> DeleteAsync(Uri endpoint, string authenticationToken = null)
{
using HttpClient client = _httpClientFactory.CreateClient("Pims.Api.Logging");
client.DefaultRequestHeaders.Accept.Clear();
AddAuthentication(client, authenticationToken);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaTypeNames.Application.Json));
- ExternalResult result = new ExternalResult()
+ ExternalResponse result = new ExternalResponse()
{
- Status = ExternalResultStatus.Error,
+ Status = ExternalResponseStatus.Error,
Payload = endpoint.AbsolutePath,
};
@@ -135,22 +135,22 @@ public async Task> DeleteAsync(Uri endpoint, string authe
{
case HttpStatusCode.OK:
_logger.LogTrace("Response payload: {payload}", payload);
- result.Status = ExternalResultStatus.Success;
+ result.Status = ExternalResponseStatus.Success;
break;
case HttpStatusCode.NoContent:
- result.Status = ExternalResultStatus.Success;
+ result.Status = ExternalResponseStatus.Success;
result.Message = "No content was returned from the call";
break;
case HttpStatusCode.Forbidden:
- result.Status = ExternalResultStatus.Error;
+ result.Status = ExternalResponseStatus.Error;
result.Message = "Request was forbidden";
break;
case HttpStatusCode.BadRequest:
- result.Status = ExternalResultStatus.Error;
+ result.Status = ExternalResponseStatus.Error;
result.Message = payload;
break;
default:
- result.Status = ExternalResultStatus.Error;
+ result.Status = ExternalResponseStatus.Error;
result.Message = $"Unable to contact endpoint {response.RequestMessage.RequestUri}. Http status {response.StatusCode}";
break;
}
@@ -158,18 +158,18 @@ public async Task> DeleteAsync(Uri endpoint, string authe
}
catch (Exception e)
{
- result.Status = ExternalResultStatus.Error;
+ result.Status = ExternalResponseStatus.Error;
result.Message = "Exception during Delete";
_logger.LogError("Unexpected exception during delete {e}", e);
}
return result;
}
- protected async Task> ProcessDownloadResponse(HttpResponseMessage response)
+ protected async Task> ProcessDownloadResponse(HttpResponseMessage response)
{
- ExternalResult result = new ExternalResult()
+ ExternalResponse result = new ExternalResponse()
{
- Status = ExternalResultStatus.Error,
+ Status = ExternalResponseStatus.Error,
};
byte[] responsePayload = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(true);
@@ -183,8 +183,8 @@ protected async Task> ProcessDownloadResponse(HttpR
string contentDisposition = response.Content.Headers.GetValues("Content-Disposition").FirstOrDefault();
string fileName = GetFileNameFromContentDisposition(contentDisposition);
- result.Status = ExternalResultStatus.Success;
- result.Payload = new Models.Download.FileDownload()
+ result.Status = ExternalResponseStatus.Success;
+ result.Payload = new FileDownloadResponse()
{
FilePayload = Convert.ToBase64String(responsePayload),
Size = contentLength,
@@ -196,15 +196,15 @@ protected async Task> ProcessDownloadResponse(HttpR
break;
case HttpStatusCode.NoContent:
- result.Status = ExternalResultStatus.Success;
+ result.Status = ExternalResponseStatus.Success;
result.Message = "No content found";
break;
case HttpStatusCode.Forbidden:
- result.Status = ExternalResultStatus.Error;
+ result.Status = ExternalResponseStatus.Error;
result.Message = "Forbidden";
break;
default:
- result.Status = ExternalResultStatus.Error;
+ result.Status = ExternalResponseStatus.Error;
result.Message = $"Unable to contact endpoint {response.RequestMessage.RequestUri}. Http status {response.StatusCode}";
break;
}
@@ -220,11 +220,11 @@ private static string GetFileNameFromContentDisposition(string contentDispositio
return fileNamePart[(fileNameFlag.Length + 1) ..].Replace("\"", string.Empty);
}
- private async Task> ProcessResponse(HttpResponseMessage response)
+ private async Task> ProcessResponse(HttpResponseMessage response)
{
- ExternalResult result = new ExternalResult()
+ ExternalResponse result = new ExternalResponse