diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 0a71e657d6..0000000000
--- a/.editorconfig
+++ /dev/null
@@ -1,25 +0,0 @@
-# EditorConfig is awesome: https://EditorConfig.org
-
-root = true
-
-[*]
-end_of_line = lf
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[*.ts]
-indent_style = space
-
-[*.cs]
-indent_size = 4
-
-[{*.json,*.md,*.yml,*.groovy,Jenkinsfile*}]
-indent_style = space
-indent_size = 2
-
-[*.env]
-insert_final_newline = false
-
-[{Makefile,**.mk}]
-# Use tabs for indentation (Makefiles require tabs)
-indent_style = tab
diff --git a/.env-template b/.env-template
index cb3f236c92..75dcba021a 100644
--- a/.env-template
+++ b/.env-template
@@ -1,10 +1,3 @@
-# Old PIMS
-DATABASE_PORT=
-API_HTTPS_PORT=
-API_PROXY_PORT=
-API_SERVICE_NAME=
-APP_HTTP_PORT=
-
# Old and New PIMS
API_HTTP_PORT=
diff --git a/.github/labeler.yaml b/.github/labeler.yaml
index a5385e8357..753cb275a8 100644
--- a/.github/labeler.yaml
+++ b/.github/labeler.yaml
@@ -21,22 +21,11 @@ Dependencies:
Documentation:
- '**/*.md'
-#################
-# DotNet backend
-DotNet:
- - backend/**/*
-
-Migrations:
- - backend/dal/Migrations/**/*
#################
# React frontend
React:
- - frontend/**/*
-
-Styles:
- - frontend/**/*.css
- - frontend/**/*.scss
+ - react-app/**/*
################
# Express API
@@ -49,16 +38,5 @@ TypeORM:
#################
# Testing
Tests:
- - frontend/**/*.test.*
- - frontend/**/*.spec.*
- - backend/**/*.Test.*
-
-Cypress:
- - any: ['frontend/cypress/**/*', 'frontend/cypress.*']
- all: ['!frontend/cypress/e2e/**/*', '!frontend/cypress/component/**/*']
-
-'Cypress E2E':
- - frontend/cypress/e2e/**/*
-
-'Cypress Component':
- - frontend/component/**/*
+ - express-api/tests/**/*
+ - react-app/tests/**/*
diff --git a/.github/workflows/DEV-Api-image-deploy.yml b/.github/workflows/DEV-Api-image-deploy.yml
deleted file mode 100644
index 09b391aa2e..0000000000
--- a/.github/workflows/DEV-Api-image-deploy.yml
+++ /dev/null
@@ -1,181 +0,0 @@
-# GitHub Actions workflow for deploying API image on PR merge to main branch
-name: DEV API-Image Deploy on PR merge
-
-on:
- pull_request:
- types:
- - closed
- branches: [main]
- paths:
- - 'backend/**' # Triggers on changes to files in the backend/ directory.
-
- workflow_dispatch:
- inputs:
- image_tag:
- description: 'Image Tag to deploy'
- required: true
-
- migration_tag:
- description: 'DataBase Migration Tag, if needed'
- required: false
-
-env:
- IMAGE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || github.event.pull_request.number }}
- MIGRATION_IMAGE : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.migration_tag || github.event.pull_request.number }}
-
-jobs:
- # Job to deploy API image to OpenShift
- Deploy-To-OpenShift:
- if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged }}
- name: Deploy to OpenShift
- runs-on: ubuntu-latest
- outputs:
- migration: ${{ steps.migration.outputs.migration_needed }}
- steps:
- # Checkout the repository
- - name: Checkout Repository
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- # Check for migration files
- - name: Check for migration files
- if: ${{ github.event_name != 'workflow_dispatch'}}
- id: migration
- run: |
- if git diff --name-only origin/main HEAD~1 | grep -q "backend/dal/Migrations"; then
- echo "migration_needed=true" >> $GITHUB_OUTPUT
- else
- echo "migration_needed=false" >> $GITHUB_OUTPUT
- fi
-
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }}
- namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
-
- # run migration if needed
- - name: Migration Run
- if: github.event.inputs.migration_tag || steps.migration.outputs.migration_needed == 'true'
- env:
- NAMESPACE: "${{ secrets.OPENSHIFT_DEV_NAMESPACE }}"
- TOOLS_NAMESPACE: "${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}"
- IMAGE_REPOSITORY : ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}
- IMAGE_TAG: ${{ env.MIGRATION_IMAGE }}
- MIGRATION_IMAGE: "pims-migrations"
- DB_NAME: "pims-database"
- run: |
- ./.github/helpers/migrations.sh
-
- # Process and Apply API DeploymentConfig
- - name: Process and Apply API DeploymentConfig
- env:
- NAMESPACE: '${{ secrets.OPENSHIFT_DEV_NAMESPACE }}'
- DC_TEMPLATE: 'api-dc-template.yaml'
- IMAGE_TAG: ${{ env.IMAGE_TAG }}
- ENVIRONMENT: 'dev'
- ASPNETCORE_ENVIRONMENT: 'Development'
- EMAIL_AUTHORIZED: 'false'
- APPLICATION_NAME: 'pims-api'
- LICENSE_PLATE: '${{ secrets.LICENSE_PLATE }}'
- run: |
- ./.github/helpers/deploy.sh
-
- # Job to check the health of the deployed API
- Health-Check:
- name: Check Deployment Health
- runs-on: ubuntu-latest
- needs: [Deploy-To-OpenShift]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }}
- namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
-
- # Check Deployment Status
- - name: Check Deployment Status
- run: |
- oc rollout status -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} dc/pims-api --watch
-
- # Job to clean up previous objects in OpenShift
- Clean-Up:
- name: Clean Up
- runs-on: ubuntu-latest
- needs: [Health-Check]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }}
- namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
-
- # Remove previous objects
- - name: Remove previous objects
- run: |
- oc delete pod -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} --field-selector status.phase=Succeeded
-
- # Remove previous replication controllers
- - name: Remove previous replication controllers
- run: |
- oc delete rc -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} --field-selector status.replicas=0
-
- # Job to update the wiki with deployed image tag information
- Update_Wiki_Tags:
- needs: [Health-Check, Deploy-To-OpenShift]
- name: Update table in wiki
- runs-on: ubuntu-latest
- env:
- GH_TOKEN: ${{ github.token }}
-
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
-
- # Clone wiki repository
- - name: Clone wiki repository
- run: |
- echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git"
- git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki
-
- # Setup Python
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
-
- # Run update wiki python script
- - name: Run update wiki python script
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md API "Deployed Image Tag in DEV" "${{ env.IMAGE_TAG }}"
-
- # Run update wiki python script for Migration If needed
- - name: Update wiki for Migration If needed
- if: github.event.inputs.migration_tag || needs.Deploy-To-OpenShift.outputs.migration == 'true'
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md MIGRATION "Deployed Image Tag in DEV" "${{ env.MIGRATION_IMAGE }}"
-
- # Commit and push changes to wiki
- - name: Commit and push changes to wiki
- run: |
- cd ./wiki
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add .
- if git diff-index --quiet HEAD; then
- echo "Nothing changed"
- exit 0
- fi
- echo "Pushing changes to wiki"
- git commit -m "Value populated at Deploy API" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
diff --git a/.github/workflows/DEV-App-image-build.yml b/.github/workflows/DEV-App-image-build.yml
deleted file mode 100644
index 8502554f9a..0000000000
--- a/.github/workflows/DEV-App-image-build.yml
+++ /dev/null
@@ -1,105 +0,0 @@
-# GitHub Actions workflow for building and tagging the APP image on PR
-name: DEV APP-:Image Build on PR
-
-on:
- pull_request:
- types: [opened, synchronize, ready_for_review] # Triggered by opened or changed pull requests.
- branches: [main]
- paths:
- - 'frontend/**' # Triggers on changes to files in the frontend/ directory.
-
-jobs:
- # Job to build, tag, and push the APP image
- PIMS-APP-Build-Tag-Push:
- environment: dev
- runs-on: ubuntu-latest
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- # Login to the Openshift Cluster
- - name: Login to Openshift
- uses: redhat-actions/oc-login@v1
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ secrets.OPENSHIFT_SA_TOOLS_TOKEN }}
- namespace: ${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}
-
- # Login to BC Gov Docker Image Repository
- - name: Login to Openshift Docker
- run : |
- docker login ${{ secrets.PUBLIC_IMAGE_REPOSITORY }} -u ${{ secrets.OPENSHIFT_SA_NAME }} -p ${{ secrets.OPENSHIFT_SA_TOOLS_TOKEN }}
-
- # Build the APP image
- - name: Build APP Image
- run: |
- docker-compose -f docker-compose.prod.yml build frontend
-
- # Tag the APP image
- - name: Tag APP Image
- run: |
- docker tag pims_frontend ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-app:${{github.event.pull_request.number}}
-
- # Push the APP image
- - name: Push APP Image
- run: |
- docker push ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-app:${{github.event.pull_request.number}}
-
- # Job to update the wiki with the latest build image tag information
- Update_Wiki_Tags:
- needs: [PIMS-APP-Build-Tag-Push]
- name: Update table in wiki
- runs-on: ubuntu-latest
- env:
- GH_TOKEN: ${{ github.token }}
-
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
-
- # Clone wiki repository
- - name: Clone wiki repository
- run: |
- echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git"
- git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki
-
- # Setup Python
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
-
- # Run update wiki python script
- - name: Run update wiki python script
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md APP "Latest Build Image Tag" "${{github.event.pull_request.number}}"
-
- # Commit and push changes to wiki
- - name: Commit and push changes to wiki
- run: |
- cd ./wiki
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add .
- if git diff-index --quiet HEAD; then
- echo "Nothing changed"
- exit 0
- fi
- echo "Pushing changes to wiki"
- git commit -m "Value populated at image build App" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
-
- # Add Comment To the PR
- - name: Add Comment To the PR
- if: github.event.action == 'opened'
- uses: actions/github-script@v6
- with:
- script: |
- github.rest.issues.createComment({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- body: "🚀 **Deployment Information**\n\nThe APP Image has been built with the tag: **`${{github.event.pull_request.number}}`**. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the APP deployment. For more updates please monitor [Image Tags](https://github.com/bcgov/PIMS/wiki/Image-tags) Page on Wiki."
- })
diff --git a/.github/workflows/DEV-App-image-deploy.yml b/.github/workflows/DEV-App-image-deploy.yml
deleted file mode 100644
index 423d5de483..0000000000
--- a/.github/workflows/DEV-App-image-deploy.yml
+++ /dev/null
@@ -1,143 +0,0 @@
-# GitHub Actions workflow for deploying APP image on PR merge to main branch
-name: DEV APP-Image Deploy on PR merge
-
-on:
- pull_request:
- types:
- - closed
- branches: [main]
- paths:
- - 'frontend/**' # Triggers on changes to files in the frontend/ directory.
- workflow_dispatch:
- inputs:
- image_tag:
- description: 'Image Tag to deploy'
- required: true
-
-env:
- IMAGE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag || github.event.pull_request.number }}
-
-
-jobs:
- # Job to deploy APP image to OpenShift
- Deploy-To-OpenShift:
- if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.merged }}
- name: Deploy to OpenShift
- runs-on: ubuntu-latest
-
- steps:
- # Checkout the repository
- - name: Checkout Repository
- uses: actions/checkout@v3
-
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }}
- namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
-
- # Process and Apply APP DeploymentConfig
- - name: Process and Apply APP DeploymentConfig
- env:
- NAMESPACE: "${{ secrets.OPENSHIFT_DEV_NAMESPACE }}"
- DC_TEMPLATE: "app-dc-template.yaml"
- IMAGE_TAG: ${{ env.IMAGE_TAG }}
- ENVIRONMENT: "dev"
- APPLICATION_NAME: "pims-app"
- LICENSE_PLATE: "${{ secrets.LICENSE_PLATE }}"
- run: |
- ./.github/helpers/deploy.sh
-
- # Job to check the health of the deployed APP
- Health-Check:
- name: Check Deployment Health
- runs-on: ubuntu-latest
- needs: [ Deploy-To-OpenShift ]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }}
- namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
-
- # Check Deployment Status
- - name: Check Deployment Status
- run: |
- oc rollout status -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} dc/pims-app --watch
-
- # Job to clean up previous objects in OpenShift
- Clean-Up:
- name: Clean Up
- runs-on: ubuntu-latest
- needs: [ Health-Check ]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ secrets.OPENSHIFT_SA_DEV_TOKEN }}
- namespace: ${{ secrets.OPENSHIFT_DEV_NAMESPACE }}
-
- # Remove previous objects
- - name: Remove previous objects
- run: |
- oc delete pod -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} --field-selector status.phase=Succeeded
-
- # Remove previous replication controllers
- - name: Remove previous replication controllers
- run: |
- oc delete rc -n ${{ secrets.OPENSHIFT_DEV_NAMESPACE }} --field-selector status.replicas=0
-
- # Job to update the wiki with deployed image tag information
- Update_Wiki_Tags:
- needs: [ Health-Check ]
- name: Update table in wiki
- runs-on: ubuntu-latest
- env:
- GH_TOKEN: ${{ github.token }}
-
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
-
- # Clone wiki repository
- - name: Clone wiki repository
- run: |
- echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git"
- git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki
-
- # Setup Python
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
-
- # Run update wiki python script
- - name: Run update wiki python script
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md APP "Deployed Image Tag in DEV" "${{ env.IMAGE_TAG }}"
-
- # Commit and push changes to wiki
- - name: Commit and push changes to wiki
- run: |
- cd ./wiki
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add .
- if git diff-index --quiet HEAD; then
- echo "Nothing changed"
- exit 0
- fi
- echo "Pushing changes to wiki"
- git commit -m "Value populated at Deploy App" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
diff --git a/.github/workflows/DEV-api-image-build.yml b/.github/workflows/DEV-api-image-build.yml
deleted file mode 100644
index bbe9a0246f..0000000000
--- a/.github/workflows/DEV-api-image-build.yml
+++ /dev/null
@@ -1,137 +0,0 @@
-# GitHub Actions workflow for building and tagging the API image on PR
-name: DEV API-:Image Build on PR
-
-on:
- pull_request:
- types: [opened, synchronize, ready_for_review] # Triggered by opened or changed pull requests.
- branches: [main]
- paths:
- - 'backend/**' # Triggers on changes to files in the frontend/ directory.
-
-jobs:
- PIMS-API-Build-Tag-Push:
- environment: dev
- runs-on: ubuntu-latest
- outputs:
- migration: ${{ steps.migration.outputs.migration_needed }}
- steps:
- # check out the repo
- - name: Checkout
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- # login to the Openshift Cluster
- - name: Login to Openshift
- uses: redhat-actions/oc-login@v1
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ secrets.OPENSHIFT_SA_TOOLS_TOKEN }}
- namespace: ${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}
-
- # Login to BC Gov Docker Image Repository
- - name: Login to Openshift Docker
- run: |
- docker login ${{ secrets.PUBLIC_IMAGE_REPOSITORY }} -u ${{ secrets.OPENSHIFT_SA_NAME }} -p ${{ secrets.OPENSHIFT_SA_TOOLS_TOKEN }}
-
- # Build the API Image
- - name: Build API Image
- run: |
- docker-compose -f docker-compose.prod.yml build backend
-
- # Tag the API Image with the PR number
- - name: Tag API Image
- run: |
- docker tag pims_backend ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-api:${{github.event.pull_request.number}}
-
- # Check for migration files
- - name: Check for migration files
- id: migration
- run: |
- if git diff --name-only HEAD~1 | grep -q "backend/dal/Migrations"; then
- echo "migration_needed=true" >> $GITHUB_OUTPUT
- else
- echo "migration_needed=false" >> $GITHUB_OUTPUT
- fi
-
- # if migration files have changed, build the migration image
- - name: Build Migration Image
- if: steps.migration.outputs.migration_needed == 'true'
- run: |
- docker-compose -f docker-compose.prod.yml build migration
-
- - name: Tag Migration Image
- if: steps.migration.outputs.migration_needed == 'true'
- run: |
- docker tag pims_migration ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-migrations:${{github.event.pull_request.number}}
-
- # push the migration image
- - name: Push Migration Image
- if: steps.migration.outputs.migration_needed == 'true'
- run: |
- docker push ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-migrations:${{github.event.pull_request.number}}
-
- # Push the API Image
- - name: Push API Image
- run: |
- docker push ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}/${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}/pims-api:${{github.event.pull_request.number}}
-
- Update_Wiki_Tags:
- needs: [PIMS-API-Build-Tag-Push]
- name: Update table in wiki
- runs-on: ubuntu-latest
- env:
- GH_TOKEN: ${{ github.token }}
-
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
-
- # Clone the wiki repository
- - name: Clone wiki repository
- run: |
- echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git"
- git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki
-
- # Setup Python
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
-
- # Run the update wiki Python script
- - name: Run update wiki Python script
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md API "Latest Build Image Tag" "${{github.event.pull_request.number}}"
-
- - name: Update wiki for Migration
- if: needs.PIMS-API-Build-Tag-Push.outputs.migration == 'true'
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md MIGRATION "Latest Build Image Tag" "${{github.event.pull_request.number}}"
-
- # Commit and push changes to the wiki
- - name: Commit and push changes to wiki
- run: |
- cd ./wiki
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add .
- if git diff-index --quiet HEAD; then
- echo "Nothing changed"
- exit 0
- fi
- echo "Pushing changes to wiki"
- git commit -m "Value populated at image build API" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
-
- # Add comment to the PR
- - name: Add Comment To the PR
- if: github.event.action == 'opened'
- uses: actions/github-script@v6
- with:
- script: |
- github.rest.issues.createComment({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- body: "🚀 **Deployment Information**\n\nThe API Image has been built with the tag: **`${{github.event.pull_request.number}}`**. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the API deployment. For more updates please monitor [Image Tags](https://github.com/bcgov/PIMS/wiki/Image-tags) Page on Wiki."
- })
-
diff --git a/.github/workflows/PROD-Api-image-deploy.yml b/.github/workflows/PROD-Api-image-deploy.yml
deleted file mode 100644
index 99a3b5622f..0000000000
--- a/.github/workflows/PROD-Api-image-deploy.yml
+++ /dev/null
@@ -1,163 +0,0 @@
-# GitHub Actions workflow for deploying API image to PROD env
-name: PROD API-Image Deploy
-
-on:
- workflow_dispatch:
- inputs:
- image_tag:
- description: 'Image Tag to deploy'
- required: true
-
- migration_tag:
- description: 'DataBase Migration Tag, if needed'
- required: false
-
-env:
- IMAGE_TAG: ${{ github.event.inputs.image_tag }}
- MIGRATION_IMAGE : ${{ github.event.inputs.migration_tag }}
- ENVIRONMENT: 'prod'
- OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_SA_PROD_TOKEN }}
-
-
-jobs:
- # Job to deploy API image to OpenShift
- Deploy-To-OpenShift:
- name: Deploy to OpenShift
- runs-on: ubuntu-latest
- steps:
- # Checkout the repository
- - name: Checkout Repository
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{env.OPENSHIFT_TOKEN}}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # run migration if needed
- - name: Migration Run
- if: github.event.inputs.migration_tag
- env:
- NAMESPACE: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- TOOLS_NAMESPACE: "${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}"
- IMAGE_REPOSITORY : ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}
- IMAGE_TAG: ${{ env.MIGRATION_IMAGE }}
- MIGRATION_IMAGE: "pims-migrations"
- DB_NAME: "pims-database"
- run: |
- ./.github/helpers/migrations.sh
-
- # Process and Apply API DeploymentConfig
- - name: Process and Apply API DeploymentConfig
- env:
- NAMESPACE: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- DC_TEMPLATE: 'api-dc-template.yaml'
- IMAGE_TAG: ${{ env.IMAGE_TAG }}
- ENVIRONMENT: ${{ env.ENVIRONMENT }}
- ASPNETCORE_ENVIRONMENT: 'Production'
- EMAIL_AUTHORIZED: 'true'
- APPLICATION_NAME: 'pims-api'
- LICENSE_PLATE: '${{ secrets.LICENSE_PLATE }}'
- run: |
- ./.github/helpers/deploy.sh
-
- # Job to check the health of the deployed API
- Health-Check:
- name: Check Deployment Health
- runs-on: ubuntu-latest
- needs: [Deploy-To-OpenShift]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{env.OPENSHIFT_TOKEN}}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Check Deployment Status
- - name: Check Deployment Status
- run: |
- oc rollout status -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} dc/pims-api --watch
-
- # Job to clean up previous objects in OpenShift
- Clean-Up:
- name: Clean Up
- runs-on: ubuntu-latest
- needs: [Health-Check]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{env.OPENSHIFT_TOKEN}}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Remove previous objects
- - name: Remove previous objects
- run: |
- oc delete pod -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.phase=Succeeded
-
- # Remove previous replication controllers
- - name: Remove previous replication controllers
- run: |
- oc delete rc -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.replicas=0
-
- # Job to update the wiki with deployed image tag information
- Update_Wiki_Tags:
- needs: [Health-Check, Deploy-To-OpenShift]
- name: Update table in wiki
- runs-on: ubuntu-latest
- env:
- GH_TOKEN: ${{ github.token }}
-
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
-
- # Clone wiki repository
- - name: Clone wiki repository
- run: |
- echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git"
- git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki
-
- # Setup Python
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
-
- # Run update wiki python script
- - name: Run update wiki python script
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md API "Deployed Image Tag in PROD" "${{ env.IMAGE_TAG }}"
-
- # Run update wiki python script for Migration If needed
- - name: Update wiki for Migration If needed
- if: github.event.inputs.migration_tag
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md MIGRATION "Deployed Image Tag in PROD" "${{ env.MIGRATION_IMAGE }}"
-
- # Commit and push changes to wiki
- - name: Commit and push changes to wiki
- run: |
- cd ./wiki
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add .
- if git diff-index --quiet HEAD; then
- echo "Nothing changed"
- exit 0
- fi
- echo "Pushing changes to wiki"
- git commit -m "Value populated at Deploy API" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
diff --git a/.github/workflows/PROD-App-image-deploy.yml b/.github/workflows/PROD-App-image-deploy.yml
deleted file mode 100644
index 941f857273..0000000000
--- a/.github/workflows/PROD-App-image-deploy.yml
+++ /dev/null
@@ -1,138 +0,0 @@
-# GitHub Actions workflow for deploying APP image to PROD env
-name: PROD APP-Image Deploy
-
-on:
- workflow_dispatch:
- inputs:
- image_tag:
- description: 'Image Tag to deploy'
- required: true
-
-env:
- IMAGE_TAG: ${{ github.event.inputs.image_tag }}
- ENVIRONMENT: 'prod'
- OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_SA_PROD_TOKEN }}
-
-
-jobs:
- # Job to deploy APP image to OpenShift
- Deploy-To-OpenShift:
- name: Deploy to OpenShift
- runs-on: ubuntu-latest
-
- steps:
- # Checkout the repository
- - name: Checkout Repository
- uses: actions/checkout@v3
-
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ env.OPENSHIFT_TOKEN }}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Process and Apply APP DeploymentConfig
- - name: Process and Apply APP DeploymentConfig
- env:
- NAMESPACE: "${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}"
- DC_TEMPLATE: "app-dc-template.yaml"
- IMAGE_TAG: ${{ env.IMAGE_TAG }}
- ENVIRONMENT: ${{ env.ENVIRONMENT }}
- APPLICATION_NAME: "pims-app"
- LICENSE_PLATE: "${{ secrets.LICENSE_PLATE }}"
- run: |
- ./.github/helpers/deploy.sh
-
- # Job to check the health of the deployed APP
- Health-Check:
- name: Check Deployment Health
- runs-on: ubuntu-latest
- needs: [ Deploy-To-OpenShift ]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ env.OPENSHIFT_TOKEN }}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Check Deployment Status
- - name: Check Deployment Status
- run: |
- oc rollout status -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} dc/pims-app --watch
-
- # Job to clean up previous objects in OpenShift
- Clean-Up:
- name: Clean Up
- runs-on: ubuntu-latest
- needs: [ Health-Check ]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ env.OPENSHIFT_TOKEN }}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Remove previous objects
- - name: Remove previous objects
- run: |
- oc delete pod -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.phase=Succeeded
-
- # Remove previous replication controllers
- - name: Remove previous replication controllers
- run: |
- oc delete rc -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.replicas=0
-
- # Job to update the wiki with deployed image tag information
- Update_Wiki_Tags:
- needs: [ Health-Check ]
- name: Update table in wiki
- runs-on: ubuntu-latest
- env:
- GH_TOKEN: ${{ github.token }}
-
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
-
- # Clone wiki repository
- - name: Clone wiki repository
- run: |
- echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git"
- git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki
-
- # Setup Python
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
-
- # Run update wiki python script
- - name: Run update wiki python script
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md APP "Deployed Image Tag in PROD" "${{ env.IMAGE_TAG }}"
-
- # Commit and push changes to wiki
- - name: Commit and push changes to wiki
- run: |
- cd ./wiki
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add .
- if git diff-index --quiet HEAD; then
- echo "Nothing changed"
- exit 0
- fi
- echo "Pushing changes to wiki"
- git commit -m "Value populated at Deploy App" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
diff --git a/.github/workflows/TEST-Api-image-deploy.yml b/.github/workflows/TEST-Api-image-deploy.yml
deleted file mode 100644
index d2185567db..0000000000
--- a/.github/workflows/TEST-Api-image-deploy.yml
+++ /dev/null
@@ -1,163 +0,0 @@
-# GitHub Actions workflow for deploying API image to TEST env
-name: TEST API-Image Deploy
-
-on:
- workflow_dispatch:
- inputs:
- image_tag:
- description: 'Image Tag to deploy'
- required: true
-
- migration_tag:
- description: 'DataBase Migration Tag, if needed'
- required: false
-
-env:
- IMAGE_TAG: ${{ github.event.inputs.image_tag }}
- MIGRATION_IMAGE : ${{ github.event.inputs.migration_tag }}
- ENVIRONMENT: 'test'
- OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_SA_TEST_TOKEN }}
-
-
-jobs:
- # Job to deploy API image to OpenShift
- Deploy-To-OpenShift:
- name: Deploy to OpenShift
- runs-on: ubuntu-latest
- steps:
- # Checkout the repository
- - name: Checkout Repository
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{env.OPENSHIFT_TOKEN}}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # run migration if needed
- - name: Migration Run
- if: github.event.inputs.migration_tag
- env:
- NAMESPACE: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- TOOLS_NAMESPACE: "${{ secrets.OPENSHIFT_TOOLS_NAMESPACE }}"
- IMAGE_REPOSITORY : ${{ secrets.PUBLIC_IMAGE_REPOSITORY }}
- IMAGE_TAG: ${{ env.MIGRATION_IMAGE }}
- MIGRATION_IMAGE: "pims-migrations"
- DB_NAME: "pims-database"
- run: |
- ./.github/helpers/migrations.sh
-
- # Process and Apply API DeploymentConfig
- - name: Process and Apply API DeploymentConfig
- env:
- NAMESPACE: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- DC_TEMPLATE: 'api-dc-template.yaml'
- IMAGE_TAG: ${{ env.IMAGE_TAG }}
- ENVIRONMENT: ${{ env.ENVIRONMENT }}
- ASPNETCORE_ENVIRONMENT: 'Test'
- EMAIL_AUTHORIZED: 'false'
- APPLICATION_NAME: 'pims-api'
- LICENSE_PLATE: '${{ secrets.LICENSE_PLATE }}'
- run: |
- ./.github/helpers/deploy.sh
-
- # Job to check the health of the deployed API
- Health-Check:
- name: Check Deployment Health
- runs-on: ubuntu-latest
- needs: [Deploy-To-OpenShift]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{env.OPENSHIFT_TOKEN}}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Check Deployment Status
- - name: Check Deployment Status
- run: |
- oc rollout status -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} dc/pims-api --watch
-
- # Job to clean up previous objects in OpenShift
- Clean-Up:
- name: Clean Up
- runs-on: ubuntu-latest
- needs: [Health-Check]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{env.OPENSHIFT_TOKEN}}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Remove previous objects
- - name: Remove previous objects
- run: |
- oc delete pod -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.phase=Succeeded
-
- # Remove previous replication controllers
- - name: Remove previous replication controllers
- run: |
- oc delete rc -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.replicas=0
-
- # Job to update the wiki with deployed image tag information
- Update_Wiki_Tags:
- needs: [Health-Check, Deploy-To-OpenShift]
- name: Update table in wiki
- runs-on: ubuntu-latest
- env:
- GH_TOKEN: ${{ github.token }}
-
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
-
- # Clone wiki repository
- - name: Clone wiki repository
- run: |
- echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git"
- git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki
-
- # Setup Python
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
-
- # Run update wiki python script
- - name: Run update wiki python script
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md API "Deployed Image Tag in TEST" "${{ env.IMAGE_TAG }}"
-
- # Run update wiki python script for Migration If needed
- - name: Update wiki for Migration If needed
- if: github.event.inputs.migration_tag
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md MIGRATION "Deployed Image Tag in TEST" "${{ env.MIGRATION_IMAGE }}"
-
- # Commit and push changes to wiki
- - name: Commit and push changes to wiki
- run: |
- cd ./wiki
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add .
- if git diff-index --quiet HEAD; then
- echo "Nothing changed"
- exit 0
- fi
- echo "Pushing changes to wiki"
- git commit -m "Value populated at Deploy API" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
diff --git a/.github/workflows/TEST-App-image-deploy.yml b/.github/workflows/TEST-App-image-deploy.yml
deleted file mode 100644
index cbf629cf63..0000000000
--- a/.github/workflows/TEST-App-image-deploy.yml
+++ /dev/null
@@ -1,138 +0,0 @@
-# GitHub Actions workflow for deploying APP image to TEST env
-name: TEST APP-Image Deploy
-
-on:
- workflow_dispatch:
- inputs:
- image_tag:
- description: 'Image Tag to deploy'
- required: true
-
-env:
- IMAGE_TAG: ${{ github.event.inputs.image_tag }}
- ENVIRONMENT: 'test'
- OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_SA_TEST_TOKEN }}
-
-
-jobs:
- # Job to deploy APP image to OpenShift
- Deploy-To-OpenShift:
- name: Deploy to OpenShift
- runs-on: ubuntu-latest
-
- steps:
- # Checkout the repository
- - name: Checkout Repository
- uses: actions/checkout@v3
-
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ env.OPENSHIFT_TOKEN }}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Process and Apply APP DeploymentConfig
- - name: Process and Apply APP DeploymentConfig
- env:
- NAMESPACE: "${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}"
- DC_TEMPLATE: "app-dc-template.yaml"
- IMAGE_TAG: ${{ env.IMAGE_TAG }}
- ENVIRONMENT: ${{ env.ENVIRONMENT }}
- APPLICATION_NAME: "pims-app"
- LICENSE_PLATE: "${{ secrets.LICENSE_PLATE }}"
- run: |
- ./.github/helpers/deploy.sh
-
- # Job to check the health of the deployed APP
- Health-Check:
- name: Check Deployment Health
- runs-on: ubuntu-latest
- needs: [ Deploy-To-OpenShift ]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ env.OPENSHIFT_TOKEN }}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Check Deployment Status
- - name: Check Deployment Status
- run: |
- oc rollout status -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} dc/pims-app --watch
-
- # Job to clean up previous objects in OpenShift
- Clean-Up:
- name: Clean Up
- runs-on: ubuntu-latest
- needs: [ Health-Check ]
- steps:
- # Login to OpenShift
- - name: Login to OpenShift
- uses: redhat-actions/oc-login@v1
- env:
- OPENSHIFT_USER: github-actions
- OPENSHIFT_PROJECT: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
- with:
- openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
- openshift_token: ${{ env.OPENSHIFT_TOKEN }}
- namespace: ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }}
-
- # Remove previous objects
- - name: Remove previous objects
- run: |
- oc delete pod -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.phase=Succeeded
-
- # Remove previous replication controllers
- - name: Remove previous replication controllers
- run: |
- oc delete rc -n ${{ format('{0}-{1}', secrets.LICENSE_PLATE, env.ENVIRONMENT) }} --field-selector status.replicas=0
-
- # Job to update the wiki with deployed image tag information
- Update_Wiki_Tags:
- needs: [ Health-Check ]
- name: Update table in wiki
- runs-on: ubuntu-latest
- env:
- GH_TOKEN: ${{ github.token }}
-
- steps:
- # Checkout the repository
- - name: Checkout
- uses: actions/checkout@v3
-
- # Clone wiki repository
- - name: Clone wiki repository
- run: |
- echo "Cloning wiki repo https://github.com/$GITHUB_REPOSITORY.wiki.git"
- git clone "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git" ./wiki
-
- # Setup Python
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.10'
-
- # Run update wiki python script
- - name: Run update wiki python script
- run: python ./.github/helpers/update-wiki-table.py ./wiki/Image-tags.md APP "Deployed Image Tag in TEST" "${{ env.IMAGE_TAG }}"
-
- # Commit and push changes to wiki
- - name: Commit and push changes to wiki
- run: |
- cd ./wiki
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add .
- if git diff-index --quiet HEAD; then
- echo "Nothing changed"
- exit 0
- fi
- echo "Pushing changes to wiki"
- git commit -m "Value populated at Deploy App" && git push "https://$GITHUB_ACTOR:$GH_TOKEN@github.com/$GITHUB_REPOSITORY.wiki.git"
diff --git a/.github/workflows/api-dotnetcore.yml b/.github/workflows/api-dotnetcore.yml
deleted file mode 100644
index c8af521998..0000000000
--- a/.github/workflows/api-dotnetcore.yml
+++ /dev/null
@@ -1,102 +0,0 @@
-name: API (.NET 7.0)
-
-on:
- push:
- branches: [main]
- paths:
- - 'backend/**' # Triggers on changes to files in the backend/ directory.
- - '!backend/Dockerfile*' # Will not trigger on changes to the following.
- - '!backend/README.md'
- pull_request:
- types: [opened, synchronize] # Triggered by opened or changed pull requests.
- branches: [dev]
- paths:
- - 'backend/**' # Triggers on changes to files in the backend/ directory.
- - '!backend/Dockerfile*' # Will not trigger on changes to the following.
- - '!backend/README.md'
-
-jobs:
- build:
- runs-on: ubuntu-latest
- env:
- working-directory: ./backend
- codeCov-token: ${{ secrets.CodeCov }}
-
- steps:
- - uses: actions/checkout@v3
-
- - name: Setup .NET 7.0
- uses: actions/setup-dotnet@v3
- with:
- dotnet-version: 7.0.x
-
- - name: Install dependencies
- run: dotnet restore
- working-directory: ${{env.working-directory}}
-
- - name: Install coverlet for code coverage
- run: dotnet tool install -g coverlet.console --version 1.7.2
- working-directory: ${{env.working-directory}}
-
- - name: Build
- run: dotnet build --configuration Release --no-restore
- working-directory: ${{env.working-directory}}
-
- - name: Test
- run: dotnet test --no-restore --verbosity normal
- working-directory: ${{env.working-directory}}
-
- # For future reference, if we have N test projects the flow of events would be:
- #
- # **Pre-conditions:**
- # - All projects export their individual coverage percents in JSON and OpenCover format
- # - There's no way to merge OpenCover xmls together (that I could find)
- # - Common folder "../TestResults" is git ignored so nothing gets in source control
- #
- # **Steps:**
- #
- # - Test-project 1
- # - generate coverage files (without merging)
- # - copy results to common folder "../TestResults"
- # - Test-project 2
- # - generate coverage files merging with previous `coverage.json`
- # - the previous `coverage.opencoverage.xml` is ignored
- # - copy results to common folder "../TestResults"
- # ...
- # - Test-project N
- # - generate coverage files merging with previous `coverage.json`
- # - the previous `coverage.opencoverage.xml` is ignored
- # - copy results to common folder "../TestResults"
- #
- # The final `coverage.opencover.xml` is the one we want
- - name: Generate code coverage
- working-directory: ${{env.working-directory}}/tests/unit
- run: |
- mkdir -p TestResults
- rm -rf api/TestResults
- rm -rf dal/TestResults
- cd api
- dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore
- mv TestResults/*/* ../TestResults/
- cd ..
- cd dal
- dotnet test --collect:"XPlat Code Coverage" --settings coverlet.runsettings --no-restore
- mv TestResults/*/* ../TestResults/
- cd ..
- head TestResults/coverage.opencover.xml
-
- - name: Codecov
- uses: codecov/codecov-action@v1.5.0
- with:
- # User defined upload name. Visible in Codecov UI
- name: PIMS
- # Repository upload token - get it from codecov.io. Required only for private repositories
- token: ${{env.codeCov-token}}
- # Path to coverage file to upload
- file: ${{env.working-directory}}/tests/unit/TestResults/coverage.opencover.xml
- # Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
- flags: unittests
- # Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
- env_vars: C#
- # Specify whether or not CI build should fail if Codecov runs into an error during upload
- fail_ci_if_error: true
diff --git a/.github/workflows/app-cypress-dev.yml b/.github/workflows/app-cypress-dev.yml
deleted file mode 100644
index af812cfb4b..0000000000
--- a/.github/workflows/app-cypress-dev.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: App Cypress Tests - Dev
-
-on:
- schedule:
- - cron: '0 21 * * 1-5' # Every weekday at 9:00pm UTC - roughly 1:00pm Pacific Time.
- workflow_dispatch:
-
-jobs:
- e2e-tests-dev:
- runs-on: ubuntu-22.04
- # Cypress Docker Image
- # - with Chrome, Firefox, and Edge v113 pre-installed.
- # - Node v18.16.0
- container: cypress/browsers:node-18.16.0-chrome-113.0.5672.92-1-ff-113.0-edge-113.0.1774.35-1
-
- steps:
- # Checkout PIMS Github Repository.
- - name: Checkout Repository
- uses: actions/checkout@v3
-
- # Install NPM Dependencies.
- - name: Install Dependencies
- run: |
- cd ./frontend
- npm i
-
- # Run Cypress E2E Tests.
- - name: Cypress Run E2E Tests
- uses: cypress-io/github-action@v5
- env:
- CYPRESS_KEYCLOAK_USER: ${{ secrets.TEST_IDIR_USERNAME }}
- CYPRESS_KEYCLOAK_PASSWORD: ${{ secrets.TEST_IDIR_PASSWORD }}
- with:
- browser: chrome
- working-directory: frontend
- command: npm run cypress:e2e-dev
- config-file: cypress.config.ts
diff --git a/.github/workflows/app-jest-coverage.yml b/.github/workflows/app-jest-coverage.yml
deleted file mode 100644
index 50179b759b..0000000000
--- a/.github/workflows/app-jest-coverage.yml
+++ /dev/null
@@ -1,76 +0,0 @@
-name: APP (React 18) - Jest Test Coverage
-
-on:
- pull_request:
- types: [opened, synchronize] # Triggered by opened or changed pull requests.
- branches: [main]
- paths:
- - 'frontend/**' # Triggers on changes to files in the frontend/ directory.
- - '!frontend/cypress/**' # Will not trigger on changes to the following.
- - '!frontend/cypress.config.*'
- - '!frontend/.*'
- - '!frontend/Dockerfile*'
- - '!frontend/nginx.conf'
- - '!frontend/vite.config.*'
- - '!frontend/tsconfig.json'
- - '!frontend/README.md'
-
-jobs:
- codeclimate-jest-coverage:
- runs-on: ubuntu-latest
- env:
- GIT_BRANCH: ${{ github.event.pull_request.head.ref }}
- GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
- CC_TEST_REPORTER_ID: 37fdb6f058122c17fc2419b78b02b1d5582694f7cd84a2b735de8eec235e9c5b
-
- steps:
- # Confirm GitHub ENVs.
- - name: Echo ENVs
- run: |
- echo $GIT_BRANCH
- echo $GIT_COMMIT_SHA
-
- # Checkout code from Repo.
- - name: Checkout Repo
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- # Import Code Climate test reporter.
- - name: Import Code Climate
- run: |
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
-
- # Allow test reporter to be executed.
- - name: Execute Permissions for Code Climate Binary
- run: |
- chmod +x ./cc-test-reporter
-
- # Notifies Code Climate of impending report.
- - name: Test Reporter Before Build
- run: |
- ./cc-test-reporter before-build
-
- # Install dependencies.
- - name: Install Dependencies
- working-directory: ./frontend
- run: |
- npm i
-
- # Generate coverage report.
- - name: Run Coverage Report
- working-directory: ./frontend
- run: |
- npm run coverage
-
- # Use lcov to format coverage for Code Climate
- # -t is for coverage type
- - name: Format Test Coverage
- run: |
- ./cc-test-reporter format-coverage ${{ github.workspace }}/frontend/coverage/lcov.info -t lcov --output ${{ github.workspace }}/frontend/coverage/coverage.json
-
- # Upload coverage to Code Climate.
- # -i is for input, -d for detached
- - name: Upload Coverage
- run: |
- ./cc-test-reporter upload-coverage -d -i ${{ github.workspace }}/frontend/coverage/coverage.json
diff --git a/.github/workflows/app-lint.yaml b/.github/workflows/app-lint.yaml
deleted file mode 100644
index 5e2bda46d5..0000000000
--- a/.github/workflows/app-lint.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: APP Linting Check
-
-on:
- pull_request:
- types: [opened, synchronize]
- branches: [main]
- paths:
- - "frontend/**"
- - ".github/workflows/app-lint.yaml"
- workflow_dispatch:
-
-jobs:
- lint-app:
- name: Lint Frontend App
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Repo
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
- # Could optimize this by only installing necessary dependencies
- - name: Install Dependencies
- working-directory: ./frontend
- run: npm i --only=dev
-
- - name: Run ESLint
- working-directory: ./frontend
- run: npm run lint
-
- - name: Run Prettier
- working-directory: ./frontend
- run: npm run check
diff --git a/.gitignore b/.gitignore
index 683af4d4dc..ff7b27515a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,16 +1,7 @@
-**/sh.exe.stackdump
-bash.exe.stackdump
*.env
.vs
-*.orig
-*.param
-.scannerwork/
-auth/keycloak/config/hsperfdata_jboss/
-auth/keycloak/config/*.log
.DS_Store
-/backups
**/node_modules
-database/mssql/data
docker-compose.override.yml
-docker-compose.override.yml
@@ -22,14 +13,9 @@ node_modules/
# testing
coverage/
-test-report.xml
-cypress/videos
-cypress/screenshots
-testUser.json
# production
build/
-public/videos
# misc
.DS_Store
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index 3566bf838b..0000000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- // Use IntelliSense to find out which attributes exist for C# debugging
- // Use hover for the description of the existing attributes
- // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
- "version": "0.2.0",
- "configurations": [
- {
- "name": "Tool-Keycloak-Sync",
- "type": "coreclr",
- "request": "launch",
- "console": "internalConsole",
- "preLaunchTask": "build",
- "program": "${workspaceRoot}/tools/keycloak/sync/bin/Debug/net6.0/Pims.Tools.Keycloak.Sync.dll",
- "cwd": "${workspaceRoot}/tools/keycloak/sync",
- "stopAtEntry": false,
- "requireExactSource": false
- },
- {
- "name": "Tool-Converter",
- "type": "coreclr",
- "request": "launch",
- "console": "internalConsole",
- "preLaunchTask": "build",
- "program": "${workspaceRoot}/tools/converters/excel/bin/Debug/net7.0/Pims.Tools.Converters.ExcelConverter.dll",
- "cwd": "${workspaceRoot}/tools/converters/excel",
- "stopAtEntry": false
- },
- {
- "name": "Tool-Import",
- "type": "coreclr",
- "request": "launch",
- "console": "internalConsole",
- "preLaunchTask": "build",
- "program": "${workspaceRoot}/tools/import/bin/Debug/net7.0/Pims.Tools.Import.dll",
- "cwd": "${workspaceRoot}/tools/import",
- "stopAtEntry": false
- },
- {
- "name": ".NET Core Launch (api)",
- "type": "coreclr",
- "request": "launch",
- "preLaunchTask": "build",
- "program": "${workspaceFolder}/backend/api/bin/Debug/net7.0/Pims.Api.dll",
- "args": [],
- "cwd": "${workspaceFolder}/backend/api",
- "stopAtEntry": false,
- "env": {
- "ASPNETCORE_ENVIRONMENT": "Local",
- "ASPNETCORE_URLS": "http://*:5000;https://*:433"
- },
- "sourceFileMap": {
- "/Views": "${workspaceFolder}/backend/Views"
- }
- },
- {
- "name": ".NET Core Attach",
- "type": "coreclr",
- "request": "attach",
- "processId": "${command:pickProcess}"
- }
- ]
-}
diff --git a/.vscode/settings.json b/.vscode/settings.json
deleted file mode 100644
index 05e5f95cfc..0000000000
--- a/.vscode/settings.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- "dotnet-test-explorer.testProjectPath": "./backend",
- "csharpfixformat.style.braces.onSameLine": false,
- "sqltools.connections": [
- {
- "database": "keycloak",
- "driver": "PostgreSQL",
- "name": "Keycloak",
- "askForPassword": true,
- "port": 5432,
- "server": "localhost",
- "username": "keycloak"
- },
- {
- "database": "geospatial",
- "driver": "PostgreSQL",
- "name": "Geo-spatial",
- "password": "password",
- "port": 5433,
- "server": "localhost",
- "username": "postgres"
- },
- {
- "database": "master",
- "driver": "MSSQL",
- "name": "MSSQL-RedHat-master",
- "password": "6I6KXYc6SDscXq7j",
- "port": 1433,
- "server": "localhost",
- "username": "sa"
- },
- {
- "database": "geospatial",
- "driver": "MSSQL",
- "isActive": true,
- "isConnected": true,
- "name": "MSSQL-RedHat-geospatial",
- "password": "6I6KXYc6SDscXq7j",
- "port": 1433,
- "server": "localhost",
- "username": "sa"
- },
- {
- "mssqlOptions": {
- "appName": "SQLTools",
- "useUTC": true,
- "encrypt": true
- },
- "previewLimit": 50,
- "server": "localhost",
- "port": 5433,
- "askForPassword": true,
- "driver": "MSSQL",
- "name": "pims",
- "database": "pims",
- "username": "admin"
- }
- ],
- "[javascript]": {
- "editor.defaultFormatter": "esbenp.prettier-vscode"
- }
-}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644
index 04112de5c7..0000000000
--- a/.vscode/tasks.json
+++ /dev/null
@@ -1,84 +0,0 @@
-{
- "version": "2.0.0",
- "tasks": [{
- "label": "build",
- "command": "dotnet",
- "type": "process",
- "args": [
- "build",
- "${workspaceFolder}/backend/api/Pims.Api.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "publish",
- "command": "dotnet",
- "type": "process",
- "args": [
- "publish",
- "${workspaceFolder}/backend/api/Pims.Api.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "watch",
- "command": "dotnet",
- "type": "process",
- "args": [
- "watch",
- "run",
- "${workspaceFolder}/backend/api/Pims.Api.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "test",
- "command": "dotnet",
- "type": "shell",
- "group": "test",
- "args": [
- "test",
- "${workspaceFolder}/backend/test/Pims.Api.Test.csproj"
- ],
- "presentation": {
- "reveal": "silent"
- },
- "problemMatcher": "$msCompile"
- },
- {
- "type": "docker-build",
- "label": "docker-build",
- "platform": "node",
- "dockerBuild": {
- "dockerfile": "${workspaceFolder}/Dockerfile",
- "context": "${workspaceFolder}"
- }
- },
- {
- "type": "docker-run",
- "label": "docker-run: release",
- "dependsOn": ["docker-build"],
- "platform": "node"
- },
- {
- "type": "docker-run",
- "label": "docker-run: debug",
- "dependsOn": ["docker-build"],
- "dockerRun": {
- "env": {
- "DEBUG": "*",
- "NODE_ENV": "development"
- }
- },
- "node": {
- "enableDebugging": true
- }
- }
- ]
-}
diff --git a/Makefile b/Makefile
deleted file mode 100644
index c35407b65d..0000000000
--- a/Makefile
+++ /dev/null
@@ -1,152 +0,0 @@
-#!/usr/bin/make
-
-SHELL := /usr/bin/env bash
-.DEFAULT_GOAL := help
-
-ifneq ($(OS),Windows_NT)
-POSIXSHELL := 1
-else
-POSIXSHELL :=
-endif
-
-# to see all colors, run
-# bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done'
-# the first 15 entries are the 8-bit colors
-
-# define standard colors
-BLACK := $(shell tput -Txterm setaf 0)
-RED := $(shell tput -Txterm setaf 1)
-GREEN := $(shell tput -Txterm setaf 2)
-YELLOW := $(shell tput -Txterm setaf 3)
-LIGHTPURPLE := $(shell tput -Txterm setaf 4)
-PURPLE := $(shell tput -Txterm setaf 5)
-BLUE := $(shell tput -Txterm setaf 6)
-WHITE := $(shell tput -Txterm setaf 7)
-
-RESET := $(shell tput -Txterm sgr0)
-
-# default "prompt"
-P = ${GREEN}[+]${RESET}
-
-help:
- @grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-
-.PHONY: help
-
-##############################################################################
-# Docker Development
-##############################################################################
-
-restart: ## Restart local docker environment (n=service name)
- $(info Restart local docker environment)
- @make stop n=$(n)
- @make up n=$(n)
-
-refresh: ## Recreates local docker environment (n=service name)
- $(info Recreates local docker environment)
- @make stop n=$(n)
- @make build n=$(n)
- @make up n=$(n)
-
-up: ## Runs the local containers (n=service name), stop dev container first
- @echo "$(P) Running client and server..."
- @docker compose rm -sf frontend-dev
- @docker compose --env-file .env --profile prod up -d $(n)
-
-up-dev: ## Runs the local containers (n=service name), stop prod container first
- @echo "$(P) Running client and server..."
- @docker compose rm -sf frontend
- @make npm-refresh
- @docker compose --env-file .env --profile dev up -d $(n)
-
-down: ## Stops the local containers and removes them
- @echo "$(P) Stopping client and server..."
- @docker compose down
-
-stop: ## Stops the local containers (n=service name)
- @echo "$(P) Stopping client and server..."
- @docker compose stop $(n)
-
-build: ## Builds the local containers (n=service name)
- @echo "$(P) Building images..."
- @docker compose --profile prod build --no-cache $(n)
-
-rebuild: ## Build the local contains (n=service name) and then start them after building
- @make build n=$(n)
- @make up n=$(n)
-
-clean: ## Removes all local containers, images, volumes, etc
- @echo "$(P) Removing all containers, images, volumes for solution."
- @docker compose rm -f -v -s
- @docker volume rm -f pims-app-node-cache
- @docker volume rm -f database-data
-
-setup: ## Setup local container environment, initialize keycloak and database
- @make build; make up; make pause-30; make db-update;
-
-pause-30:
- @echo "$(P) Pausing 30 seconds..."
- @-sleep 30
-
-client-test: ## Runs the client tests in a container
- @echo "$(P) Running client unit tests..."
- @docker compose --env-file .env run frontend npm test
-
-server-test: ## Runs the server tests in a container
- @echo "$(P) Running server unit tests..."
- @docker compose --env-file .env run backend dotnet test
-
-server-run: ## Starts local server containers
- @echo "$(P) Starting server containers..."
- @docker compose --env-file .env up -d backend
-
-npm-clean: ## Removes local containers, images, volumes, for frontend-dev container.
- @echo "$(P) Removing frontend containers and volumes."
- @docker compose stop frontend-dev
- @docker compose rm -f -v -s frontend-dev
- @docker volume rm -f pims-app-node-cache
-
-npm-refresh: ## Cleans and rebuilds the frontend-dev container. This is useful when npm packages are changed.
- @make npm-clean;
- @docker compose up frontend-dev --build -d
-
-db-migrations: ## Display a list of migrations.
- @echo "$(P) Display a list of migrations."
- @cd backend/dal; dotnet ef migrations list
-
-db-add: ## Add a new database migration for the specified name (n=name of migration).
- @echo "$(P) Create a new database migration for the specified name."
- @cd backend/dal; dotnet ef migrations add $(n); code -r ./Migrations/*_$(n).cs
- @./scripts/db-migration.sh $(n);
-
-db-update: ## Update the database with the latest migration.
- @echo "$(P) Updating database with latest migration..."
- @docker compose --env-file .env up -d database; cd backend/dal; dotnet ef database update
-
-db-rollback: ## Rollback to the specified database migration (n=name of migration).
- @echo "$(P) Rollback to the specified database migration."
- @cd backend/dal; dotnet ef database update $(n);
-
-db-remove: ## Remove the last database migration.
- @echo "$(P) Remove the last migration."
- @cd backend/dal; dotnet ef migrations remove --force;
-
-db-clean: ## Re-creates an empty docker database - ready for seeding.
- @echo "$(P) Refreshing the database..."
- @cd backend/dal; dotnet ef database drop --force; dotnet ef database update
-
-db-refresh: | server-run pause-30 db-clean ## Refresh the database and seed it with data.
-
-db-drop: ## Drop the database.
- @echo "$(P) Drop the database."
- @cd backend/dal; dotnet ef database drop;
-
-db-script: ## Export an SQL script from the migration (from=0 to=Initial).
- @echo "$(P) Exporting script to 'db-migration.sql'"
- @cd backend/dal; dotnet ef migrations script ${from} ${to} --output ../../db-migration.sql
-
-convert: ## Convert Excel files to JSON
- @echo "$(P) Convert Excel files to JSON..."
- @cd tools/converters/excel; dotnet build; dotnet run;
-
-.PHONY: local setup restart refresh up down stop build rebuild clean client-test server-test pause-30 server-run db-migrations db-add db-update db-rollback db-remove db-clean db-drop db-refresh npm-clean npm-refresh convert
diff --git a/adr/ches.md b/adr/ches.md
deleted file mode 100644
index 0e1daf9862..0000000000
--- a/adr/ches.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Notifications - Email Service
-
-## Status
-
-> Accepted
-
-> June 16, 2020
-
-## Context
-
-PIMS requires a way to send email notifications to agencies throughout the workflow of disposing properties.
-
-Use Cases;
-
-- Whitelist of agencies who will receive emails
-- Inform all agencies of a new properties in the Enhanced Referral Program (ERP)
-- A way for agencies to show interest, or to opt out of further notifications
-- Inform all agencies of status change or progress of properties in ERP
-- Inform owning agency of status change of disposal project
-- Notify owning agency of requirement or information
-
-The **Common Hosted Email Service (CHES)** is a free service offered and supported by the **Exchange Lab**.
-
-Additional Information here;
-
-- [Common Services Showcase](https://bcgov.github.io/common-service-showcase/)
-- [Common Hosted Email Service](https://bcgov.github.io/common-service-showcase/#CHES)
-- [GetOk](https://getok.pathfinder.gov.bc.ca/getok/about)
-- [GetOk - PIMS](https://getok.pathfinder.gov.bc.ca/getok/apps/PIMS)
-- [ReDoc](https://ches-master-9f0fbe-prod.pathfinder.gov.bc.ca/api/v1/docs)
-- [GitHub](https://github.com/bcgov/common-hosted-email-service)
-
-## Decision
-
-The decision is to integrate with the **CHES** or to continue looking for another solution to provide notification emails.
-
-The key features **CHES** has are;
-
-- Send emails with attachments and special business tagging
-- Schedule for delayed delivery, with ability to cancel
-- Create bulk email merge with your own templates.
-- Send plain text or HTML emails
-- Track the status of your request
-
-In addition to integrating with **CHES** it will require developing the following features within PIMS;
-
-- Maintain a list of `txId` and `msgId` so that messages can be tracked and cancelled if required.
-- Notifications are `async` which will require design/workflow that handles failures.
-- Manage a collection of templates that will be used for messages.
-
-## Consequences
-
-The primary benefit of integrating with **CHES** is that we don't have to support or build an email notification solution.
-Additionally **CHES** is supported and used by other projects with the Lab, which means internal support and knowledge sharing.
-
-Some of the consequences would/might be;
-
-- No SLA
-- No UI application to support
diff --git a/adr/database.md b/adr/database.md
deleted file mode 100644
index 208ea6586f..0000000000
--- a/adr/database.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# Database Choice - MS-SQL
-
-## Status
-
-> Accepted
-
-> January 1, 2020
-
-## Context
-
-PIMS requires a database to store all property information.
-The data is relational, requiring constraints and must run within a Linux docker container on OpenShift.
-Additionally it must be supported by Entity Framework Core 3.1.
-
-## Decision
-
-Originally the database generated for the SWU was with PostgreSQL, after further consideration it made more sense to tightly couple both MS-SQL with .NET Core.
-This will give us better performance and tighter integration with Entity Framework Core.
-It was decided to create a Linux docker container to host the MS-SQL 2019 database.
-
-## Consequences
-
-There are benefits from doing it as there is tighter integration with Entity Framework Core.
-One such example is simpler optimistic concurrency handling.
-It makes it move difficult with additional effort to setup OpenShift, as there are not existing lab projects we can use.
diff --git a/adr/geocoder.md b/adr/geocoder.md
deleted file mode 100644
index 429f5db046..0000000000
--- a/adr/geocoder.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# Data BC Geocoder
-
-## Status
-
-> Accepted
-
-> June 18, 2020
-
-## Context
-
-Presently when submitting new properties or editing existing properties within inventory the only way to set the latitude and longitude values is manually.
-Ideally the inventory would use GIS location values that are pulled from Data BC (better source of truth).
-
-Providing a way through the property address to pull valid GIS coordinates from Data BC Geocoder would improve the data and the user experience.
-
-Additionally Geocoder can be used to verify addresses that are manually entered.
-
-- [Geocoder](https://www2.gov.bc.ca/gov/content/data/geographic-data-services/location-services/geocoder)
-- [Data BC](https://catalogue.data.gov.bc.ca/dataset/bc-address-geocoder-web-service)
-- [API Swagger](https://catalogue.data.gov.bc.ca/dataset/bc-address-geocoder-web-service/resource/40d6411e-ab98-4df9-a24e-67f81c45f6fa/view/1d3c42fc-53dc-4aab-ae3b-f4d056cb00e0)
-- [Developer API Keys](https://github.com/bcgov/gwa/wiki/Developer-Guide#developer-api-keys)
-- API Host = `https://geocoder.api.gov.bc.ca`
-
-## Decision
-
-Integrate with Data BC Geocoder API.
-When a user types an address a list of viable matches will be displayed.
-If the user selects one of the matches it will be used to set the address and GIS coordinates,.
-
-## Consequences
-
-Submitting new properties and editing existing properties will be easier and less error prone.
-
-GIS coordinates will be more tightly integrated with a single source of truth, and therefore more consistent and authentic.
-
-Address values can be verified.
diff --git a/adr/leaflet.md b/adr/leaflet.md
deleted file mode 100644
index c13076e933..0000000000
--- a/adr/leaflet.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# Leaflet
-
-## Status
-
-> Accepted
-
-> January 1, 2020
-
-## Context
-
-The project requires a GIS component to display a map, properties on the map and property boundaries.
-
-The following options were reviewed;
-
-- [ArcGIS](https://www.arcgis.com/index.html)
-- [Leaflet](https://leafletjs.com/)
-- [Data BC](https://data.gov.bc.ca/)
-- [LTSA](https://ltsa.ca/)
-
-## Decision
-
-The PIMS project will use Leaflet for the basic GIS solution.
-
-## Consequences
-
-Leaflet only offers a few features and performance isn't spectacular.
-Using Leaflet is the simplest and most efficient option.
-It is free to use.
-Only requires making requests to their API.
diff --git a/adr/map-source-boundaries.md b/adr/map-source-boundaries.md
deleted file mode 100644
index 823641b069..0000000000
--- a/adr/map-source-boundaries.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# GIS Parcel Boundary Map Source
-
-## Status
-
-> Accepted
-
-> May 1, 2020
-
-## Context
-
-To improve usability of the map it is required that we include the parcel boundaries as a default layer.
-Data BC currently provides mapping layers (which includes parcel boundaries).
-
-- [openmaps.gov.bc.ca](https://www2.gov.bc.ca/gov/content/data/geographic-data-services/web-based-mapping/map-services)
-
-## Decision
-
-Add the **Data BC** openmaps parcel boundaries layer to the default map.
-
-## Consequences
-
-Adding additional layers to the map will increase the amount of data that needs to be requested and displayed.
-This will make the user experience slower, but will improve the view of property information (boundaries).
diff --git a/adr/model-mapping.md b/adr/model-mapping.md
deleted file mode 100644
index 367ec5f128..0000000000
--- a/adr/model-mapping.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Model Mapping Change - AutoMapper to Mapster
-
-## Status
-
-> Accepted
-
-> April 15, 2020
-
-## Context
-
-The current model mapping library [AutoMapper](https://automapper.org/) ([GitHub](https://github.com/AutoMapper/AutoMapper)) requires a lot of effort to configure.
-It is near impossible to debug.
-It is not intuitive to develop with.
-The benefits and features it offers are far outweighed by the time invested in implementation and maintenance.
-
-A new library is required to speed up development and improve the debugging experience.
-
-## Decision
-
-[Mapster](https://github.com/MapsterMapper/Mapster/wiki) ([source](https://github.com/MapsterMapper/Mapster)) provides a more intuitive solution, along with performance benefits.
-
-## Consequences
-
-The industry adoption of AutoMapper is much higher than Mapster.
-AutoMapper has more features available (although irrelevant at this point in time).
-
-Mapster is far more intuitive when developing.
-It is far better in performance.
-It can be debugged, and provides better error handling.
-The structure is similar enough to AutoMapper that the learning curve is minimal.
-However global configuration appears to be more challenging when used with Dependency Injection.
diff --git a/adr/monorepo.md b/adr/monorepo.md
deleted file mode 100644
index 5a0021aa8a..0000000000
--- a/adr/monorepo.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Monorepo vs Multirepo
-
-## Status
-
-> Accepted
-
-> January 1, 2020
-
-## Context
-
-Our project involves developing a number of tools and layers to support PIMS.
-This includes at present the following;
-
-- Frontend GUI Web Application
-- Backend RESTful API
-- Frontend GIS components
-- Backend database
-- Keycloak integration
-- OpenShift integration
-- Docker integration
-- ETL tools
-
-## Decision
-
-The Exchange Lab's practice is to use the monorepo solution.
-
-## Consequences
-
-SonarQube doesn't natively support monorepos with different programming languages.
-
-DevOps is more complicated with a monorepo.
-
-A benefit of the monorepo is that it is easier to maintain and perform rapid iterations.
diff --git a/adr/programming-languages.md b/adr/programming-languages.md
deleted file mode 100644
index 8fed5b2cda..0000000000
--- a/adr/programming-languages.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# Programming Languages
-
-## Status
-
-> Accepted
-
-> January 1, 2020
-
-## Context
-
-We need to choose programming languages for our software. We have two major needs: a front-end programming language suitable for web applications, and a back-end programming language suitable for server applications.
-
-The languages selected should be part of the skillset and expierence of the team members.
-They should have broad industry support.
-They should be supported by GIS related plugins, libraries and tools.
-
-## Decision
-
-We are choosing TypeScript and React for the front-end.
-
-We are choosing .NET Core 3.1 for the back-end API.
-
-## Consequences
-
-Not all team members have TypeScript and React experience.
-This however is also a benefit in the sense they will now have an opportunity.
diff --git a/backend/.dockerignore b/backend/.dockerignore
deleted file mode 100644
index 7ed9d732a6..0000000000
--- a/backend/.dockerignore
+++ /dev/null
@@ -1,18 +0,0 @@
-.vs/
-.env
-
-# Build results
-[Dd]ebug/
-[Dd]ebugPublic/
-[Rr]elease/
-[Rr]eleases/
-x64/
-x86/
-build/
-bld/
-**/[Bb]in/
-**/[Oo]bj/
-**/[Oo]ut/
-msbuild.log
-msbuild.err
-msbuild.wrn
diff --git a/backend/.editorconfig b/backend/.editorconfig
deleted file mode 100644
index 1cbc50d983..0000000000
--- a/backend/.editorconfig
+++ /dev/null
@@ -1,27 +0,0 @@
-# Editor configuration, see https://editorconfig.org
-root = true
-
-[*]
-end_of_line = lf
-charset = utf-8
-indent_style = space
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-[*.ts]
-indent_size = 2
-
-[*.cs]
-indent_size = 4
-
-[*.md]
-max_line_length = off
-trim_trailing_whitespace = false
-
-[*.env]
-insert_final_newline = false
-
-[{Makefile,**.mk}]
-# Use tabs for indentation (Makefiles require tabs)
-indent_style = tab
-
diff --git a/backend/.gitignore b/backend/.gitignore
deleted file mode 100644
index 1da9b51693..0000000000
--- a/backend/.gitignore
+++ /dev/null
@@ -1,52 +0,0 @@
-# Environment variables
-.env
-connectionstrings.*json
-.vscode/settings.json
-
-*.swp
-*.*~
-project.lock.json
-.DS_Store
-*.pyc
-nupkg/
-
-# IDE - VSCode
-.vscode/*
-!.vscode/settings.json
-!.vscode/tasks.json
-!.vscode/launch.json
-!.vscode/extensions.json
-TestResults/
-
-# Rider
-.idea
-
-# User-specific files
-*.suo
-*.user
-*.userosscache
-*.sln.docstates
-
-# Build results
-**/[Dd]ebug/
-**/[Dd]ebugPublic/
-**/[Rr]elease/
-**/[Rr]eleases/
-**/x64/
-**/x86/
-**/build/
-**/bld/
-**/[Bb]in/
-**/[Oo]bj/
-**/[Oo]ut/
-**/msbuild.log
-**/msbuild.err
-**/msbuild.wrn
-
-# Visual Studio 2015
-.vs/
-
-# NET Core Healthchecks UI
-healthchecksdb
-healthchecksdb-shm
-healthchecksdb-wal
diff --git a/backend/.vscode/launch.json b/backend/.vscode/launch.json
deleted file mode 100644
index d069e97ed3..0000000000
--- a/backend/.vscode/launch.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- // Use IntelliSense to find out which attributes exist for C# debugging
- // Use hover for the description of the existing attributes
- // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
- "version": "0.2.0",
- "configurations": [
- {
- "name": ".NET Core Launch (web)",
- "type": "coreclr",
- "request": "launch",
- "preLaunchTask": "build",
- "program": "${workspaceFolder}/api/bin/Debug/net7.0/Pims.Api.dll",
- "args": [],
- "cwd": "${workspaceFolder}/api",
- "stopAtEntry": false,
- "requireExactSource": false,
- "env": {
- "ASPNETCORE_ENVIRONMENT": "Local",
- "ASPNETCORE_URLS": "http://*:5000;https://*:433"
- },
- "sourceFileMap": {
- "/Views": "${workspaceFolder}/Views"
- }
- },
- {
- "name": ".NET Core Attach",
- "type": "coreclr",
- "request": "attach",
- "processId": "${command:pickProcess}"
- },
- {
- "name": "Docker .NET Core Launch",
- "type": "docker",
- "request": "launch",
- "preLaunchTask": "docker-run: debug",
- "netCore": {
- "appProject": "${workspaceFolder}/api/Pims.Api.csproj"
- }
- }
- ]
-}
diff --git a/backend/.vscode/tasks.json b/backend/.vscode/tasks.json
deleted file mode 100644
index a6e596733b..0000000000
--- a/backend/.vscode/tasks.json
+++ /dev/null
@@ -1,95 +0,0 @@
-{
- "version": "2.0.0",
- "tasks": [
- {
- "label": "build",
- "command": "dotnet",
- "type": "process",
- "args": [
- "build",
- "${workspaceFolder}/api/Pims.Api.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "publish",
- "command": "dotnet",
- "type": "process",
- "args": [
- "publish",
- "${workspaceFolder}/api/Pims.Api.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "watch",
- "command": "dotnet",
- "type": "process",
- "args": [
- "watch",
- "run",
- "${workspaceFolder}/api/Pims.Api.csproj",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "type": "docker-build",
- "label": "docker-build: debug",
- "dependsOn": ["build"],
- "dockerBuild": {
- "tag": "backend:dev",
- "target": "base",
- "dockerfile": "${workspaceFolder}/Dockerfile",
- "context": "${workspaceFolder}",
- "pull": true
- },
- "netCore": {
- "appProject": "${workspaceFolder}/api/Pims.Api.csproj"
- }
- },
- {
- "type": "docker-build",
- "label": "docker-build: release",
- "dependsOn": ["build"],
- "dockerBuild": {
- "tag": "backend:latest",
- "dockerfile": "${workspaceFolder}/Dockerfile",
- "context": "${workspaceFolder}",
- "pull": true
- },
- "netCore": {
- "appProject": "${workspaceFolder}/api/Pims.Api.csproj"
- }
- },
- {
- "type": "docker-run",
- "label": "docker-run: debug",
- "dependsOn": ["docker-build: debug"],
- "dockerRun": {
- "envFiles": ["${workspaceFolder}\\api\\.env"],
- "network": "pims-net",
- "ports": [{ "hostPort": 5000, "containerPort": 80 }]
- },
- "netCore": {
- "appProject": "${workspaceFolder}/api/Pims.Api.csproj",
- "configureSsl": false,
- "enableDebugging": true
- }
- },
- {
- "type": "docker-run",
- "label": "docker-run: release",
- "dependsOn": ["docker-build: release"],
- "dockerRun": {},
- "netCore": {
- "appProject": "${workspaceFolder}/api/Pims.Api.csproj"
- }
- }
- ]
-}
diff --git a/backend/Dockerfile b/backend/Dockerfile
deleted file mode 100644
index 93501774a2..0000000000
--- a/backend/Dockerfile
+++ /dev/null
@@ -1,41 +0,0 @@
-ARG BUILD_CONFIGURATION=Release
-FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
-WORKDIR /app
-EXPOSE 443 8080
-
-# Copy csproj and restore as distinct layers
-FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
-WORKDIR /src
-COPY *.sln .
-COPY api/*.csproj api/
-COPY entities/*.csproj entities/
-COPY tests/core/*.csproj tests/core/
-COPY tests/unit/api/*.csproj tests/unit/api/
-COPY tests/unit/dal/*.csproj tests/unit/dal/
-COPY dal/*.csproj dal/
-COPY dal.keycloak/*.csproj dal.keycloak/
-COPY keycloak/*.csproj keycloak/
-COPY geocoder/*.csproj geocoder/
-COPY ches/*.csproj ches/
-COPY notifications/*.csproj notifications/
-COPY core/*.csproj core/
-COPY ltsa/*.csproj ltsa/
-
-RUN dotnet restore
-ENV PATH="$PATH:/root/.dotnet/tools"
-RUN dotnet tool install --global dotnet-ef --version 7.0.5
-# Copy everything else and build
-COPY . .
-WORKDIR /src/api
-RUN dotnet build "Pims.Api.csproj" -c "$BUILD_CONFIGURATION" -o /app/build
-
-FROM build AS publish
-RUN dotnet publish "Pims.Api.csproj" -c "$BUILD_CONFIGURATION" -o /app/publish
-
-# Runtime image
-FROM base AS final
-WORKDIR /app
-COPY --from=publish /app/publish .
-COPY entrypoint.sh .
-RUN chmod +x /app/entrypoint.sh
-ENTRYPOINT ["/app/entrypoint.sh"]
diff --git a/backend/Dockerfile.migrations b/backend/Dockerfile.migrations
deleted file mode 100644
index 584a8dad1a..0000000000
--- a/backend/Dockerfile.migrations
+++ /dev/null
@@ -1,20 +0,0 @@
-
-FROM mcr.microsoft.com/dotnet/sdk:7.0
-
-ENV DOTNET_CLI_HOME=/tmp
-ENV XDG_DATA_HOME=/tmp
-ENV PATH="$PATH:/tmp/.dotnet/tools"
-
-# Switch to root for package installs
-USER 0
-RUN dotnet tool install --global dotnet-ef --version 7.0.5
-
-WORKDIR /src
-COPY . .
-RUN fix_permissions() { while [ $# -gt 0 ] ; do chgrp -R 0 "$1" && chmod -R g=u "$1"; shift; done } && \
- fix_permissions "/src" "/tmp"
-
-# Run container by default as user with id 1001 (default)
-USER 1001
-
-ENTRYPOINT cd /src/dal && dotnet ef database update -v
diff --git a/backend/Dockerfile.ocp b/backend/Dockerfile.ocp
deleted file mode 100644
index be4bfc8ff4..0000000000
--- a/backend/Dockerfile.ocp
+++ /dev/null
@@ -1,41 +0,0 @@
-ARG BUILD_CONFIGURATION=Release
-FROM image-registry.apps.silver.devops.gov.bc.ca/354028-tools/dotnet-aspnet-runtime:7.0 AS base
-WORKDIR /app
-EXPOSE 443 8080
-
-# Copy csproj and restore as distinct layers
-FROM image-registry.apps.silver.devops.gov.bc.ca/354028-tools/dotnet-sdk:7.0 AS build
-WORKDIR /src
-COPY *.sln .
-COPY api/*.csproj api/
-COPY entities/*.csproj entities/
-COPY tests/core/*.csproj tests/core/
-COPY tests/unit/api/*.csproj tests/unit/api/
-COPY tests/unit/dal/*.csproj tests/unit/dal/
-COPY dal/*.csproj dal/
-COPY dal.keycloak/*.csproj dal.keycloak/
-COPY keycloak/*.csproj keycloak/
-COPY geocoder/*.csproj geocoder/
-COPY ches/*.csproj ches/
-COPY notifications/*.csproj notifications/
-COPY core/*.csproj core/
-COPY ltsa/*.csproj ltsa/
-
-RUN dotnet restore
-ENV PATH="$PATH:/root/.dotnet/tools"
-RUN dotnet tool install --global dotnet-ef --version 7.0.5
-# Copy everything else and build
-COPY . .
-WORKDIR /src/api
-RUN dotnet build "Pims.Api.csproj" -c "$BUILD_CONFIGURATION" -o /app/build
-
-FROM build AS publish
-RUN dotnet publish "Pims.Api.csproj" -c "$BUILD_CONFIGURATION" -o /app/publish
-
-# Runtime image
-FROM base AS final
-WORKDIR /app
-COPY --from=publish /app/publish .
-COPY entrypoint.sh .
-RUN chmod +x /app/entrypoint.sh
-ENTRYPOINT ["/app/entrypoint.sh"]
diff --git a/backend/Pims.sln b/backend/Pims.sln
deleted file mode 100644
index 4e2c908abc..0000000000
--- a/backend/Pims.sln
+++ /dev/null
@@ -1,251 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.5.33530.505
-MinimumVisualStudioVersion = 15.0.26124.0
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Api", "api\Pims.Api.csproj", "{16BC0468-78F6-4C91-87DA-7403C919E646}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal", "dal\Pims.Dal.csproj", "{6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal.Entities", "entities\Pims.Dal.Entities.csproj", "{1C724CD5-CD24-46CD-835A-A83F673F97B5}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Keycloak", "keycloak\Pims.Keycloak.csproj", "{970903E9-BC53-436F-BA77-C62349546425}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Core", "core\Pims.Core.csproj", "{AC8F04FF-3164-41FB-9EDF-E468B8B77837}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal.Keycloak", "dal.keycloak\Pims.Dal.Keycloak.csproj", "{5697DD19-62CC-4377-ABA8-1E192376F4F6}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{8D3E4CB2-41D6-4AA6-B9E4-CFCAB0E2F5BC}"
- ProjectSection(SolutionItems) = preProject
- .dockerignore = .dockerignore
- .editorconfig = .editorconfig
- .gitignore = .gitignore
- Dockerfile = Dockerfile
- Dockerfile.bak = Dockerfile.bak
- entrypoint.sh = entrypoint.sh
- README.md = README.md
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libraries", "libraries", "{5237F8A4-67F5-4751-B8B2-B93A06791480}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A0343C94-486E-4A06-9A64-0584D20A4728}"
- ProjectSection(SolutionItems) = preProject
- docs\API.md = docs\API.md
- docs\DAL.md = docs\DAL.md
- docs\DATABASE.md = docs\DATABASE.md
- docs\GITHUB-ACTIONS.md = docs\GITHUB-ACTIONS.md
- docs\SETUP.md = docs\SETUP.md
- docs\TOOLS.md = docs\TOOLS.md
- docs\VERSIONING.md = docs\VERSIONING.md
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{F256F2A5-0DBF-4137-A7D6-21F08111BD4A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{3D70B211-74A8-484C-9B86-B0A2835C71E7}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Api.Test", "tests\unit\api\Pims.Api.Test.csproj", "{1F4E301C-F03B-4A31-A6F2-6A77384A74DA}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Dal.Test", "tests\unit\dal\Pims.Dal.Test.csproj", "{412BF533-2759-4FBE-B4C6-B89DB44FB6B5}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{04780892-FC30-4B6B-A10C-5795C657E574}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Core.Test", "tests\core\Pims.Core.Test.csproj", "{5A83C636-741A-4795-8588-70F033E79B5A}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Geocoder", "geocoder\Pims.Geocoder.csproj", "{BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Ches", "ches\Pims.Ches.csproj", "{08A82D74-0854-498F-9C74-E0A7242FE430}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Notifications", "notifications\Pims.Notifications.csproj", "{3942CAF2-93CE-45BC-A734-3247D266ECE6}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pims.Ltsa", "ltsa\Pims.Ltsa.csproj", "{4DB543FF-19CF-4FA8-B772-2AE7E6721F86}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|x64.ActiveCfg = Debug|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|x64.Build.0 = Debug|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|x86.ActiveCfg = Debug|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Debug|x86.Build.0 = Debug|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|Any CPU.Build.0 = Release|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|x64.ActiveCfg = Release|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|x64.Build.0 = Release|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|x86.ActiveCfg = Release|Any CPU
- {16BC0468-78F6-4C91-87DA-7403C919E646}.Release|x86.Build.0 = Release|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|x64.ActiveCfg = Debug|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|x64.Build.0 = Debug|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|x86.ActiveCfg = Debug|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Debug|x86.Build.0 = Debug|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|Any CPU.Build.0 = Release|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|x64.ActiveCfg = Release|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|x64.Build.0 = Release|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|x86.ActiveCfg = Release|Any CPU
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3}.Release|x86.Build.0 = Release|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|x64.Build.0 = Debug|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|x86.ActiveCfg = Debug|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Debug|x86.Build.0 = Debug|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|Any CPU.Build.0 = Release|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|x64.ActiveCfg = Release|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|x64.Build.0 = Release|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|x86.ActiveCfg = Release|Any CPU
- {1C724CD5-CD24-46CD-835A-A83F673F97B5}.Release|x86.Build.0 = Release|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Debug|x64.ActiveCfg = Debug|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Debug|x64.Build.0 = Debug|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Debug|x86.ActiveCfg = Debug|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Debug|x86.Build.0 = Debug|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Release|Any CPU.Build.0 = Release|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Release|x64.ActiveCfg = Release|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Release|x64.Build.0 = Release|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Release|x86.ActiveCfg = Release|Any CPU
- {970903E9-BC53-436F-BA77-C62349546425}.Release|x86.Build.0 = Release|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|x64.ActiveCfg = Debug|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|x64.Build.0 = Debug|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|x86.ActiveCfg = Debug|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Debug|x86.Build.0 = Debug|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|Any CPU.Build.0 = Release|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|x64.ActiveCfg = Release|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|x64.Build.0 = Release|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|x86.ActiveCfg = Release|Any CPU
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837}.Release|x86.Build.0 = Release|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|x64.ActiveCfg = Debug|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|x64.Build.0 = Debug|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|x86.ActiveCfg = Debug|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Debug|x86.Build.0 = Debug|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|Any CPU.Build.0 = Release|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|x64.ActiveCfg = Release|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|x64.Build.0 = Release|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|x86.ActiveCfg = Release|Any CPU
- {5697DD19-62CC-4377-ABA8-1E192376F4F6}.Release|x86.Build.0 = Release|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|x64.Build.0 = Debug|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|x86.ActiveCfg = Debug|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Debug|x86.Build.0 = Debug|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|Any CPU.Build.0 = Release|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|x64.ActiveCfg = Release|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|x64.Build.0 = Release|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|x86.ActiveCfg = Release|Any CPU
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA}.Release|x86.Build.0 = Release|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|x64.ActiveCfg = Debug|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|x64.Build.0 = Debug|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|x86.ActiveCfg = Debug|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Debug|x86.Build.0 = Debug|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|Any CPU.Build.0 = Release|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|x64.ActiveCfg = Release|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|x64.Build.0 = Release|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|x86.ActiveCfg = Release|Any CPU
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5}.Release|x86.Build.0 = Release|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|x64.ActiveCfg = Debug|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|x64.Build.0 = Debug|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Debug|x86.Build.0 = Debug|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Release|Any CPU.Build.0 = Release|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Release|x64.ActiveCfg = Release|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Release|x64.Build.0 = Release|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Release|x86.ActiveCfg = Release|Any CPU
- {5A83C636-741A-4795-8588-70F033E79B5A}.Release|x86.Build.0 = Release|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|x64.ActiveCfg = Debug|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|x64.Build.0 = Debug|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|x86.ActiveCfg = Debug|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Debug|x86.Build.0 = Debug|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|Any CPU.Build.0 = Release|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|x64.ActiveCfg = Release|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|x64.Build.0 = Release|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|x86.ActiveCfg = Release|Any CPU
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC}.Release|x86.Build.0 = Release|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|x64.ActiveCfg = Debug|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|x64.Build.0 = Debug|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|x86.ActiveCfg = Debug|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Debug|x86.Build.0 = Debug|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|Any CPU.Build.0 = Release|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|x64.ActiveCfg = Release|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|x64.Build.0 = Release|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|x86.ActiveCfg = Release|Any CPU
- {08A82D74-0854-498F-9C74-E0A7242FE430}.Release|x86.Build.0 = Release|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|x64.ActiveCfg = Debug|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|x64.Build.0 = Debug|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|x86.ActiveCfg = Debug|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Debug|x86.Build.0 = Debug|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|Any CPU.Build.0 = Release|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|x64.ActiveCfg = Release|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|x64.Build.0 = Release|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|x86.ActiveCfg = Release|Any CPU
- {3942CAF2-93CE-45BC-A734-3247D266ECE6}.Release|x86.Build.0 = Release|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|x64.ActiveCfg = Debug|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|x64.Build.0 = Debug|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|x86.ActiveCfg = Debug|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Debug|x86.Build.0 = Debug|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|Any CPU.Build.0 = Release|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|x64.ActiveCfg = Release|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|x64.Build.0 = Release|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|x86.ActiveCfg = Release|Any CPU
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86}.Release|x86.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {6DFFF5E1-1B87-403B-99D0-A9E03D8A8EB3} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- {1C724CD5-CD24-46CD-835A-A83F673F97B5} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- {970903E9-BC53-436F-BA77-C62349546425} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- {AC8F04FF-3164-41FB-9EDF-E468B8B77837} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- {5697DD19-62CC-4377-ABA8-1E192376F4F6} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- {3D70B211-74A8-484C-9B86-B0A2835C71E7} = {F256F2A5-0DBF-4137-A7D6-21F08111BD4A}
- {1F4E301C-F03B-4A31-A6F2-6A77384A74DA} = {3D70B211-74A8-484C-9B86-B0A2835C71E7}
- {412BF533-2759-4FBE-B4C6-B89DB44FB6B5} = {3D70B211-74A8-484C-9B86-B0A2835C71E7}
- {04780892-FC30-4B6B-A10C-5795C657E574} = {F256F2A5-0DBF-4137-A7D6-21F08111BD4A}
- {5A83C636-741A-4795-8588-70F033E79B5A} = {04780892-FC30-4B6B-A10C-5795C657E574}
- {BF7450E8-B3C5-46FB-BEC1-C5FC1C5964DC} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- {08A82D74-0854-498F-9C74-E0A7242FE430} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- {3942CAF2-93CE-45BC-A734-3247D266ECE6} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- {4DB543FF-19CF-4FA8-B772-2AE7E6721F86} = {5237F8A4-67F5-4751-B8B2-B93A06791480}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {3433C5DD-DC49-4A96-A1AE-90C1A1EBA87C}
- EndGlobalSection
-EndGlobal
diff --git a/backend/README.md b/backend/README.md
deleted file mode 100644
index 2c12b9146b..0000000000
--- a/backend/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-# PIMS RESTful API - .NET CORE
-
-The PIMS API provides an RESTful interface to interact with the configured data-source.
-
-The API is configured to run in a Docker container and has the following dependencies with other containers; database.
-
-For more information refer to documentation [here](https://github.com/bcgov/PIMS/wiki/api/API.md).
-
-To run the API locally you will need to create the appropriate environment variable `.env` files. You can do this through using the prebuilt scripts [here](../../scripts/README.md).
-
-## API Environment Variables
-
-The current environment is initialized through the environment variable `ASPNETCORE_ENVIRONMENT`.
-
-When running the solution it applies the configuration setting in the following order;
-
-> NOTE: When the environment is Development it will look for your _User Secrets_ file.
-
-1. appsettings.json
-2. appsettings.`[environment]`.json
-3. User Secrets `(if environment=Development)`
-4. Environment Variables
-
-To run the solution with docker-compose create a `.env` file within the `/api` directory and populate with the following;
-
-```conf
-ConnectionStrings__PIMS={connection string} # For local debugging in VSCode
-
-ASPNETCORE_ENVIRONMENT=Development
-ASPNETCORE_URLS=http://*:8080 #http://*:8081 for debugging
-DB_PASSWORD={password}
-
-Keycloak__Secret={secret}
-Keycloak__ServiceAccount__Secret={secret}
-Keycloak__FrontendClientId={client id}
-
-Ches__Username={secret}
-Ches__Password={password}
-Ches__OverrideTo={email}
-
-Ltsa__IntegratorUsername={username}
-Ltsa__IntegratorPassword={password}
-Ltsa__UserName={username}
-Ltsa__UserPassword={password}
-```
-
-| Key | Required | Value | Description |
-| ----------------------------------- | :------: | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| ASPNETCORE_ENVIRONMENT | x | [Development\|Staging\|Production] | The environment name to run under. This will result in apply different configuration settings. |
-| ASPNETCORE_URLS | x | {http://*:8080} | The host addresses with ports and protocols that the server will listen to. |
-| DB_PASSWORD | x | {password} | The password to the database. If using MSSQL it will require a complex password. Needs to be the same value found in the `/database/mssql/.env` file. |
-| ConnectionStrings\_\_PIMS | | {connection string} | To override the `appsettings.[environment].json` configuration files you can set the connection string value here. |
-
-
-## Running Locally
-
-To run the API locally with vscode, comment out the following lines, and add the `ConnectionStrings__PIMS` value in your `.env` file;
-
-```conf
-# ASPNETCORE_ENVIRONMENT=Development
-# ASPNETCORE_URLS=http://*:8080
-ConnectionStrings__PIMS=Server=localhost,5433;Database=pims;User ID=admin;Encrypt=False
-```
-
-This is so that the `/.vscode/launch.json` configured environment variables are used instead. Specifically it will run with the following;
-
-```json
-{
- "configurations": [{
- ...
- "env": {
- "ASPNETCORE_ENVIRONMENT": "Local",
- "ASPNETCORE_URLS": "http://*:5000"
- }
- ...
- }]
-}
-```
diff --git a/backend/api/Areas/Admin/Controllers/AccessRequestController.cs b/backend/api/Areas/Admin/Controllers/AccessRequestController.cs
deleted file mode 100644
index 2bd6e94f0c..0000000000
--- a/backend/api/Areas/Admin/Controllers/AccessRequestController.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using MapsterMapper;
-using Microsoft.AspNetCore.Mvc;
-using Pims.Api.Policies;
-using Pims.Dal.Security;
-using Pims.Dal.Services.Admin;
-using Swashbuckle.AspNetCore.Annotations;
-using EModel = Pims.Dal.Entities.Models;
-using Entity = Pims.Dal.Entities;
-using IUserService = Pims.Dal.Services.IUserService;
-using Model = Pims.Api.Areas.Admin.Models.User;
-using PModel = Pims.Api.Models;
-
-namespace Pims.Api.Areas.Admin.Controllers
-{
- ///
- /// AccessRequestController class, provides endpoints for managing access requests.
- ///
- [HasPermission(Permissions.AdminUsers)]
- [ApiController]
- [Area("admin")]
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/[area]/access/requests")]
- [Route("[area]/access/requests")]
- public class AccessRequestController : Controller
- {
- #region Properties
- private readonly IPimsAdminService _pimsAdminService;
- private readonly IMapper _mapper;
- private readonly IUserService _userService;
- #endregion
-
- #region Constructors
- ///
- /// Creates a new instance of an AccessRequestController object, initializes with specified parameters.
- ///
- ///
- ///
- ///
- public AccessRequestController(IPimsAdminService pimsAdminService,
- IMapper mapper, IUserService userService)
- {
- _pimsAdminService = pimsAdminService;
- _userService = userService;
- _mapper = mapper;
- }
- #endregion
-
- #region Endpoints
-
- ///
- /// Get a list of access requests
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- [HttpGet]
- [Produces("application/json")]
- [ProducesResponseType(typeof(PModel.PageModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-access-requests" })]
- public IActionResult GetPage(int page = 1, int quantity = 10, string sort = null,
- string searchText = null, string role = null, string agency = null,
- Entity.AccessRequestStatus status = Entity.AccessRequestStatus.OnHold)
- {
- if (page < 1) page = 1;
- if (quantity < 1) quantity = 1;
- if (quantity > 20) quantity = 20;
-
- var filter = new EModel.AccessRequestFilter(page, quantity, new[] { sort }, searchText, role, agency, status);
-
- var result = _pimsAdminService.User.GetAccessRequests(filter);
- var models = _mapper.Map(result.Items);
- var paged = new PModel.PageModel(models, page, quantity, result.Total);
- return new JsonResult(paged);
- }
-
- ///
- /// Delete an access requests
- ///
- ///
- ///
- [HttpDelete("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AccessRequestModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-access-requests" })]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "To support standardized routes ({id})")]
- public IActionResult Delete(int id, [FromBody] Model.AccessRequestModel accessRequestModel)
- {
- var entity = _mapper.Map(accessRequestModel);
- _userService.DeleteAccessRequest(entity);
- return new JsonResult(accessRequestModel);
- }
- #endregion
-
- }
-}
-
diff --git a/backend/api/Areas/Admin/Controllers/AdministrativeAreaController.cs b/backend/api/Areas/Admin/Controllers/AdministrativeAreaController.cs
deleted file mode 100644
index c7326afd46..0000000000
--- a/backend/api/Areas/Admin/Controllers/AdministrativeAreaController.cs
+++ /dev/null
@@ -1,183 +0,0 @@
-using Pims.Api.Helpers.Extensions;
-using MapsterMapper;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.EntityFrameworkCore;
-using Pims.Api.Policies;
-using Pims.Dal.Security;
-using Pims.Dal.Services.Admin;
-using Swashbuckle.AspNetCore.Annotations;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.AdministrativeArea;
-using EModel = Pims.Dal.Entities.Models;
-using Pims.Dal.Keycloak;
-
-namespace Pims.Api.Areas.Admin.Controllers
-{
- ///
- /// AdministrativeArea class, provides endpoints for managing administrative areas.
- ///
- [HasPermission(Permissions.SystemAdmin)]
- [ApiController]
- [Area("admin")]
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/[area]/administrative/areas")]
- [Route("[area]/administrative/areas")]
- public class AdministrativeAreaController : ControllerBase
- {
- #region Variables
-
- private readonly IPimsAdminService _pimsAdminService;
- private readonly IMapper _mapper;
-
- #endregion
-
- #region Constructors
-
- ///
- /// Creates a new instance of a AdministrativeAreaController class.
- ///
- ///
- ///
- ///
- public AdministrativeAreaController(IPimsAdminService pimsAdminService, IPimsKeycloakService keycloakService,
- IMapper mapper)
- {
- _pimsAdminService = pimsAdminService;
- _mapper = mapper;
- }
-
- #endregion
-
- #region Endpoints
-
- ///
- /// GET - Returns a paged list of administrative areas from the datasource.
- ///
- /// Array of administrative areas.
- [HttpGet]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AdministrativeAreaModel[]), 200)]
- [SwaggerOperation(Tags = new[] { "admin-administrative-area" })]
- public IActionResult GetAdministrativeAreas()
- {
- var adminAreas = _pimsAdminService.AdministrativeArea.GetAll();
- return new JsonResult(_mapper.Map(adminAreas));
- }
-
- ///
- /// GET - Returns a paged array of administrative areas from the datasource.
- ///
- ///
- /// Paged object with an array of administrative areas.
- [HttpPost("filter")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Api.Models.PageModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-administrative-area" })]
- public IActionResult GetAdministrativeAreas(EModel.AdministrativeAreaFilter filter)
- {
- var page = _pimsAdminService.AdministrativeArea.Get(filter);
- var result = _mapper.Map>(page);
- return new JsonResult(result);
- }
-
- ///
- /// GET - Returns a administrative area for the specified 'id' from the datasource.
- ///
- /// The unique 'id' for the admin area to return.
- /// The administrative area requested.
- [HttpGet("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AdministrativeAreaModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-administrative-area" })]
- public IActionResult GetAdministrativeArea(int id)
- {
- var adminArea = _pimsAdminService.AdministrativeArea.Get(id);
- return new JsonResult(_mapper.Map(adminArea));
- }
-
- ///
- /// PUT - Update an administrative area in the datasource.
- ///
- /// The administrative area model.
- /// The administrative area updated.
- [HttpPut("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AdministrativeAreaModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-administrative-area" })]
- public IActionResult UpdateAdministrativeAreaAsync([FromBody] Model.AdministrativeAreaModel model)
- {
- var entity = _mapper.Map(model);
- try
- {
- _pimsAdminService.AdministrativeArea.Update(entity);
-
- var adminArea = _mapper.Map(entity);
- return new JsonResult(adminArea);
- }
- catch (DbUpdateException ex)
- {
- var duplicateError = ex.CheckErrorMessageForDuplicate("Error while updating Administrative Area.");
- if (duplicateError != null)
- {
- return BadRequest(duplicateError);
- }
- throw;
- }
- }
-
- ///
- /// POST - Add a new administrative area to the datasource.
- ///
- /// The administrative area model.
- /// The administrative area added.
- [HttpPost]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AdministrativeAreaModel), 201)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-administrative-area" })]
- public IActionResult AddAdministrativeArea([FromBody] Model.AdministrativeAreaModel model)
- {
- var entity = _mapper.Map(model);
- try
- {
- _pimsAdminService.AdministrativeArea.Add(entity);
-
- var administrativeArea = _mapper.Map(entity);
-
- return CreatedAtAction(nameof(GetAdministrativeArea), new { id = administrativeArea.Id },
- administrativeArea);
- }
- catch (DbUpdateException ex)
- {
- var duplicateError = ex.CheckErrorMessageForDuplicate("Error while adding Administrative Area.");
- if (duplicateError != null)
- {
- return BadRequest(duplicateError);
- }
- throw;
- }
- }
-
- ///
- /// DELETE - Delete the administrative area from the datasource.
- ///
- /// The administrative area model.
- /// The administrative area that was deleted.
- [HttpDelete("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AdministrativeAreaModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-administrative-area" })]
- public IActionResult DeleteAdministrativeAreaAsync([FromBody] Model.AdministrativeAreaModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.AdministrativeArea.Remove(entity);
-
- return new JsonResult(model);
- }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Controllers/AgencyController.cs b/backend/api/Areas/Admin/Controllers/AgencyController.cs
deleted file mode 100644
index b99b683fdb..0000000000
--- a/backend/api/Areas/Admin/Controllers/AgencyController.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-using MapsterMapper;
-using Microsoft.AspNetCore.Mvc;
-using Pims.Api.Policies;
-using Pims.Dal.Security;
-using Pims.Dal.Services.Admin;
-using Swashbuckle.AspNetCore.Annotations;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Agency;
-using EModel = Pims.Dal.Entities.Models;
-using Pims.Dal.Keycloak;
-using Pims.Core.Extensions;
-using System.Threading.Tasks;
-using System.Collections.Generic;
-
-namespace Pims.Api.Areas.Admin.Controllers
-{
- ///
- /// AgencyController class, provides endpoints for managing agencys.
- ///
- [HasPermission(Permissions.AgencyAdmin)]
- [ApiController]
- [Area("admin")]
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/[area]/agencies")]
- [Route("[area]/agencies")]
- public class AgencyController : ControllerBase
- {
- #region Variables
- private readonly IPimsAdminService _pimsAdminService;
- private readonly IPimsKeycloakService _pimsKeycloakService;
- private readonly IMapper _mapper;
- #endregion
-
- #region Constructors
- ///
- /// Creates a new instance of a AgencyController class.
- ///
- ///
- ///
- ///
- public AgencyController(IPimsAdminService pimsAdminService, IPimsKeycloakService keycloakService, IMapper mapper)
- {
- _pimsAdminService = pimsAdminService;
- _pimsKeycloakService = keycloakService;
- _mapper = mapper;
- }
- #endregion
-
- #region Endpoints
- ///
- /// GET - Returns a paged array of agencys from the datasource.
- ///
- /// Paged object with an array of agencys.
- [HttpGet]
- [Produces("application/json")]
- [ProducesResponseType(typeof(IEnumerable), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-agency" })]
- public IActionResult GetAgencies()
- {
- var agencies = _pimsAdminService.Agency.GetAll();
- return new JsonResult(_mapper.Map(agencies));
- }
-
- ///
- /// GET - Returns a agency for the specified 'id' from the datasource.
- ///
- /// The unique 'id' for the agency to return.
- /// The agency requested.
- [HttpGet("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AgencyModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-agency" })]
- public IActionResult GetAgency(int id)
- {
- var agency = _pimsAdminService.Agency.Get(id);
- return new JsonResult(_mapper.Map(agency));
- }
-
- ///
- /// GET - Returns a paged array of agencies from the datasource.
- ///
- ///
- /// Paged object with an array of agencies.
- [HttpPost("filter")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Api.Models.PageModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-agency" })]
- public IActionResult GetAgencies(EModel.AgencyFilter filter)
- {
- var page = _pimsAdminService.Agency.Get(filter);
- var result = _mapper.Map>(page);
- return new JsonResult(result);
- }
-
- ///
- /// POST - Add a new agency to the datasource.
- ///
- /// The agency model.
- /// The agency added.
- [HttpPost]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AgencyModel), 201)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-agency" })]
- public async Task AddAgencyAsync([FromBody] Model.AgencyModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.Agency.Add(entity);
-
- // TODO: This isn't ideal as the db update may be successful but this request may not.
- await entity.Users.ForEachAsync(async u =>
- {
- var user = _pimsAdminService.User.Get(u.UserId);
- await _pimsKeycloakService.UpdateUserAsync(user);
- });
-
- var agency = _mapper.Map(entity);
-
- return CreatedAtAction(nameof(GetAgency), new { id = agency.Id }, agency);
- }
-
- ///
- /// PUT - Update the agency in the datasource.
- ///
- /// The agency model.
- /// The agency updated.
- [HttpPut("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AgencyModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-agency" })]
- public async Task UpdateAgencyAsync([FromBody] Model.AgencyModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.Agency.Update(entity);
-
- // TODO: This isn't ideal as the db update may be successful but this request may not.
- await entity.Users.ForEachAsync(async u =>
- {
- var user = _pimsAdminService.User.Get(u.UserId);
- await _pimsKeycloakService.UpdateUserAsync(user);
- });
-
- var agency = _mapper.Map(entity);
- return new JsonResult(agency);
- }
-
- ///
- /// DELETE - Delete the agency from the datasource.
- ///
- /// The agency model.
- /// The agency who was deleted.
- [HttpDelete("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AgencyModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-agency" })]
- public async Task DeleteAgencyAsync([FromBody] Model.AgencyModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.Agency.Remove(entity);
-
- // TODO: This isn't ideal as the db update may be successful but this request may not.
- await entity.Users.ForEachAsync(async u =>
- {
- var user = _pimsAdminService.User.Get(u.UserId);
- await _pimsKeycloakService.UpdateUserAsync(user);
- });
-
- return new JsonResult(model);
- }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Controllers/ClaimController.cs b/backend/api/Areas/Admin/Controllers/ClaimController.cs
deleted file mode 100644
index 6d3e8d6293..0000000000
--- a/backend/api/Areas/Admin/Controllers/ClaimController.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-using MapsterMapper;
-using Microsoft.AspNetCore.Mvc;
-using Pims.Api.Policies;
-using Pims.Dal.Entities;
-using Pims.Dal.Security;
-using Pims.Dal.Services.Admin;
-using Swashbuckle.AspNetCore.Annotations;
-using System;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Claim;
-
-namespace Pims.Api.Areas.Admin.Controllers
-{
- ///
- /// ClaimController class, provides endpoints for managing claims.
- ///
- [HasPermission(Permissions.SystemAdmin)]
- [ApiController]
- [Area("admin")]
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/[area]/claims")]
- [Route("[area]/claims")]
- public class ClaimController : ControllerBase
- {
- #region Variables
- private readonly IPimsAdminService _pimsAdminService;
- private readonly IMapper _mapper;
- #endregion
-
- #region Constructors
- ///
- /// Creates a new instance of a ClaimController class, initializes it with the specified arguments.
- ///
- ///
- ///
- public ClaimController(IPimsAdminService pimsAdminService, IMapper mapper)
- {
- _pimsAdminService = pimsAdminService;
- _mapper = mapper;
- }
- #endregion
-
- #region Endpoints
- ///
- /// GET - Returns a paged array of claims from the datasource.
- ///
- ///
- ///
- ///
- /// Paged object with an array of claims.
- [HttpGet]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Api.Models.PageModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-claim" })]
- public IActionResult GetClaims(int page = 1, int quantity = 10, string name = null)
- {
- if (page < 1) page = 1;
- if (quantity < 1) quantity = 1;
- if (quantity > 50) quantity = 50;
-
- var paged = _pimsAdminService.Claim.Get(page, quantity, name);
- var result = _mapper.Map>(paged);
- return new JsonResult(result);
- }
-
- ///
- /// GET - Returns a claim for the specified 'id' from the datasource.
- ///
- /// The unique 'id' for the claim to return.
- /// The claim requested.
- [HttpGet("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.ClaimModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-claim" })]
- public IActionResult GetClaim(Guid id)
- {
- var entity = _pimsAdminService.Claim.Get(id);
- var claim = _mapper.Map(entity);
- return new JsonResult(claim);
- }
-
- ///
- /// POST - Add a new claim to the datasource.
- ///
- /// The claim model.
- /// The claim added.
- [HttpPost]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.ClaimModel), 201)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-claim" })]
- public IActionResult AddClaim([FromBody] Model.ClaimModel model)
- {
- var entity = _mapper.Map(model); // TODO: Return bad request.
- _pimsAdminService.Claim.Add(entity);
- var claim = _mapper.Map(entity);
-
- return CreatedAtAction(nameof(GetClaim), new { id = claim.Id }, claim);
- }
-
- ///
- /// PUT - Update the claim in the datasource.
- ///
- ///
- /// The claim model.
- /// The claim updated.
- [HttpPut("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.ClaimModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-claim" })]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")]
- public IActionResult UpdateClaim(Guid id, [FromBody] Model.ClaimModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.Claim.Update(entity);
-
- var claim = _mapper.Map(entity);
- return new JsonResult(claim);
- }
-
- ///
- /// DELETE - Delete the claim from the datasource.
- ///
- ///
- /// The claim model.
- /// The claim who was deleted.
- [HttpDelete("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.ClaimModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-claim" })]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")]
- public IActionResult DeleteClaim(Guid id, [FromBody] Model.ClaimModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.Claim.Remove(entity);
-
- return new JsonResult(model);
- }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Controllers/RoleController.cs b/backend/api/Areas/Admin/Controllers/RoleController.cs
deleted file mode 100644
index 2385e1eeef..0000000000
--- a/backend/api/Areas/Admin/Controllers/RoleController.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-using MapsterMapper;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Logging;
-using Pims.Api.Policies;
-using Pims.Dal.Entities;
-using Pims.Dal.Security;
-using Pims.Dal.Services.Admin;
-using Swashbuckle.AspNetCore.Annotations;
-using System;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Role;
-
-namespace Pims.Api.Areas.Admin.Controllers
-{
- ///
- /// RoleController class, provides endpoints for managing roles.
- ///
- [HasPermission(Permissions.AdminRoles)]
- [ApiController]
- [Area("admin")]
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/[area]/roles")]
- [Route("[area]/roles")]
- public class RoleController : ControllerBase
- {
- #region Variables
- private readonly ILogger _logger;
- private readonly IPimsAdminService _pimsAdminService;
- private readonly IMapper _mapper;
- #endregion
-
- #region Constructors
- ///
- /// Creates a new instance of a RoleController class, initializes it with the specified arguments.
- ///
- ///
- ///
- ///
- public RoleController(ILogger logger, IPimsAdminService pimsAdminService, IMapper mapper)
- {
- _logger = logger;
- _pimsAdminService = pimsAdminService;
- _mapper = mapper;
- }
- #endregion
-
- #region Endpoints
- ///
- /// GET - Returns a paged array of roles from the datasource.
- ///
- ///
- ///
- ///
- /// Paged object with an array of roles.
- [HttpGet]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Api.Models.PageModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-role" })]
- public IActionResult GetRoles(int page = 1, int quantity = 10, string name = null)
- {
- if (page < 1) page = 1;
- if (quantity < 1) quantity = 1;
- if (quantity > 50) quantity = 50;
-
- var paged = _pimsAdminService.Role.Get(page, quantity, name);
- var result = _mapper.Map>(paged);
- return new JsonResult(result);
- }
-
- ///
- /// GET - Returns a role for the specified 'id' from the datasource.
- ///
- /// The unique 'id' for the role to return.
- /// The role requested.
- [HttpGet("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.RoleModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-role" })]
- public IActionResult GetRole(Guid id)
- {
- var entity = _pimsAdminService.Role.Get(id);
- var role = _mapper.Map(entity);
- return new JsonResult(role);
- }
-
- ///
- /// GET - Returns a role for the specified 'name' from the datasource.
- ///
- /// The unique 'name' for the role to return.
- /// The role requested.
- [HttpGet("name/{name}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.RoleModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-role" })]
- public IActionResult GetRoleByName(string name)
- {
- var entity = _pimsAdminService.Role.GetByName(name);
- var role = _mapper.Map(entity);
- return new JsonResult(role);
- }
-
- ///
- /// POST - Add a new role to the datasource.
- ///
- /// The role model.
- /// The role added.
- [HttpPost]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.RoleModel), 201)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-role" })]
- public IActionResult AddRole([FromBody] Model.RoleModel model)
- {
- var entity = _mapper.Map(model); // TODO: Return bad request.
- _pimsAdminService.Role.Add(entity);
- var role = _mapper.Map(entity);
-
- return CreatedAtAction(nameof(GetRole), new { id = role.Id }, role);
- }
-
- ///
- /// PUT - Update the role in the datasource.
- ///
- ///
- /// The role model.
- /// The role updated.
- [HttpPut("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.RoleModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-role" })]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")]
- public IActionResult UpdateRole(Guid id, [FromBody] Model.RoleModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.Role.Update(entity);
-
- var role = _mapper.Map(entity);
- return new JsonResult(role);
- }
-
- ///
- /// DELETE - Delete the role from the datasource.
- ///
- ///
- /// The role model.
- /// The role who was deleted.
- [HttpDelete("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.RoleModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-role" })]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")]
- public IActionResult DeleteRole(Guid id, [FromBody] Model.RoleModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.Role.Remove(entity);
-
- return new JsonResult(model);
- }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Controllers/UserController.cs b/backend/api/Areas/Admin/Controllers/UserController.cs
deleted file mode 100644
index 292e02c1ea..0000000000
--- a/backend/api/Areas/Admin/Controllers/UserController.cs
+++ /dev/null
@@ -1,263 +0,0 @@
-using MapsterMapper;
-using Microsoft.AspNetCore.Http.Extensions;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Logging;
-using Pims.Api.Policies;
-using Pims.Dal.Security;
-using Pims.Dal.Services.Admin;
-using Swashbuckle.AspNetCore.Annotations;
-using System;
-using EModel = Pims.Dal.Entities.Models;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.User;
-using GoldModel = Pims.Api.Areas.Admin.Models.GoldUser;
-using System.Linq;
-
-namespace Pims.Api.Areas.Admin.Controllers
-{
- ///
- /// UserController class, provides endpoints for managing users.
- ///
- [HasPermission(Permissions.AdminUsers)]
- [ApiController]
- [Area("admin")]
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/[area]/users")]
- [Route("[area]/users")]
- public class UserController : ControllerBase
- {
- #region Variables
- private readonly ILogger _logger;
- private readonly IPimsAdminService _pimsAdminService;
- private readonly IMapper _mapper;
- private readonly object res;
- #endregion
-
- #region Constructors
- ///
- /// Creates a new instance of a UserController class.
- ///
- ///
- ///
- ///
- public UserController(ILogger logger, IPimsAdminService pimsAdminService, IMapper mapper)
- {
- _logger = logger;
- _pimsAdminService = pimsAdminService;
- _mapper = mapper;
- }
- #endregion
-
- #region Endpoints
- ///
- /// GET - Returns a paged array of users from the datasource.
- ///
- /// Paged object with an array of users.
- [HttpGet]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Api.Models.PageModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult GetUsers()
- {
- var uri = new Uri(this.Request.GetDisplayUrl());
- var query = Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query);
- return GetUsers(new EModel.UserFilter(query));
- }
-
- ///
- /// POST - Returns a paged array of users from the datasource.
- ///
- ///
- /// Paged object with an array of users.
- [HttpPost("filter")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Api.Models.PageModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult GetUsers(EModel.UserFilter filter)
- {
- var page = _pimsAdminService.User.Get(filter);
- var result = _mapper.Map>(page);
- return new JsonResult(result);
- }
-
- ///
- /// POST /api/admin/users/my/agency - Returns a paged array of users from the datasource that belong to the same agency (or sub-agency) as the current user.
- ///
- ///
- /// Paged object with an array of users.
- [HttpPost("my/agency")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Api.Models.PageModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult GetMyUsers(EModel.UserFilter filter)
- {
- return GetUsers(filter);
- }
-
- ///
- /// GET /api/admin/users/${id} - Returns a user for the specified 'id' from the datasource.
- ///
- /// The unique 'id' for the user to return.
- /// The user requested.
- [HttpGet("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult GetUser(Guid id)
- {
- var entity = _pimsAdminService.User.Get(id);
- var user = _mapper.Map(entity);
- return new JsonResult(user);
- }
-
- ///
- /// POST - Add a new user to the datasource.
- ///
- /// The user model.
- /// The user added.
- [HttpPost]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 201)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult AddUser([FromBody] Model.UserModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.User.Add(entity);
-
- var user = _mapper.Map(entity);
-
- return CreatedAtAction(nameof(GetUser), new { id = user.Id }, user);
- }
-
- ///
- /// PUT /api/admin/user/{id} - Update the user in the datasource.
- ///
- ///
- /// The user model.
- /// The user updated.
- [HttpPut("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")]
- public IActionResult UpdateUser(Guid id, [FromBody] Model.UserModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.User.Update(entity);
- var user = _mapper.Map(entity);
- return new JsonResult(user);
- }
- public class AddRolesToUserRequest
- {
- public string[] Roles { get; set; }
- }
- public class RemoveRolesToUserRequest
- {
- public string[] Roles { get; set; }
- }
-
- ///
- /// POST - Get all roles from the Keycloak Gold API.
- ///
- /// JSON Array of the user roles.
- [HttpGet("getroles")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult GetRoles()
- {
- var res = _pimsAdminService.User.GetRolesAsync().Result;
- return new JsonResult(res);
-
- }
-
- ///
- /// DELETE - Remove a role from the user by calling the Keycloak Gold API.
- ///
- /// The user's username
- ///
- /// JSON Array of the users roles, updated with the one just added.
- [HttpDelete("roles/{username}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult DeleteRoleFromUser(string username, [FromBody] RemoveRolesToUserRequest request)
- {
- var user = _pimsAdminService.User.Get(username);
- var preferred_username = _pimsAdminService.User.GetUsersPreferredUsername(user.KeycloakUserId ?? Guid.Empty, user.Username.Split("@").Last()).Result;
- foreach (var role in request.Roles)
- {
- var res = _pimsAdminService.User.DeleteRoleFromUser(preferred_username, role).Result;
- }
- return new JsonResult(res);
- }
-
-
- ///
- /// POST - Add a role to the user by calling the Keycloak Gold API.
- ///
- /// The user's username
- ///
- /// JSON Array of the users roles, updated with the one just added.
- [HttpPost("roles/{username}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult AddRoleToUser(string username, [FromBody] AddRolesToUserRequest request)
- {
- var user = _pimsAdminService.User.Get(username);
- var preferred_username = _pimsAdminService.User.GetUsersPreferredUsername(user.KeycloakUserId ?? Guid.Empty, user.Username.Split("@").Last()).Result;
- foreach (var role in request.Roles)
- {
- var res = _pimsAdminService.User.AddRoleToUser(preferred_username, role).Result;
- }
- return new JsonResult(res);
- }
-
- ///
- /// POST - Get roles for a specific user from the Keycloak Gold API.
- ///
- /// JSON Array of the user's roles.
- [HttpGet("roles/{username}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- public IActionResult UserRoles(string username)
- {
- var res = _pimsAdminService.User.GetGoldUsersRolesAsync(username).Result;
- return new JsonResult(res);
-
- }
-
- ///
- /// DELETE - Delete the user from the datasource.
- ///
- ///
- /// The user model.
- /// The user who was deleted.
- [HttpDelete("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "admin-user" })]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")]
- public IActionResult DeleteUser(Guid id, [FromBody] Model.UserModel model)
- {
- var entity = _mapper.Map(model);
- _pimsAdminService.User.Remove(entity);
-
- return new JsonResult(model);
- }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/AdministrativeArea/AdministrativeAreaMap.cs b/backend/api/Areas/Admin/Mapping/AdministrativeArea/AdministrativeAreaMap.cs
deleted file mode 100644
index d42eac2550..0000000000
--- a/backend/api/Areas/Admin/Mapping/AdministrativeArea/AdministrativeAreaMap.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.AdministrativeArea;
-
-namespace Pims.Api.Areas.Admin.Mapping.AdministrativeArea
-{
- public class AdministrativeAreaMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.GroupName, src => src.GroupName)
- .Map(dest => dest.BoundaryType, src => src.BoundaryType)
- .Map(dest => dest.Abbreviation, src => src.Abbreviation)
- .Inherits, Api.Models.LookupModel>();
-
- config.NewConfig()
- .Map(dest => dest.GroupName, src => src.GroupName)
- .Map(dest => dest.BoundaryType, src => src.BoundaryType)
- .Map(dest => dest.Abbreviation, src => src.Abbreviation)
- .Inherits, Entity.LookupEntity>();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Agency/AgencyMap.cs b/backend/api/Areas/Admin/Mapping/Agency/AgencyMap.cs
deleted file mode 100644
index 5119f552b6..0000000000
--- a/backend/api/Areas/Admin/Mapping/Agency/AgencyMap.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Agency;
-
-namespace Pims.Api.Areas.Admin.Mapping.Agency
-{
- public class AgencyMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.Email, src => src.Email)
- .Map(dest => dest.CcEmail, src => src.CCEmail)
- .Map(dest => dest.SendEmail, src => src.SendEmail)
- .Map(dest => dest.ParentId, src => src.ParentId)
- .Map(dest => dest.AddressTo, src => src.AddressTo)
- .Inherits, Api.Models.CodeModel>();
-
- config.NewConfig()
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.Email, src => src.Email)
- .Map(dest => dest.CCEmail, src => src.CcEmail)
- .Map(dest => dest.SendEmail, src => src.SendEmail)
- .Map(dest => dest.ParentId, src => src.ParentId)
- .Map(dest => dest.AddressTo, src => src.AddressTo)
- .Inherits, Entity.CodeEntity>();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Claim/ClaimMap.cs b/backend/api/Areas/Admin/Mapping/Claim/ClaimMap.cs
deleted file mode 100644
index e212c5c4d2..0000000000
--- a/backend/api/Areas/Admin/Mapping/Claim/ClaimMap.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Claim;
-
-namespace Pims.Api.Areas.Admin.Mapping.Claim
-{
- public class ClaimMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.KeycloakRoleId, src => src.KeycloakRoleId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.KeycloakRoleId, src => src.KeycloakRoleId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/AddressMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/AddressMap.cs
deleted file mode 100644
index 539c1a61a6..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/AddressMap.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using Mapster;
-using Pims.Core.Extensions;
-using System;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class AddressMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Line1, src => src.Address1)
- .Map(dest => dest.Line2, src => src.Address2)
- .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea)
- .Map(dest => dest.ProvinceId, src => src.ProvinceId)
- .Map(dest => dest.Province, src => src.Province == null ? null : src.Province.Name)
- .Map(dest => dest.Postal, src => src.Postal.FormatAsPostal())
- .Inherits();
-
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Address1, src => src.Line1)
- .Map(dest => dest.Address2, src => src.Line2)
- .Map(dest => dest.AdministrativeArea, src => src.AdministrativeArea)
- .Map(dest => dest.ProvinceId, src => src.ProvinceId)
- .Map(dest => dest.Province, src => String.IsNullOrWhiteSpace(src.Province) ? null : new Entity.Province(src.ProvinceId, src.Province))
- .Map(dest => dest.Postal, src => src.Postal.Replace(" ", ""))
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/BuildingEvaluationMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/BuildingEvaluationMap.cs
deleted file mode 100644
index d8c9f002a7..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/BuildingEvaluationMap.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class BuildingEvaluationMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .EnumMappingStrategy(EnumMappingStrategy.ByName)
- .Map(dest => dest.BuildingId, src => src.BuildingId)
- .Map(dest => dest.Date, src => src.Date)
- .Map(dest => dest.Key, src => src.Key)
- .Map(dest => dest.Value, src => src.Value)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
-
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .EnumMappingStrategy(EnumMappingStrategy.ByName)
- .Map(dest => dest.BuildingId, src => src.BuildingId)
- .Map(dest => dest.Date, src => src.Date)
- .Map(dest => dest.Key, src => src.Key)
- .Map(dest => dest.Value, src => src.Value)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/BuildingFiscalMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/BuildingFiscalMap.cs
deleted file mode 100644
index d9d8d71de2..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/BuildingFiscalMap.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class BuildingFiscalMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .EnumMappingStrategy(EnumMappingStrategy.ByName)
- .Map(dest => dest.BuildingId, src => src.BuildingId)
- .Map(dest => dest.FiscalYear, src => src.FiscalYear)
- .Map(dest => dest.Key, src => src.Key)
- .Map(dest => dest.Value, src => src.Value)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
-
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .EnumMappingStrategy(EnumMappingStrategy.ByName)
- .Map(dest => dest.BuildingId, src => src.BuildingId)
- .Map(dest => dest.FiscalYear, src => src.FiscalYear)
- .Map(dest => dest.Key, src => src.Key)
- .Map(dest => dest.Value, src => src.Value)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/BuildingMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/BuildingMap.cs
deleted file mode 100644
index 74e3d509c7..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/BuildingMap.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using Mapster;
-using Pims.Api.Mapping.Converters;
-using Pims.Dal.Helpers.Extensions;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class BuildingMap : IRegister
- {
-
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.AgencyId, src => src.AgencyId)
- .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency))
- .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency))
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.ParcelId, src => src.GetParcelId())
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.Latitude, src => src.Location.Y)
- .Map(dest => dest.Longitude, src => src.Location.X)
- .Map(dest => dest.Address, src => src.Address)
- .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId)
- .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType())
- .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId)
- .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType())
- .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId)
- .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse())
- .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy)
- .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount)
- .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry)
- .Map(dest => dest.OccupantName, src => src.OccupantName)
- .Map(dest => dest.RentableArea, src => src.RentableArea)
- .Map(dest => dest.TotalArea, src => src.TotalArea)
- .Map(dest => dest.IsSensitive, src => src.IsSensitive)
- .Map(dest => dest.Evaluations, src => src.Evaluations)
- .Map(dest => dest.Fiscals, src => src.Fiscals)
- .Inherits();
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.AgencyId, src => src.AgencyId)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.Location, src => src)
- .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id)
- .Map(dest => dest.Address, src => src.Address)
- .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId)
- .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId)
- .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId)
- .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy)
- .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount)
- .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry)
- .Map(dest => dest.OccupantName, src => src.OccupantName)
- .Map(dest => dest.RentableArea, src => src.RentableArea)
- .Map(dest => dest.TotalArea, src => src.TotalArea)
- .Map(dest => dest.IsSensitive, src => src.IsSensitive)
- .Map(dest => dest.Evaluations, src => src.Evaluations)
- .Map(dest => dest.Fiscals, src => src.Fiscals)
- .Inherits();
-
- config.NewConfig()
- .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude));
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/ParcelBuildingMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/ParcelBuildingMap.cs
deleted file mode 100644
index d628d95818..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/ParcelBuildingMap.cs
+++ /dev/null
@@ -1,68 +0,0 @@
-using Mapster;
-using Pims.Api.Mapping.Converters;
-using Pims.Dal.Helpers.Extensions;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class ParcelBuildingMap : IRegister
- {
-
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.AgencyId, src => src.AgencyId)
- .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency))
- .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency))
- .Map(dest => dest.Latitude, src => src.Location.Y)
- .Map(dest => dest.Longitude, src => src.Location.X)
- .Map(dest => dest.Address, src => src.Address)
- .Map(dest => dest.ParcelId, src => src.GetParcelId())
- .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId)
- .Map(dest => dest.BuildingConstructionType, src => src.GetConstructionType())
- .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId)
- .Map(dest => dest.BuildingOccupantType, src => src.GetOccupantType())
- .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId)
- .Map(dest => dest.BuildingPredominateUse, src => src.GetPredominateUse())
- .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy)
- .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount)
- .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry)
- .Map(dest => dest.OccupantName, src => src.OccupantName)
- .Map(dest => dest.RentableArea, src => src.RentableArea)
- .Map(dest => dest.IsSensitive, src => src.IsSensitive)
- .Map(dest => dest.Evaluations, src => src.Evaluations)
- .Map(dest => dest.Fiscals, src => src.Fiscals)
- .Inherits();
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.AgencyId, src => src.AgencyId)
- .Map(dest => dest.Location, src => src)
- .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id)
- .Map(dest => dest.Address, src => src.Address)
- .Map(dest => dest.BuildingConstructionTypeId, src => src.BuildingConstructionTypeId)
- .Map(dest => dest.BuildingOccupantTypeId, src => src.BuildingOccupantTypeId)
- .Map(dest => dest.BuildingPredominateUseId, src => src.BuildingPredominateUseId)
- .Map(dest => dest.BuildingTenancy, src => src.BuildingTenancy)
- .Map(dest => dest.BuildingFloorCount, src => src.BuildingFloorCount)
- .Map(dest => dest.LeaseExpiry, src => src.LeaseExpiry)
- .Map(dest => dest.OccupantName, src => src.OccupantName)
- .Map(dest => dest.RentableArea, src => src.RentableArea)
- .Map(dest => dest.IsSensitive, src => src.IsSensitive)
- .Map(dest => dest.Evaluations, src => src.Evaluations)
- .Map(dest => dest.Fiscals, src => src.Fiscals)
- .Inherits();
-
- config.NewConfig()
- .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude));
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/ParcelEvaluationMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/ParcelEvaluationMap.cs
deleted file mode 100644
index 439570584d..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/ParcelEvaluationMap.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class ParcelEvaluationMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.ParcelId, src => src.ParcelId)
- .Map(dest => dest.Date, src => src.Date)
- .Map(dest => dest.Key, src => src.Key)
- .Map(dest => dest.Value, src => src.Value)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
-
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.ParcelId, src => src.ParcelId)
- .Map(dest => dest.Date, src => src.Date)
- .Map(dest => dest.Key, src => src.Key)
- .Map(dest => dest.Value, src => src.Value)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/ParcelFiscalMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/ParcelFiscalMap.cs
deleted file mode 100644
index 98c335911f..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/ParcelFiscalMap.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class ParcelFiscalMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.ParcelId, src => src.ParcelId)
- .Map(dest => dest.FiscalYear, src => src.FiscalYear)
- .Map(dest => dest.Key, src => src.Key)
- .Map(dest => dest.Value, src => src.Value)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
-
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.ParcelId, src => src.ParcelId)
- .Map(dest => dest.FiscalYear, src => src.FiscalYear)
- .Map(dest => dest.Key, src => src.Key)
- .Map(dest => dest.Value, src => src.Value)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/ParcelMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/ParcelMap.cs
deleted file mode 100644
index cf32c89d64..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/ParcelMap.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using Mapster;
-using Pims.Api.Mapping.Converters;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class ParcelMap : IRegister
- {
-
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.PID, src => src.ParcelIdentity)
- .Map(dest => dest.PIN, src => src.PIN)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.ClassificationId, src => src.ClassificationId)
- .Map(dest => dest.Classification, src => src.Classification.Name)
- .Map(dest => dest.AgencyId, src => src.AgencyId)
- .Map(dest => dest.Agency, src => AgencyConverter.ConvertAgency(src.Agency))
- .Map(dest => dest.SubAgency, src => AgencyConverter.ConvertSubAgency(src.Agency))
- .Map(dest => dest.Longitude, src => src.Location.X)
- .Map(dest => dest.Latitude, src => src.Location.Y)
- .Map(dest => dest.Address, src => src.Address)
- .Map(dest => dest.LandArea, src => src.LandArea)
- .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription)
- .Map(dest => dest.Zoning, src => src.Zoning)
- .Map(dest => dest.ZoningPotential, src => src.ZoningPotential)
- .Map(dest => dest.IsSensitive, src => src.IsSensitive)
- .Map(dest => dest.Buildings, src => src.Buildings)
- .Map(dest => dest.Evaluations, src => src.Evaluations)
- .Map(dest => dest.Fiscals, src => src.Fiscals)
- .Inherits();
-
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.PID, src => ParcelConverter.ConvertPID(src.PID))
- .Map(dest => dest.PIN, src => src.PIN)
- .Map(dest => dest.ClassificationId, src => src.ClassificationId)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.AgencyId, src => src.AgencyId)
- .Map(dest => dest.Location, src => src)
- .Map(dest => dest.AddressId, src => src.Address == null ? 0 : src.Address.Id)
- .Map(dest => dest.Address, src => src.Address)
- .Map(dest => dest.LandArea, src => src.LandArea)
- .Map(dest => dest.LandLegalDescription, src => src.LandLegalDescription)
- .Map(dest => dest.Zoning, src => src.Zoning)
- .Map(dest => dest.ZoningPotential, src => src.ZoningPotential)
- .Map(dest => dest.IsSensitive, src => src.IsSensitive)
- .Map(dest => dest.Buildings, src => src.Buildings)
- .Map(dest => dest.Evaluations, src => src.Evaluations)
- .Map(dest => dest.Fiscals, src => src.Fiscals)
- .Inherits();
-
- config.NewConfig()
- .ConstructUsing(src => Dal.Helpers.GeometryHelper.CreatePoint(src.Longitude, src.Latitude));
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/PartialBuildingMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/PartialBuildingMap.cs
deleted file mode 100644
index abe36bc341..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/PartialBuildingMap.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class PartialBuildingMap : IRegister
- {
-
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.Latitude, src => src.Location.Y)
- .Map(dest => dest.Longitude, src => src.Location.X)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Parcel/PartialParcelMap.cs b/backend/api/Areas/Admin/Mapping/Parcel/PartialParcelMap.cs
deleted file mode 100644
index c77c68013d..0000000000
--- a/backend/api/Areas/Admin/Mapping/Parcel/PartialParcelMap.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Parcel;
-
-namespace Pims.Api.Areas.Admin.Mapping.Parcel
-{
- public class PartialParcelMap : IRegister
- {
-
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.PID, src => src.ParcelIdentity)
- .Map(dest => dest.PIN, src => src.PIN)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.ClassificationId, src => src.ClassificationId)
- .Map(dest => dest.Latitude, src => src.Location.Y)
- .Map(dest => dest.Longitude, src => src.Location.X)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Role/ClaimMap.cs b/backend/api/Areas/Admin/Mapping/Role/ClaimMap.cs
deleted file mode 100644
index 54da4847df..0000000000
--- a/backend/api/Areas/Admin/Mapping/Role/ClaimMap.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Role;
-
-namespace Pims.Api.Areas.Admin.Mapping.Role
-{
- public class ClaimMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.KeycloakRoleId, src => src.KeycloakRoleId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.KeycloakRoleId, src => src.KeycloakRoleId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Inherits();
-
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Claim.Id)
- .Map(dest => dest.Name, src => src.Claim.Name)
- .Map(dest => dest.Description, src => src.Claim.Description)
- .Map(dest => dest.KeycloakRoleId, src => src.Claim.KeycloakRoleId)
- .Map(dest => dest.IsDisabled, src => src.Claim.IsDisabled);
-
- config.NewConfig()
- .Map(dest => dest.RoleId, src => src.Id);
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/Role/RoleMap.cs b/backend/api/Areas/Admin/Mapping/Role/RoleMap.cs
deleted file mode 100644
index 65222113e1..0000000000
--- a/backend/api/Areas/Admin/Mapping/Role/RoleMap.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Mapster;
-using System;
-using System.Linq;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.Role;
-
-namespace Pims.Api.Areas.Admin.Mapping.Role
-{
- public class RoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId)
- .Map(dest => dest.Claims, src => src.Claims.Select(c => c.Claim))
- .Inherits, Api.Models.LookupModel>();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId)
- .Map(dest => dest.Claims, src => src.Claims)
- .Inherits, Entity.LookupEntity>();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/User/AccessRequestAgencyMap.cs b/backend/api/Areas/Admin/Mapping/User/AccessRequestAgencyMap.cs
deleted file mode 100644
index 0b7cb62a2a..0000000000
--- a/backend/api/Areas/Admin/Mapping/User/AccessRequestAgencyMap.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.User;
-
-namespace Pims.Api.Areas.Admin.Mapping.User
-{
- public class AccessRequestAgencyMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.AgencyId)
- .Map(dest => dest.Code, src => src.Agency.Code)
- .Map(dest => dest.Description, src => src.Agency.Description)
- .Map(dest => dest.Name, src => src.Agency.Name)
- .Map(dest => dest.IsDisabled, src => src.Agency.IsDisabled)
- .Map(dest => dest.SortOrder, src => src.Agency.SortOrder)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.AgencyId, src => src.Id)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/User/AccessRequestMap.cs b/backend/api/Areas/Admin/Mapping/User/AccessRequestMap.cs
deleted file mode 100644
index a67c20ece4..0000000000
--- a/backend/api/Areas/Admin/Mapping/User/AccessRequestMap.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.User;
-
-namespace Pims.Api.Areas.Admin.Mapping.User
-{
- public class AccessRequestMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Status, src => src.Status)
- .Map(dest => dest.Agencies, src => src.Agencies)
- .Map(dest => dest.Roles, src => src.Roles)
- .Map(dest => dest.User, src => src.User)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Status, src => src.Status)
- .Map(dest => dest.Agencies, src => src.Agencies)
- .Map(dest => dest.Roles, src => src.Roles)
- .Map(dest => dest.User, src => src.User)
- .Map(dest => dest.Note, src => src.Note)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/User/AccessRequestRoleMap.cs b/backend/api/Areas/Admin/Mapping/User/AccessRequestRoleMap.cs
deleted file mode 100644
index 4a60f69cbd..0000000000
--- a/backend/api/Areas/Admin/Mapping/User/AccessRequestRoleMap.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.User;
-
-namespace Pims.Api.Areas.Admin.Mapping.User
-{
- public class AccessRequestRoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.RoleId)
- .Map(dest => dest.Description, src => src.Role.Description)
- .Map(dest => dest.Name, src => src.Role.Name)
- .Map(dest => dest.IsDisabled, src => src.Role.IsDisabled)
- .Map(dest => dest.SortOrder, src => src.Role.SortOrder)
- .Inherits();
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.RoleId, src => src.Id)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/User/AccessRequestUserMap.cs b/backend/api/Areas/Admin/Mapping/User/AccessRequestUserMap.cs
deleted file mode 100644
index 4f4521f18d..0000000000
--- a/backend/api/Areas/Admin/Mapping/User/AccessRequestUserMap.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.User;
-
-namespace Pims.Api.Areas.Admin.Mapping.User
-{
- public class AccessRequestUserMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.DisplayName, src => src.DisplayName)
- .Map(dest => dest.FirstName, src => src.FirstName)
- .Map(dest => dest.MiddleName, src => src.MiddleName)
- .Map(dest => dest.LastName, src => src.LastName)
- .Map(dest => dest.Email, src => src.Email)
- .Map(dest => dest.Username, src => src.Username)
- .Map(dest => dest.Position, src => src.Position)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.DisplayName, src => src.DisplayName)
- .Map(dest => dest.FirstName, src => src.FirstName)
- .Map(dest => dest.MiddleName, src => src.MiddleName)
- .Map(dest => dest.LastName, src => src.LastName)
- .Map(dest => dest.Email, src => src.Email)
- .Map(dest => dest.Username, src => src.Username)
- .Map(dest => dest.Position, src => src.Position)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/User/AgencyMap.cs b/backend/api/Areas/Admin/Mapping/User/AgencyMap.cs
deleted file mode 100644
index fcd5f92f04..0000000000
--- a/backend/api/Areas/Admin/Mapping/User/AgencyMap.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.User;
-
-namespace Pims.Api.Areas.Admin.Mapping.User
-{
- public class AgencyMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.ParentId, src => src.ParentId)
- .Inherits, Api.Models.CodeModel>();
-
- config.NewConfig()
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.ParentId, src => src.ParentId)
- .Inherits, Entity.CodeEntity>();
-
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.AgencyId);
-
- config.NewConfig()
- .Map(dest => dest.AgencyId, src => src.Id);
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/User/GoldUserMap.cs b/backend/api/Areas/Admin/Mapping/User/GoldUserMap.cs
deleted file mode 100644
index 949022d222..0000000000
--- a/backend/api/Areas/Admin/Mapping/User/GoldUserMap.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using Mapster;
-using Pims.Core.Extensions;
-using System.Linq;
-
-namespace Pims.Api.Areas.Admin.Mapping.GoldUser
-{
- public class GoldUserMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Map(dest => dest.Username, src => src.Username)
- .Map(dest => dest.Position, src => src.Position)
- .Map(dest => dest.DisplayName, src => src.DisplayName)
- .Map(dest => dest.FirstName, src => src.FirstName)
- .Map(dest => dest.MiddleName, src => src.MiddleName)
- .Map(dest => dest.LastName, src => src.LastName)
- .Map(dest => dest.Email, src => src.Email)
- .Map(dest => dest.Note, src => src.Note)
- .Map(dest => dest.Agencies, src => src.Agencies.Select(a => a.Agency))
- .Map(dest => dest.Roles, src => src.Roles)
- .Map(dest => dest.GoldUserRoles, src => src.GoldUserRoles)
- .Map(dest => dest.LastLogin, src => src.LastLogin);
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Map(dest => dest.Username, src => src.Username)
- .Map(dest => dest.Position, src => src.Position)
- .Map(dest => dest.DisplayName, src => src.DisplayName)
- .Map(dest => dest.FirstName, src => src.FirstName)
- .Map(dest => dest.MiddleName, src => src.MiddleName)
- .Map(dest => dest.LastName, src => src.LastName)
- .Map(dest => dest.Email, src => src.Email)
- .Map(dest => dest.Note, src => src.Note)
- .Map(dest => dest.Agencies, src => src.Agencies)
- .Map(dest => dest.Roles, src => src.Roles)
- .Map(dest => dest.GoldUserRoles, src => src.GoldUserRoles)
- .AfterMappingInline((m, e) => UpdateUser(m, e));
- }
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Required for signature")]
- private void UpdateUser(Pims.Api.Areas.Admin.Models.GoldUser.GoldUser model, Pims.Dal.Entities.GoldUser entity)
- {
- entity.Agencies.Where(a => a != null).ForEach(a => a.UserId = entity.Id);
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/User/RoleMap.cs b/backend/api/Areas/Admin/Mapping/User/RoleMap.cs
deleted file mode 100644
index 50a49b8ee7..0000000000
--- a/backend/api/Areas/Admin/Mapping/User/RoleMap.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using Mapster;
-using System;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.User;
-
-namespace Pims.Api.Areas.Admin.Mapping.User
-{
- public class RoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId)
- .Inherits, Api.Models.LookupModel>();
-
- config.NewConfig()
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId)
- .Inherits, Entity.LookupEntity>();
-
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.RoleId);
-
- config.NewConfig()
- .Map(dest => dest.RoleId, src => src.Id);
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Mapping/User/UserMap.cs b/backend/api/Areas/Admin/Mapping/User/UserMap.cs
deleted file mode 100644
index 3fed9e5807..0000000000
--- a/backend/api/Areas/Admin/Mapping/User/UserMap.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using Mapster;
-using Pims.Core.Extensions;
-using System.Linq;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Admin.Models.User;
-
-namespace Pims.Api.Areas.Admin.Mapping.User
-{
- public class UserMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Map(dest => dest.Username, src => src.Username)
- .Map(dest => dest.Position, src => src.Position)
- .Map(dest => dest.DisplayName, src => src.DisplayName)
- .Map(dest => dest.FirstName, src => src.FirstName)
- .Map(dest => dest.MiddleName, src => src.MiddleName)
- .Map(dest => dest.LastName, src => src.LastName)
- .Map(dest => dest.Email, src => src.Email)
- .Map(dest => dest.Note, src => src.Note)
- .Map(dest => dest.Agencies, src => src.Agencies.Select(a => a.Agency))
- .Map(dest => dest.Roles, src => src.Roles.Select(a => a.Role))
- .Map(dest => dest.LastLogin, src => src.LastLogin)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.KeycloakUserId, src => src.KeycloakUserId)
- .Map(dest => dest.IsDisabled, src => src.IsDisabled)
- .Map(dest => dest.Username, src => src.Username)
- .Map(dest => dest.Position, src => src.Position)
- .Map(dest => dest.DisplayName, src => src.DisplayName)
- .Map(dest => dest.FirstName, src => src.FirstName)
- .Map(dest => dest.MiddleName, src => src.MiddleName)
- .Map(dest => dest.LastName, src => src.LastName)
- .Map(dest => dest.Email, src => src.Email)
- .Map(dest => dest.Note, src => src.Note)
- .Map(dest => dest.Agencies, src => src.Agencies)
- .Map(dest => dest.Roles, src => src.Roles)
- .Map(dest => dest.LastLogin, src => src.LastLogin)
- .AfterMappingInline((m, e) => UpdateUser(m, e))
- .Inherits();
- }
-
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Required for signature")]
- private void UpdateUser(Model.UserModel model, Entity.User entity)
- {
- entity.Agencies.Where(a => a != null).ForEach(a => a.UserId = entity.Id);
- entity.Roles.Where(r => r != null).ForEach(r => r.UserId = entity.Id);
- }
- }
-}
diff --git a/backend/api/Areas/Admin/Models/AdministrativeArea/AdministrativeAreaModel.cs b/backend/api/Areas/Admin/Models/AdministrativeArea/AdministrativeAreaModel.cs
deleted file mode 100644
index b952f5a565..0000000000
--- a/backend/api/Areas/Admin/Models/AdministrativeArea/AdministrativeAreaModel.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-namespace Pims.Api.Areas.Admin.Models.AdministrativeArea
-{
- ///
- /// AdministrativeAreaModel, provides a model that represents administrative areas.
- ///
- public class AdministrativeAreaModel : Api.Models.LookupModel
- {
- #region Properties
- ///
- /// get/set - An abbreviated name.
- ///
- public string Abbreviation { get; set; }
-
- ///
- /// get/set - A description of the boundary type for this area (o.e. Legal).
- ///
- public string BoundaryType { get; set; }
-
- ///
- /// get/set - The parent group name for this area.
- ///
- public string GroupName { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Agency/AgencyModel.cs b/backend/api/Areas/Admin/Models/Agency/AgencyModel.cs
deleted file mode 100644
index 1119b84c76..0000000000
--- a/backend/api/Areas/Admin/Models/Agency/AgencyModel.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-namespace Pims.Api.Areas.Admin.Models.Agency
-{
- ///
- /// AgencyModel class, provides a model that represents the agency.
- ///
- public class AgencyModel : Api.Models.CodeModel
- {
- #region Properties
- ///
- /// get/set - The agency description.
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - The agency email.
- ///
- public string Email { get; set; }
-
- ///
- /// get/set - The CC agency email.
- ///
- public string CcEmail { get; set; }
-
- ///
- /// get/set - Whether to send email to the agency.
- ///
- public bool SendEmail { get; set; }
-
- ///
- /// get/set - Who the email will be addressed to.
- ///
- public string AddressTo { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Claim/ClaimModel.cs b/backend/api/Areas/Admin/Models/Claim/ClaimModel.cs
deleted file mode 100644
index 547ace1c5d..0000000000
--- a/backend/api/Areas/Admin/Models/Claim/ClaimModel.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Admin.Models.Claim
-{
- public class ClaimModel : Api.Models.BaseModel
- {
- #region Properties
- ///
- /// get/set - The primary key IDENTITY.
- ///
- ///
- public Guid Id { get; set; }
-
- ///
- /// get/set - The claims display name.
- ///
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - The GUID that identifies this Role in Keycloak.
- ///
- public Guid? KeycloakRoleId { get; set; }
-
- ///
- /// get/set - The claims first name.
- ///
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - Whether the user is disabled.
- ///
- ///
- public bool IsDisabled { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/AddressModel.cs b/backend/api/Areas/Admin/Models/Parcel/AddressModel.cs
deleted file mode 100644
index db5fed68f6..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/AddressModel.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Model = Pims.Api.Models;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class AddressModel : Model.BaseModel
- {
- #region Properties
- public int Id { get; set; }
-
- public string Line1 { get; set; }
-
- public string Line2 { get; set; }
-
- public string AdministrativeArea { get; set; }
-
- public string ProvinceId { get; set; }
-
- public string Province { get; set; }
-
- public string Postal { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/BuildingEvaluationModel.cs b/backend/api/Areas/Admin/Models/Parcel/BuildingEvaluationModel.cs
deleted file mode 100644
index 018a06b781..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/BuildingEvaluationModel.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class BuildingEvaluationModel : Api.Models.BaseModel
- {
- #region Properties
- public int BuildingId { get; set; }
-
- public DateTime Date { get; set; }
-
- public string Key { get; set; }
-
- public decimal Value { get; set; }
-
- public string Note { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/BuildingFiscalModel.cs b/backend/api/Areas/Admin/Models/Parcel/BuildingFiscalModel.cs
deleted file mode 100644
index fc1da2dd67..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/BuildingFiscalModel.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class BuildingFiscalModel : Api.Models.BaseModel
- {
- #region Properties
- public int BuildingId { get; set; }
-
- public int FiscalYear { get; set; }
-
- public string Key { get; set; }
-
- public decimal Value { get; set; }
-
- public string Note { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/BuildingModel.cs b/backend/api/Areas/Admin/Models/Parcel/BuildingModel.cs
deleted file mode 100644
index 141a732d77..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/BuildingModel.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Model = Pims.Api.Models;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class BuildingModel : Model.BaseModel
- {
- #region Properties
- public int Id { get; set; }
-
- public int ParcelId { get; set; }
-
- public int AgencyId { get; set; }
-
- public string SubAgency { get; set; }
-
- public string Agency { get; set; }
-
- public string Name { get; set; }
-
- public string Description { get; set; }
-
- public AddressModel Address { get; set; }
-
- public double Latitude { get; set; }
-
- public double Longitude { get; set; }
-
- public int BuildingConstructionTypeId { get; set; }
-
- public string BuildingConstructionType { get; set; }
-
- public int BuildingFloorCount { get; set; }
-
- public int BuildingPredominateUseId { get; set; }
-
- public string BuildingPredominateUse { get; set; }
-
- public int BuildingOccupantTypeId { get; set; }
-
- public string BuildingOccupantType { get; set; }
-
- public DateTime? LeaseExpiry { get; set; }
-
- public string OccupantName { get; set; }
-
- public bool TransferLeaseOnSale { get; set; }
-
- public string BuildingTenancy { get; set; }
-
- public float RentableArea { get; set; }
-
- public float TotalArea { get; set; }
-
- public bool IsSensitive { get; set; }
-
- public IEnumerable Evaluations { get; set; } = new List();
-
- public IEnumerable Fiscals { get; set; } = new List();
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/ParcelBuildingModel.cs b/backend/api/Areas/Admin/Models/Parcel/ParcelBuildingModel.cs
deleted file mode 100644
index d71f57a931..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/ParcelBuildingModel.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Model = Pims.Api.Models;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class ParcelBuildingModel : Model.BaseModel
- {
- #region Properties
- public int Id { get; set; }
-
- public int ParcelId { get; set; }
-
- public int AgencyId { get; set; }
-
- public string Agency { get; set; }
-
- public string SubAgency { get; set; }
-
- public string Name { get; set; }
-
- public string Description { get; set; }
-
- public AddressModel Address { get; set; }
-
- public double Latitude { get; set; }
-
- public double Longitude { get; set; }
-
- public int BuildingConstructionTypeId { get; set; }
-
- public string BuildingConstructionType { get; set; }
-
- public int BuildingFloorCount { get; set; }
-
- public int BuildingPredominateUseId { get; set; }
-
- public string BuildingPredominateUse { get; set; }
-
- public int BuildingOccupantTypeId { get; set; }
-
- public string BuildingOccupantType { get; set; }
-
- public DateTime? LeaseExpiry { get; set; }
-
- public string OccupantName { get; set; }
-
- public bool TransferLeaseOnSale { get; set; }
-
- public string BuildingTenancy { get; set; }
-
- public float RentableArea { get; set; }
-
- public bool IsSensitive { get; set; }
-
- public IEnumerable Evaluations { get; set; } = new List();
-
- public IEnumerable Fiscals { get; set; } = new List();
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/ParcelEvaluationModel.cs b/backend/api/Areas/Admin/Models/Parcel/ParcelEvaluationModel.cs
deleted file mode 100644
index c765448c3b..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/ParcelEvaluationModel.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class ParcelEvaluationModel : Api.Models.BaseModel
- {
- #region Properties
- public int ParcelId { get; set; }
-
- public DateTime Date { get; set; }
-
- public string Key { get; set; }
-
- public decimal Value { get; set; }
-
- public string Note { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/ParcelFiscalModel.cs b/backend/api/Areas/Admin/Models/Parcel/ParcelFiscalModel.cs
deleted file mode 100644
index 417f2f7998..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/ParcelFiscalModel.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class ParcelFiscalModel : Api.Models.BaseModel
- {
- #region Properties
- public int ParcelId { get; set; }
-
- public int FiscalYear { get; set; }
-
- public string Key { get; set; }
-
- public decimal Value { get; set; }
-
- public string Note { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/ParcelModel.cs b/backend/api/Areas/Admin/Models/Parcel/ParcelModel.cs
deleted file mode 100644
index 27a20f5e79..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/ParcelModel.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-using System.Collections.Generic;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class ParcelModel : PropertyModel
- {
- #region Properties
- public string PID { get; set; }
-
- public int? PIN { get; set; }
-
- public float LandArea { get; set; }
-
- public string LandLegalDescription { get; set; }
-
- public string Zoning { get; set; }
-
- public string ZoningPotential { get; set; }
-
- public IEnumerable Evaluations { get; set; } = new List();
-
- public IEnumerable Fiscals { get; set; } = new List();
-
- public IEnumerable Buildings { get; set; } = new List();
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/PartialBuildingModel.cs b/backend/api/Areas/Admin/Models/Parcel/PartialBuildingModel.cs
deleted file mode 100644
index 4e96b64913..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/PartialBuildingModel.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using Model = Pims.Api.Models;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class PartialBuildingModel : Model.BaseModel
- {
- #region Properties
- public int Id { get; set; }
-
- public string Name { get; set; }
-
- public string Description { get; set; }
-
- public double Latitude { get; set; }
-
- public double Longitude { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/PartialParcelModel.cs b/backend/api/Areas/Admin/Models/Parcel/PartialParcelModel.cs
deleted file mode 100644
index 9069ba2b0f..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/PartialParcelModel.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class PartialParcelModel : PartialPropertyModel
- {
- #region Properties
- public string PID { get; set; }
-
- public int PIN { get; set; }
-
- public string Zoning { get; set; }
-
- public string ZoningPotential { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/PartialPropertyModel.cs b/backend/api/Areas/Admin/Models/Parcel/PartialPropertyModel.cs
deleted file mode 100644
index dd60a10488..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/PartialPropertyModel.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Model = Pims.Api.Models;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class PartialPropertyModel : Model.BaseModel
- {
- #region Properties
- public int Id { get; set; }
-
- public int StatusId { get; set; }
-
- public int ClassificationId { get; set; }
-
- public double Latitude { get; set; }
-
- public double Longitude { get; set; }
-
- public string Name { get; set; }
-
- public string Description { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Parcel/PropertyModel.cs b/backend/api/Areas/Admin/Models/Parcel/PropertyModel.cs
deleted file mode 100644
index fda79c49b6..0000000000
--- a/backend/api/Areas/Admin/Models/Parcel/PropertyModel.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using Model = Pims.Api.Models;
-
-namespace Pims.Api.Areas.Admin.Models.Parcel
-{
- public class PropertyModel : Model.BaseModel
- {
- #region Properties
- public int Id { get; set; }
-
- public string ProjectNumber { get; set; }
-
- public int StatusId { get; set; }
-
- public string Status { get; set; }
-
- public string Name { get; set; }
-
- public string Description { get; set; }
-
- public int ClassificationId { get; set; }
-
- public string Classification { get; set; }
-
- public int AgencyId { get; set; }
-
- public string SubAgency { get; set; }
-
- public string Agency { get; set; }
-
- public AddressModel Address { get; set; }
-
- public double Latitude { get; set; }
-
- public double Longitude { get; set; }
-
- public bool IsSensitive { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Role/ClaimModel.cs b/backend/api/Areas/Admin/Models/Role/ClaimModel.cs
deleted file mode 100644
index 483386b12d..0000000000
--- a/backend/api/Areas/Admin/Models/Role/ClaimModel.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Admin.Models.Role
-{
- public class ClaimModel : Api.Models.BaseModel
- {
- #region Properties
- ///
- /// get/set - The primary key IDENTITY.
- ///
- ///
- public Guid Id { get; set; }
-
- ///
- /// get/set - The claims display name.
- ///
- ///
- public string Name { get; set; }
-
- ///
- /// get/set - The GUID that identifies this Role in Keycloak.
- ///
- public Guid? KeycloakRoleId { get; set; }
-
- ///
- /// get/set - The claims first name.
- ///
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - Whether the user is disabled.
- ///
- ///
- public bool IsDisabled { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/Role/RoleModel.cs b/backend/api/Areas/Admin/Models/Role/RoleModel.cs
deleted file mode 100644
index a9d817a87a..0000000000
--- a/backend/api/Areas/Admin/Models/Role/RoleModel.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Pims.Api.Areas.Admin.Models.Role
-{
- ///
- /// RoleModel class, provides a model that represents a role.
- ///
- public class RoleModel : Api.Models.LookupModel
- {
- #region Properties
- ///
- /// get/set - The role description.
- ///
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - Whether the role is public.
- /// One which users can request to join.
- ///
- public bool IsPublic { get; set; }
-
- ///
- /// get/set - The keycloak group id.
- ///
- public Guid? KeycloakGroupId { get; set; }
-
- ///
- /// get/set - An array of claims associated to this role.
- ///
- public IEnumerable Claims { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/User/AccessRequestAgencyModel.cs b/backend/api/Areas/Admin/Models/User/AccessRequestAgencyModel.cs
deleted file mode 100644
index 36430dc489..0000000000
--- a/backend/api/Areas/Admin/Models/User/AccessRequestAgencyModel.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace Pims.Api.Areas.Admin.Models.User
-{
- ///
- /// AccessRequestAgencyModel class, provides a model that represents the agency.
- ///
- public class AccessRequestAgencyModel : Api.Models.CodeModel
- {
- #region Properties
- ///
- /// get/set - The agency description.
- ///
- public string Description { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/User/AccessRequestModel.cs b/backend/api/Areas/Admin/Models/User/AccessRequestModel.cs
deleted file mode 100644
index 295e879968..0000000000
--- a/backend/api/Areas/Admin/Models/User/AccessRequestModel.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Pims.Dal.Entities;
-using System.Collections.Generic;
-
-namespace Pims.Api.Areas.Admin.Models.User
-{
- public class AccessRequestModel : Api.Models.BaseModel
- {
- #region Properties
- public int Id { get; set; }
- public AccessRequestStatus Status { get; set; }
- public string Note { get; set; }
- public AccessRequestUserModel User { get; set; }
- public IEnumerable Agencies { get; set; }
- public IEnumerable Roles { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/User/AccessRequestRoleModel.cs b/backend/api/Areas/Admin/Models/User/AccessRequestRoleModel.cs
deleted file mode 100644
index 8ada4f3af8..0000000000
--- a/backend/api/Areas/Admin/Models/User/AccessRequestRoleModel.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Admin.Models.User
-{
- ///
- /// AccessRequestRoleModel class, provides a model that represents a role attached to an access request.
- ///
- public class AccessRequestRoleModel : Api.Models.LookupModel
- {
- #region Properties
- public string Description { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/User/AccessRequestUserModel.cs b/backend/api/Areas/Admin/Models/User/AccessRequestUserModel.cs
deleted file mode 100644
index 108423156c..0000000000
--- a/backend/api/Areas/Admin/Models/User/AccessRequestUserModel.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Admin.Models.User
-{
- ///
- /// AccessRequestUserModel class, provides a model that represents a user attached to an access request.
- ///
- public class AccessRequestUserModel : Pims.Api.Models.BaseModel
- {
- #region Properties
- ///
- /// get/set - The user's unique identifier.
- ///
- ///
- public Guid Id { get; set; }
-
- ///
- /// get/set - The user's display name.
- ///
- ///
- public string DisplayName { get; set; }
-
- ///
- /// get/set - The user's given name.
- ///
- ///
- public string FirstName { get; set; }
-
- ///
- /// get/set - The user's middlename.
- ///
- ///
- public string MiddleName { get; set; }
-
- ///
- /// get/set - The user's surname.
- ///
- ///
- public string LastName { get; set; }
-
- ///
- /// get/set - The user's email.
- ///
- ///
- public string Email { get; set; }
-
- ///
- /// get/set - The username.
- ///
- ///
- public string Username { get; set; }
-
- ///
- /// get/set - The position.
- ///
- ///
- public string Position { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/User/AgencyModel.cs b/backend/api/Areas/Admin/Models/User/AgencyModel.cs
deleted file mode 100644
index 252c288cf8..0000000000
--- a/backend/api/Areas/Admin/Models/User/AgencyModel.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Pims.Api.Areas.Admin.Models.User
-{
- ///
- /// AgencyModel class, provides a model that represents the agency.
- ///
- public class AgencyModel : Api.Models.CodeModel
- {
- #region Properties
- ///
- /// get/set - The agency description.
- ///
- ///
- public string Description { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/User/GoldUserModel.cs b/backend/api/Areas/Admin/Models/User/GoldUserModel.cs
deleted file mode 100644
index 1695be456e..0000000000
--- a/backend/api/Areas/Admin/Models/User/GoldUserModel.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System.Collections.Generic;
-using Pims.Api.Areas.Admin.Models.User;
-
-namespace Pims.Api.Areas.Admin.Models.GoldUser
-{
- ///
- /// Extension of the UserModel class, this class adds a new array which represents keycloak gold roles
- ///
- public class GoldUser : UserModel
- {
- public IEnumerable GoldUserRoles { get; set; }
- }
-}
\ No newline at end of file
diff --git a/backend/api/Areas/Admin/Models/User/RoleModel.cs b/backend/api/Areas/Admin/Models/User/RoleModel.cs
deleted file mode 100644
index 0164ee9c2b..0000000000
--- a/backend/api/Areas/Admin/Models/User/RoleModel.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-
-namespace Pims.Api.Areas.Admin.Models.User
-{
- ///
- /// RoleModel class, provides a model that represents a role.
- ///
- public class RoleModel : Api.Models.LookupModel
- {
- #region Properties
- ///
- /// get/set - The role description.
- ///
- ///
- public string Description { get; set; }
-
- ///
- /// get/set - The keycloak group id.
- ///
- public Guid? KeycloakGroupId { get; set; }
-
- ///
- /// get/set - Whether the role is public.
- /// One which users can request to join.
- ///
- public bool IsPublic { get; set; }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Admin/Models/User/UserModel.cs b/backend/api/Areas/Admin/Models/User/UserModel.cs
deleted file mode 100644
index 46efb53d44..0000000000
--- a/backend/api/Areas/Admin/Models/User/UserModel.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Pims.Api.Areas.Admin.Models.User
-{
- ///
- /// UserModel class, provides a model that represents a user.
- ///
- public class UserModel : Pims.Api.Models.BaseModel
- {
- #region Properties
- ///
- /// get/set - The user's unique identifier.
- ///
- public Guid Id { get; set; }
-
- ///
- /// get/set - Unique identifier to link user with Keycloak user.
- ///
- public Guid? KeycloakUserId { get; set; }
-
- ///
- /// get/set - The user's unique identity.
- ///
- public string Username { get; set; }
-
- ///
- /// get/set - The user's position title.
- ///
- public string Position { get; set; }
-
- ///
- /// get/set - The user's display name.
- ///
- public string DisplayName { get; set; }
-
- ///
- /// get/set - The user's given name.
- ///
- public string FirstName { get; set; }
-
- ///
- /// get/set - The user's middlename.
- ///
- public string MiddleName { get; set; }
-
- ///
- /// get/set - The user's surname.
- ///
- public string LastName { get; set; }
-
- ///
- /// get/set - The user's email.
- ///
- public string Email { get; set; }
-
- ///
- /// get/set - Whether the user is disabled.
- ///
- ///
- public bool IsDisabled { get; set; }
-
- ///
- /// get/set - Whether the email has been verified.
- ///
- ///
- public bool EmailVerified { get; set; }
-
- ///
- /// get/set - A note about the user.
- ///
- public string Note { get; set; }
-
- ///
- /// get/set - User's last login timestamp
- ///
- public DateTime? LastLogin { get; set; }
-
- ///
- /// get/set - An array of agencies the user belongs to.
- ///
- public IEnumerable Agencies { get; set; } = new List();
-
- ///
- /// get/set - An array of roles the user is a member of.
- ///
- public IEnumerable Roles { get; set; } = new List();
- #endregion
- }
-}
diff --git a/backend/api/Areas/Keycloak/Controllers/RoleController.cs b/backend/api/Areas/Keycloak/Controllers/RoleController.cs
deleted file mode 100644
index bc10e6ba74..0000000000
--- a/backend/api/Areas/Keycloak/Controllers/RoleController.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-using MapsterMapper;
-using Microsoft.AspNetCore.Mvc;
-using Pims.Api.Policies;
-using Pims.Dal.Keycloak;
-using Pims.Dal.Security;
-using Swashbuckle.AspNetCore.Annotations;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.Role;
-
-namespace Pims.Api.Areas.Keycloak.Controllers
-{
- ///
- /// RoleController class, provides endpoints for managing the integration between keycloak groups and PIMS roles.
- ///
- [HasPermission(Permissions.AdminRoles)]
- [ApiController]
- [Area("keycloak")]
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/[area]/roles")]
- [Route("[area]/roles")]
- public class RoleController : ControllerBase
- {
- #region Variables
- private readonly IPimsKeycloakService _keycloakService;
- private readonly IMapper _mapper;
- #endregion
-
- #region Constructors
- ///
- /// Creates a new instance of a RoleController class, initializes with specified arguments.
- ///
- ///
- ///
- public RoleController(IPimsKeycloakService keycloakService, IMapper mapper)
- {
- _mapper = mapper;
- _keycloakService = keycloakService;
- }
- #endregion
-
- #region Endpoints
- ///
- /// Sync keycloak groups into PIMS roles.
- ///
- ///
- [HttpPost("sync")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(IEnumerable), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-role" })]
- [HasPermission(Permissions.AdminRoles)]
- public async Task SyncRolesAsync()
- {
- var roles = await _keycloakService.SyncRolesAsync();
- var result = _mapper.Map(roles);
-
- return new JsonResult(result);
- }
-
- ///
- /// Fetch a list of groups from Keycloak and their associated role within PIMS.
- ///
- ///
- ///
- ///
- ///
- [HttpGet]
- [Produces("application/json")]
- [ProducesResponseType(typeof(IEnumerable), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-role" })]
- [HasPermission(Permissions.AdminRoles)]
- public async Task GetRolesAsync(int page = 1, int quantity = 10, string search = null)
- {
- var roles = await _keycloakService.GetRolesAsync(page, quantity, search);
- var result = _mapper.Map(roles);
-
- return new JsonResult(result);
- }
-
- ///
- /// Fetch role for the specified 'id'.
- /// If the group doesn't exist in keycloak it will return a 400 BadRequest.
- /// If the role doesn't exist in PIMS it will return a 400 BadRequest.
- ///
- /// The role does not exist for the specified 'id'.
- ///
- [HttpGet("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.RoleModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-role" })]
- [HasPermission(Permissions.AdminRoles)]
- public async Task GetRoleAsync(Guid id)
- {
- var role = await _keycloakService.GetRoleAsync(id);
- var result = _mapper.Map(role);
-
- return new JsonResult(result);
- }
-
- ///
- /// Update the keycloak group and PIMS role for the specified 'id'.
- /// If the group doesn't exist in keycloak it will return a 400 BadRequest.
- /// If the role doesn't exist in PIMS it will create it.
- ///
- /// The role does not exist for the specified 'id'.
- ///
- [HttpPut("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.RoleModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-role" })]
- [HasPermission(Permissions.AdminRoles)]
- public async Task UpdateRoleAsync(Guid id, [FromBody] Model.Update.RoleModel model)
- {
- var role = _mapper.Map(model);
- role.Id = id;
- await _keycloakService.UpdateRoleAsync(role);
- var result = _mapper.Map(role);
-
- return new JsonResult(result);
- }
- #endregion
- }
-}
diff --git a/backend/api/Areas/Keycloak/Controllers/UserController.cs b/backend/api/Areas/Keycloak/Controllers/UserController.cs
deleted file mode 100644
index cc16aea0dc..0000000000
--- a/backend/api/Areas/Keycloak/Controllers/UserController.cs
+++ /dev/null
@@ -1,155 +0,0 @@
-using MapsterMapper;
-using Microsoft.AspNetCore.Mvc;
-using Pims.Api.Policies;
-using Pims.Dal.Keycloak;
-using Pims.Dal.Security;
-using Swashbuckle.AspNetCore.Annotations;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using AdminModels = Pims.Api.Areas.Admin.Models.User;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Controllers
-{
- ///
- /// UserController class, provides endpoints for managing users within keycloak.
- ///
- [HasPermission(Permissions.AdminUsers)]
- [ApiController]
- [Area("keycloak")]
- [ApiVersion("1.0")]
- [Route("v{version:apiVersion}/[area]/users")]
- [Route("[area]/users")]
- public class UserController : ControllerBase
- {
- #region Variables
- private readonly IMapper _mapper;
- private readonly IPimsKeycloakService _keycloakService;
- #endregion
-
- #region Constructors
- ///
- /// Creates a new instance of a UserController class.
- ///
- ///
- ///
- public UserController(IMapper mapper, IPimsKeycloakService keycloakService)
- {
- _keycloakService = keycloakService;
- _mapper = mapper;
- }
- #endregion
-
- #region Endpoints
- ///
- /// Sync the user for the specified 'id' from keycloak with PIMS.
- /// If the user does not exist in keycloak it will return a 400-BadRequest.
- /// If the user does not exist in PIMS it will add it.
- /// Also links the user to the appropriate groups it is a member of within keycloak.!--
- /// If the group does not exist in PIMS it will add it.
- ///
- ///
- /// The user does not exist in keycloak.
- ///
- [HttpPost("sync/{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-user" })]
- [HasPermission(Permissions.AdminUsers)]
- public async Task SyncUserAsync(Guid keycloakUserId)
- {
- var user = await _keycloakService.SyncUserAsync(keycloakUserId);
- var result = _mapper.Map(user);
-
- return new JsonResult(result);
- }
-
-
- ///
- /// Fetch an array of users from keycloak.
- /// This endpoint supports paging.
- ///
- ///
- ///
- ///
- ///
- [HttpGet]
- [Produces("application/json")]
- [ProducesResponseType(typeof(IEnumerable), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-user" })]
- [HasPermission(Permissions.AdminUsers)]
- public async Task GetUsersAsync(int page = 1, int quantity = 10, string search = null)
- {
- var users = await _keycloakService.GetUsersAsync(page, quantity, search);
- var result = _mapper.Map(users);
-
- return new JsonResult(result);
- }
-
- ///
- /// Fetch the user for the specified 'id'.
- /// If the user does not exist in keycloak or PIMS return a 400-BadRequest.
- ///
- /// The user does not exist in keycloak.
- ///
- [HttpGet("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-user" })]
- [HasPermission(Permissions.AdminUsers)]
- public async Task GetUserAsync(Guid id)
- {
- var user = await _keycloakService.GetUserAsync(id);
- var result = _mapper.Map(user);
-
- return new JsonResult(result);
- }
-
- ///
- /// Update the user for the specified 'id'.
- /// If the user does not exist in Keycloak or PIMS return a 400-BadRequest.
- ///
- /// The user does not exist in Keycloak or PIMS.
- ///
- [HttpPut("{id}")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(AdminModels.UserModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-user" })]
- [HasPermission(Permissions.AdminUsers)]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'id' is required for route.")]
- public async Task UpdateUserAsync(Guid id, [FromBody] AdminModels.UserModel model)
- {
- var user = _mapper.Map(model);
- var entity = await _keycloakService.UpdateUserAsync(user);
- var result = _mapper.Map(entity);
- return new JsonResult(result);
- }
-
- #region Access Request
- ///
- /// Update an access request, generally to grant/deny it.
- ///
- ///
- [HttpPut("access/request")]
- [Produces("application/json")]
- [ProducesResponseType(typeof(Model.AccessRequestModel), 200)]
- [ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
- [SwaggerOperation(Tags = new[] { "keycloak-user" })]
- [HasPermission(Permissions.AdminUsers)]
- public async Task UpdateAccessRequestAsync(Model.AccessRequestModel updateModel)
- {
- var entity = _mapper.Map(updateModel);
- var updatedEntity = await _keycloakService.UpdateAccessRequestAsync(entity);
- var user = _mapper.Map(updatedEntity);
- return new JsonResult(user);
- }
- #endregion
- #endregion
- }
-}
diff --git a/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs b/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs
deleted file mode 100644
index 1f05d9318d..0000000000
--- a/backend/api/Areas/Keycloak/Mapping/Role/RoleMap.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Mapster;
-using System;
-using Entity = Pims.Dal.Entities;
-using KModel = Pims.Keycloak.Models;
-using Model = Pims.Api.Areas.Keycloak.Models.Role;
-
-namespace Pims.Api.Areas.Admin.Keycloak.Role
-{
- public class RoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.KeycloakGroupId, src => src.KeycloakGroupId)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits, Api.Models.LookupModel>();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits, Entity.LookupEntity>();
-
- config.NewConfig()
- .Map(dest => dest.KeycloakGroupId, src => src.Id)
- .Map(dest => dest.Name, src => src.Name);
- }
- }
-}
diff --git a/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs b/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs
deleted file mode 100644
index b6519585b4..0000000000
--- a/backend/api/Areas/Keycloak/Mapping/Role/UpdateRoleMap.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using Mapster;
-using System;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.Role;
-
-namespace Pims.Api.Areas.Admin.Keycloak.Role
-{
- public class UpdateRoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Name, src => src.Name)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits();
-
-
- config.NewConfig()
- .Map(dest => dest.RowVersion, src => src.RowVersion == null ? null : Convert.ToBase64String(src.RowVersion));
-
- config.NewConfig()
- .Map(dest => dest.RowVersion, src => src.RowVersion == null ? null : Convert.FromBase64String(src.RowVersion));
- }
- }
-}
diff --git a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestAgencyMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AccessRequestAgencyMap.cs
deleted file mode 100644
index 5bc6dd5930..0000000000
--- a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestAgencyMap.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class AccessRequestAgencyMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.AgencyId)
- .Map(dest => dest.Description, src => src.Agency == null ? null : src.Agency.Description)
- .Map(dest => dest.Name, src => src.Agency == null ? null : src.Agency.Name)
- .Map(dest => dest.IsDisabled, src => src.Agency == null ? false : src.Agency.IsDisabled)
- .Map(dest => dest.SortOrder, src => src.Agency == null ? 0 : src.Agency.SortOrder)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.AgencyId, src => src.Id)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AccessRequestMap.cs
deleted file mode 100644
index 7f905edb5a..0000000000
--- a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestMap.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class AccessRequestMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Status, src => src.Status)
- .Map(dest => dest.Agencies, src => src.Agencies)
- .Map(dest => dest.Roles, src => src.Roles)
- .Map(dest => dest.User, src => src.User)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.Status, src => src.Status)
- .Map(dest => dest.Agencies, src => src.Agencies)
- .Map(dest => dest.Roles, src => src.Roles)
- .Map(dest => dest.User, src => src.User)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestRoleMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AccessRequestRoleMap.cs
deleted file mode 100644
index e4626a1a7a..0000000000
--- a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestRoleMap.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class AccessRequestRoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.RoleId)
- .Map(dest => dest.Description, src => src.Role == null ? null : src.Role.Description)
- .Map(dest => dest.Name, src => src.Role == null ? null : src.Role.Name)
- .Map(dest => dest.IsDisabled, src => src.Role == null ? false : src.Role.IsDisabled)
- .Map(dest => dest.SortOrder, src => src.Role == null ? 0 : src.Role.SortOrder)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.RoleId, src => src.Id)
- .Map(dest => dest.Role, src => new Entity.Role(src.Id, src.Name)
- {
- Description = src.Description,
- IsDisabled = src.IsDisabled,
- SortOrder = src.SortOrder
- })
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestUserMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AccessRequestUserMap.cs
deleted file mode 100644
index 95bb14eab1..0000000000
--- a/backend/api/Areas/Keycloak/Mapping/User/AccessRequestUserMap.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class AccessRequestUserMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.DisplayName, src => src.DisplayName)
- .Map(dest => dest.FirstName, src => src.FirstName)
- .Map(dest => dest.MiddleName, src => src.MiddleName)
- .Map(dest => dest.LastName, src => src.LastName)
- .Map(dest => dest.Email, src => src.Email)
- .Inherits();
-
- config.NewConfig()
- .Map(dest => dest.Id, src => src.Id)
- .Map(dest => dest.DisplayName, src => src.DisplayName)
- .Map(dest => dest.FirstName, src => src.FirstName)
- .Map(dest => dest.MiddleName, src => src.MiddleName)
- .Map(dest => dest.LastName, src => src.LastName)
- .Map(dest => dest.Email, src => src.Email)
- .Inherits();
- }
- }
-}
diff --git a/backend/api/Areas/Keycloak/Mapping/User/AgencyMap.cs b/backend/api/Areas/Keycloak/Mapping/User/AgencyMap.cs
deleted file mode 100644
index 657f26567e..0000000000
--- a/backend/api/Areas/Keycloak/Mapping/User/AgencyMap.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Mapster;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class AgencyMap : IRegister
- {
-
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.ParentId, src => src.ParentId)
- .Inherits, Api.Models.CodeModel>();
-
-
- config.NewConfig()
- .IgnoreNonMapped(true)
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.ParentId, src => src.ParentId)
- .Inherits, Entity.CodeEntity>();
- }
- }
-}
diff --git a/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs b/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs
deleted file mode 100644
index d721b6ac02..0000000000
--- a/backend/api/Areas/Keycloak/Mapping/User/RoleMap.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using Mapster;
-using System;
-using Entity = Pims.Dal.Entities;
-using Model = Pims.Api.Areas.Keycloak.Models.User;
-
-namespace Pims.Api.Areas.Keycloak.Mapping.User
-{
- public class RoleMap : IRegister
- {
- public void Register(TypeAdapterConfig config)
- {
- config.NewConfig()
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits, Api.Models.LookupModel>();
-
- config.NewConfig()
- .Map(dest => dest.Description, src => src.Description)
- .Map(dest => dest.IsPublic, src => src.IsPublic)
- .Inherits