Skip to content

Commit

Permalink
TEST Release - IS57 (#3312)
Browse files Browse the repository at this point in the history
* Automation test - Stabilization of some automated features (#3285)

* Automation Projects

* Automation - Projects and Products automation

* Leases refactoring

* Leases refactoring

* Acquisition Files refactoring

* Automation fixes

* Automation - stabilization of some automation features

---------

Co-authored-by: devinleighsmith <41091511+devinleighsmith@users.noreply.github.com>

* PSP-5111

* CI: Bump version to v3.2.0-56.18

* CI: Bump version to v3.2.0-56.19

* PSP-6286 : Restrict changing final compensation requisition status back to draft (#3281)

---------

Co-authored-by: Eduardo Herrera <Eduardo.Herrera@quartech.com>

* CI: Bump version to v3.2.0-56.20

* PSP-5715 : Sec3/Sec6 add forms to acquisition file (#3292)


Co-authored-by: Eduardo Herrera <Eduardo.Herrera@quartech.com>

* CI: Bump version to v3.2.0-56.21

* Psp 6322 - lease and license refactor (#3253)

* psp-6322 lease refactor.

* merge corrections.

* lint corrections.

* code review updates.

* merge corrections.

* test corrections.

* CI: Bump version to v3.2.0-56.22

* psp-5361: fix link name for financial codes in admin tools (#3291)

* CI: Bump version to v3.2.0-56.23

* Bump DEV version - IS57 (#3295)

* CI: Bump version to v3.2.0-57.1

* PSP-5951 refactor left hand file navigation - Acquisition ONLY (#3288)

* Update useQuery global hook

* Update shared tabbed forms

* Refactor property tabs to work with state OR routing

* Refactor acquisition left hand navigation to use routing

* Remove setContainerState callback from acquisition forms

* Test corrections

* Improve tab names for properties

* Set header title based on current tab route

* Fix routing issue with requisition compensations

* Update snapshots

* Fix failing tests

* Fix bug when removing property from File

* Add tests for routing in Acquisition View

* Redirect to default tabs when editing and path doesn't match

* Test corrections

* Fix dereference error when accessing non-existing property index

* Remove unused code

* Move router components to router folder

* Test corrections

* CI: Bump version to v3.2.0-57.2

* psp-5791: add assignee to tenant types (#3290)

* CI: Bump version to v3.2.0-57.3

* psp-6246 increase keycloak sync resiliancy via polly, also update deprecated calls from keycloak api. (#3294)

* CI: Bump version to v3.2.0-57.4

* PSP-5716, PSP-5717, PSP-5719: Expropriation forms 1, 5 and 9 (#3303)

* WIP

* Code refactor to accommodate expropriation forms

* Fix styling for ContactPicker

* WIP - Expr Form1

* ContactInputView fixes

* Refactor interest holder property table into generic file property table

* Expropriation Form1 - WIP

* Create generic wrapper around form items to provide validation error feedback

* Add impacted properties table to Expropriation Form 1

* Update snapshots

* Add remaining expropriation forms

* Make forms more testable

* Unit tests

* CI: Bump version to v3.2.0-57.5

* psp-5860 limit lease and license access by region. (#3298)

* psp-5860 limit lease and license access by region.

* PR updates.

* lint fixes.

* fix null vs undefined on project display.

* correct null vs undefined at model level.

* removed dead code.

* CI: Bump version to v3.2.0-57.6

* psp-6428 fix layers colors (#3304)

Co-authored-by: devinleighsmith <41091511+devinleighsmith@users.noreply.github.com>
Co-authored-by: Alejandro Sanchez <emailforasr@gmail.com>

* CI: Bump version to v3.2.0-57.7

* Merge fixes

* CI: Bump version to v4.0.0-57.8

---------

Co-authored-by: Sue Tairaku <42981334+stairaku@users.noreply.github.com>
Co-authored-by: devinleighsmith <41091511+devinleighsmith@users.noreply.github.com>
Co-authored-by: PryancaJSharma <99448336+PryancaJSharma@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Eduardo <eddherrera@users.noreply.github.com>
Co-authored-by: Eduardo Herrera <Eduardo.Herrera@quartech.com>
Co-authored-by: Aman Monga <53246811+buddy326@users.noreply.github.com>
  • Loading branch information
8 people authored Jul 6, 2023
1 parent 99a7e21 commit f06ead2
Show file tree
Hide file tree
Showing 407 changed files with 14,539 additions and 12,128 deletions.
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

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
}
}
51 changes: 33 additions & 18 deletions source/backend/api/Areas/Leases/Controllers/LeaseController.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Extensions;
using Pims.Core.Json;
using Pims.Dal.Exceptions;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
Expand All @@ -25,6 +29,7 @@ public class LeaseController : ControllerBase
#region Variables
private readonly ILeaseService _leaseService;
private readonly IMapper _mapper;
private readonly ILogger<LeaseController> _logger;
#endregion

#region Constructors
Expand All @@ -34,11 +39,13 @@ public class LeaseController : ControllerBase
/// </summary>
/// <param name="leaseService"></param>
/// <param name="mapper"></param>
/// <param name="logger"></param>
///
public LeaseController(ILeaseService leaseService, IMapper mapper)
public LeaseController(ILeaseService leaseService, IMapper mapper, ILogger<LeaseController> logger)
{
_mapper = mapper;
_leaseService = leaseService;
_logger = logger;
}
#endregion

Expand All @@ -51,26 +58,18 @@ public LeaseController(ILeaseService leaseService, IMapper mapper)
[HttpGet("{id:long}")]
[HasPermission(Permissions.LeaseView)]
[Produces("application/json")]
[ProducesResponseType(typeof(Models.Lease.LeaseModel), 200)]
[ProducesResponseType(typeof(IEnumerable<Api.Models.Concepts.LeaseModel>), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetLease(int id)
{
var lease = _leaseService.GetById(id);
var mapped = _mapper.Map<Models.Lease.LeaseModel>(lease);
return new JsonResult(mapped);
}
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(LeaseController),
nameof(GetLease),
User.GetUsername(),
DateTime.Now);

/// <summary>
/// Get the lease for the specified primary key 'id'.
/// </summary>
/// <returns></returns>
[HttpGet("concept/{id:long}")]
[HasPermission(Permissions.LeaseView)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<Api.Models.Concepts.LeaseModel>), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
public IActionResult GetLeaseConcept(int id)
{
var lease = _leaseService.GetById(id);
var mapped = _mapper.Map<Api.Models.Concepts.LeaseModel>(lease);
return new JsonResult(mapped);
Expand All @@ -83,10 +82,18 @@ public IActionResult GetLeaseConcept(int id)
[HttpPost]
[HasPermission(Permissions.LeaseAdd)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<Models.Lease.LeaseModel>), 200)]
[ProducesResponseType(typeof(IEnumerable<Api.Models.Concepts.LeaseModel>), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddLease(Api.Models.Concepts.LeaseModel leaseModel, [FromQuery] string[] userOverrideCodes)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(LeaseController),
nameof(AddLease),
User.GetUsername(),
DateTime.Now);

var leaseEntity = _mapper.Map<Pims.Dal.Entities.PimsLease>(leaseModel);
var userOverrides = userOverrideCodes.Select(x => UserOverrideCode.Parse(x));
var lease = _leaseService.Add(leaseEntity, userOverrides);
Expand All @@ -103,8 +110,16 @@ public IActionResult AddLease(Api.Models.Concepts.LeaseModel leaseModel, [FromQu
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<Api.Models.Concepts.LeaseModel>), 200)]
[SwaggerOperation(Tags = new[] { "lease" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateLease(Api.Models.Concepts.LeaseModel leaseModel, [FromQuery] string[] userOverrideCodes)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(LeaseController),
nameof(UpdateLease),
User.GetUsername(),
DateTime.Now);

var leaseEntity = _mapper.Map<Pims.Dal.Entities.PimsLease>(leaseModel);
var userOverrides = userOverrideCodes.Select(x => UserOverrideCode.Parse(x));
var updatedLease = _leaseService.Update(leaseEntity, userOverrides);
Expand Down
Loading

0 comments on commit f06ead2

Please sign in to comment.