Skip to content

Commit

Permalink
Merge pull request #3346 from bcgov/release/uat_is57
Browse files Browse the repository at this point in the history
UAT Release - IS56 & IS57
  • Loading branch information
devinleighsmith authored Jul 21, 2023
2 parents 8c3f114 + eecb34d commit 7ffc542
Show file tree
Hide file tree
Showing 1,606 changed files with 344,634 additions and 65,570 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/credentials-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
key: ${{ runner.os }}-pip

- name: Install requirements
run: python3 -m pip install --no-deps trufflehog3 pyyaml==6.0 attrs==20.3.0 gitpython==3.1.30 jinja2==3.0.1 tabulate>=0.8.10 jtbl gitdb>=4.0.1 typing-extensions>=3.7.4.3 smmap>=3.0.1 markupsafe>=2.0
run: pip install trufflehog3 jtbl

- name: Scan with trufflehog3
id: scan
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/keycloak-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Keycloak Sync
env:
AUTH__KEYCLOAK__SECRET: ${{ secrets.KEYCLOAK_SECRET }}
AUTH__KEYCLOAK__SERVICEACCOUNT__SECRET: ${{ secrets.KEYCLOAK_SERVICEACCOUNT_SECRET }}
sync-directory: ./tools/keycloak/sync
ASPNETCORE_ENVIRONMENT: ${{ inputs.TARGET_BRANCH }}

on:
workflow_dispatch:
inputs:
TARGET_BRANCH:
description: "Enter the target branch (dev/test)"
required: true

jobs:
sync-backend:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.TARGET_BRANCH }}

- name: Set ASPNETCORE_ENVIRONMENT (dev)
if: ${{ inputs.TARGET_BRANCH == 'dev' }}
run: echo "ASPNETCORE_ENVIRONMENT=development" >> $GITHUB_ENV

- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"

- name: Install dependencies for keycloak sync
run: dotnet restore
working-directory: ${{env.sync-directory}}

- name: Build keycloak sync
run: dotnet build
working-directory: ${{env.sync-directory}}

- name: Start keycloak sync
run: dotnet run
working-directory: ${{env.sync-directory}}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@
"Xunit",
"keycloak",
"pims"
]
],
"jest.rootPath": "./source/frontend/src"
}
4,076 changes: 2,230 additions & 1,846 deletions etl/LISOS_PIMS/LISOS_PIMS/LISOS_Load.dtsx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions etl/LISOS_PIMS/LISOS_PIMS/LISOS_PIMS.dtproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
<SSIS:Property SSIS:Name="Name">Package</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMajor">1</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMinor">0</SSIS:Property>
<SSIS:Property SSIS:Name="VersionBuild">1193</SSIS:Property>
<SSIS:Property SSIS:Name="VersionBuild">1255</SSIS:Property>
<SSIS:Property SSIS:Name="VersionComments">
</SSIS:Property>
<SSIS:Property SSIS:Name="VersionGUID">{7AC54920-9F5F-40FA-8A0D-71B376D97ED5}</SSIS:Property>
<SSIS:Property SSIS:Name="VersionGUID">{F6CA5D49-4381-4699-9F52-428EADF4CDF4}</SSIS:Property>
<SSIS:Property SSIS:Name="PackageFormatVersion">8</SSIS:Property>
<SSIS:Property SSIS:Name="Description">
</SSIS:Property>
Expand Down
2 changes: 1 addition & 1 deletion etl/PAIMS_PIMS_ACQUISITION/PAIMS_PIMS_ACQUISITION.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
# Visual Studio Version 15
VisualStudioVersion = 16.0.32510.428
MinimumVisualStudioVersion = 10.0.40219.1
Project("{159641D6-6404-4A2A-AE62-294DE0FE8301}") = "PAIMS_PIMS_ACQUISITION", "PAIMS_PIMS_ACQUISITION\PAIMS_PIMS_ACQUISITION.dtproj", "{38A39BF0-6E18-4581-ABE3-48771A4F65DB}"
Expand Down
283,625 changes: 250,875 additions & 32,750 deletions etl/PAIMS_PIMS_ACQUISITION/PAIMS_PIMS_ACQUISITION/PAIMS_ACQUISITION_TO_PIMS_DATASET.dtsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
<SSIS:Property SSIS:Name="Name">PAIMS_ACQUISITION_TO_PIMS_DATASET</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMajor">1</SSIS:Property>
<SSIS:Property SSIS:Name="VersionMinor">0</SSIS:Property>
<SSIS:Property SSIS:Name="VersionBuild">1401</SSIS:Property>
<SSIS:Property SSIS:Name="VersionBuild">1983</SSIS:Property>
<SSIS:Property SSIS:Name="VersionComments">
</SSIS:Property>
<SSIS:Property SSIS:Name="VersionGUID">{D9CEE380-B5C4-4A11-82AA-0BF1EE429B53}</SSIS:Property>
<SSIS:Property SSIS:Name="VersionGUID">{A5874049-7E8A-4495-84FC-AAC1A90D1F0E}</SSIS:Property>
<SSIS:Property SSIS:Name="PackageFormatVersion">8</SSIS:Property>
<SSIS:Property SSIS:Name="Description">
</SSIS:Property>
Expand Down Expand Up @@ -77,7 +77,7 @@
<SSIS:Property SSIS:Name="IncludeInDebugDump">0</SSIS:Property>
<SSIS:Property SSIS:Name="Required">0</SSIS:Property>
<SSIS:Property SSIS:Name="Sensitive">0</SSIS:Property>
<SSIS:Property SSIS:Name="Value">Data Source=lizzard.th.gov.bc.ca:20208/DEV03;User ID=prisharm;Provider=OraOLEDB.Oracle.1;Persist Security Info=True;</SSIS:Property>
<SSIS:Property SSIS:Name="Value">Data Source=lizzard.th.gov.bc.ca:20208/TST11;User ID=prisharm;Provider=OraOLEDB.Oracle.1;Persist Security Info=True;</SSIS:Property>
<SSIS:Property SSIS:Name="DataType">18</SSIS:Property>
</SSIS:Properties>
</SSIS:Parameter>
Expand Down Expand Up @@ -180,7 +180,7 @@
<SSIS:Property SSIS:Name="IncludeInDebugDump">0</SSIS:Property>
<SSIS:Property SSIS:Name="Required">0</SSIS:Property>
<SSIS:Property SSIS:Name="Sensitive">0</SSIS:Property>
<SSIS:Property SSIS:Name="Value">lizzard.th.gov.bc.ca:20208/DEV03</SSIS:Property>
<SSIS:Property SSIS:Name="Value">lizzard.th.gov.bc.ca:20208/TST11</SSIS:Property>
<SSIS:Property SSIS:Name="DataType">18</SSIS:Property>
</SSIS:Properties>
</SSIS:Parameter>
Expand Down Expand Up @@ -225,7 +225,7 @@
<SSIS:Property SSIS:Name="IncludeInDebugDump">0</SSIS:Property>
<SSIS:Property SSIS:Name="Required">0</SSIS:Property>
<SSIS:Property SSIS:Name="Sensitive">0</SSIS:Property>
<SSIS:Property SSIS:Name="Value">Data Source=sqldevtst.th.gov.bc.ca;Initial Catalog=PIMS_DEV;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;Application Name=SSIS-Package2-{397DB851-677E-4A08-84AE-EE76A4654BC7}PIMS;</SSIS:Property>
<SSIS:Property SSIS:Name="Value">Data Source=sqldevtst.th.gov.bc.ca;Initial Catalog=PIMS_TST;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;Application Name=SSIS-Package2-{397DB851-677E-4A08-84AE-EE76A4654BC7}PIMS;</SSIS:Property>
<SSIS:Property SSIS:Name="DataType">18</SSIS:Property>
</SSIS:Properties>
</SSIS:Parameter>
Expand Down Expand Up @@ -285,7 +285,7 @@
<SSIS:Property SSIS:Name="IncludeInDebugDump">0</SSIS:Property>
<SSIS:Property SSIS:Name="Required">0</SSIS:Property>
<SSIS:Property SSIS:Name="Sensitive">0</SSIS:Property>
<SSIS:Property SSIS:Name="Value">PIMS_DEV</SSIS:Property>
<SSIS:Property SSIS:Name="Value">PIMS_TST</SSIS:Property>
<SSIS:Property SSIS:Name="DataType">18</SSIS:Property>
</SSIS:Properties>
</SSIS:Parameter>
Expand Down

This file was deleted.

106 changes: 106 additions & 0 deletions source/backend/api/Areas/Leases/Controllers/InsuranceController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Areas.Lease.Controllers;
using Pims.Api.Models.Concepts;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Extensions;
using Pims.Core.Json;
using Pims.Dal.Entities;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;

namespace Pims.Api.Areas.Leases.Controllers
{
/// <summary>
/// InsuranceController class, provides endpoints for interacting with insurances.
/// </summary>
[Authorize]
[ApiController]
[ApiVersion("1.0")]
[Area("insurances")]
[Route("v{version:apiVersion}/leases/{leaseId}/[area]")]
[Route("/leases/{leaseId}/[area]")]
public class InsuranceController : ControllerBase
{
#region Variables
private readonly ILeaseService _leaseService;
private readonly IMapper _mapper;
private readonly ILogger _logger;
#endregion

#region Constructors

/// <summary>
/// Creates a new instance of a InsuranceController class, initializes it with the specified arguments.
/// </summary>
/// <param name="mapper"></param>
/// <param name="leaseService"></param>
/// <param name="logger"></param>
///
public InsuranceController(IMapper mapper, ILeaseService leaseService, ILogger<InsuranceController> logger)
{
_mapper = mapper;
_leaseService = leaseService;
_logger = logger;
}
#endregion

#region Endpoints

/// <summary>
/// Updates a list of insurance for a lease.
/// </summary>
/// <returns></returns>
[HttpPut]
[HasPermission(Permissions.LeaseEdit)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<InsuranceModel>), 200)]
[SwaggerOperation(Tags = new[] { "insurance" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateInsurance(int leaseId, IEnumerable<InsuranceModel> insurances)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(InsuranceController),
nameof(UpdateInsurance),
User.GetUsername(),
DateTime.Now);

var updatedEntities = _leaseService.UpdateInsuranceByLeaseId(leaseId, _mapper.Map<IEnumerable<PimsInsurance>>(insurances));

var insuranceModels = _mapper.Map<IEnumerable<InsuranceModel>>(updatedEntities);

return new JsonResult(insuranceModels);
}

/// <summary>
/// Get a list of insurance for a lease.
/// </summary>
/// <returns></returns>
[HttpGet]
[HasPermission(Permissions.LeaseEdit)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<InsuranceModel>), 200)]
[SwaggerOperation(Tags = new[] { "insurance" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetInsurance(int leaseId)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(PropertyImprovementController),
nameof(GetInsurance),
User.GetUsername(),
DateTime.Now);

var insuranceModels = _mapper.Map<IEnumerable<InsuranceModel>>(_leaseService.GetInsuranceByLeaseId(leaseId));

return new JsonResult(insuranceModels);
}
#endregion
}
}
Loading

0 comments on commit 7ffc542

Please sign in to comment.