Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UAT Release - IS55 #3283

Merged
merged 104 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
e8e7af7
Bump dev version to IS55 (#3204)
asanchezr May 25, 2023
be1fabb
CI: Bump version to v3.2.0-55.1
github-actions[bot] May 25, 2023
aeca58c
IS-55.00 Database Schema (#3206)
dfilteau May 29, 2023
94fc271
CI: Bump version to v3.2.0-55.2
github-actions[bot] May 29, 2023
d38ae6c
Generated scaffold for s55 (#3207)
FuriousLlama May 30, 2023
9177317
CI: Bump version to v3.2.0-55.3
github-actions[bot] May 30, 2023
fe2b897
IS-55.00 Regenerated Schema (#3209)
dfilteau May 31, 2023
3db7e03
CI: Bump version to v3.2.0-55.4
github-actions[bot] May 31, 2023
1d5b466
Fixed quotes on default value (#3212)
FuriousLlama May 31, 2023
9a26c27
CI: Bump version to v3.2.0-55.5
github-actions[bot] May 31, 2023
b5b6213
psp-6219 add tooltip for deposit due days button in agreements (#3202)
buddy326 May 31, 2023
9cd3531
CI: Bump version to v3.2.0-55.6
github-actions[bot] May 31, 2023
86d8b9b
Generated scaffold (#3214)
FuriousLlama Jun 1, 2023
1ed7479
CI: Bump version to v3.2.0-55.7
github-actions[bot] Jun 1, 2023
b35b7a9
This constraint is not desireable, it would force a person/organizati…
devinleighsmith Jun 1, 2023
f68fbe1
CI: Bump version to v3.2.0-55.8
github-actions[bot] Jun 1, 2023
ff4043b
PSP-6031 ACQ file: Add Owner Representative (#3210)
asanchezr Jun 1, 2023
f9ca58b
CI: Bump version to v3.2.0-55.9
github-actions[bot] Jun 1, 2023
6eb3c31
psp-6106 modify land act description field in takes to be select (#3213)
buddy326 Jun 2, 2023
2a41363
CI: Bump version to v3.2.0-55.10
github-actions[bot] Jun 2, 2023
4a43977
psp-6220 fix the order of improvements view form (#3185)
buddy326 Jun 2, 2023
1d685b7
CI: Bump version to v3.2.0-55.11
github-actions[bot] Jun 2, 2023
ce826e7
PSP-6276-Changes on Term forms - GST Radio buttons labels (#3218)
stairaku Jun 5, 2023
2611857
CI: Bump version to v3.2.0-55.12
github-actions[bot] Jun 5, 2023
35e8bfc
Automation - Acquisition File refactoring - adapt data reading from s…
stairaku Jun 5, 2023
f67cee1
CI: Bump version to v3.2.0-55.13
github-actions[bot] Jun 5, 2023
a625bf4
PSP-6017 Ability to read "Electoral District" and "Highway District" …
asanchezr Jun 5, 2023
f508cd6
CI: Bump version to v3.2.0-55.14
github-actions[bot] Jun 5, 2023
ac8f15a
IS-55.00 Redux (#3216)
dfilteau Jun 5, 2023
4e13e95
CI: Bump version to v3.2.0-55.15
github-actions[bot] Jun 5, 2023
bedbe17
Regenerated scaffold (#3222)
FuriousLlama Jun 5, 2023
44c34f2
CI: Bump version to v3.2.0-55.16
github-actions[bot] Jun 5, 2023
85cac8d
Added payee logic and models (#3219)
FuriousLlama Jun 5, 2023
b8622d0
CI: Bump version to v3.2.0-55.17
github-actions[bot] Jun 5, 2023
a679fe7
re-enable mapview snapshot. (#3225)
devinleighsmith Jun 6, 2023
307e5b5
CI: Bump version to v3.2.0-55.18
github-actions[bot] Jun 6, 2023
3063a17
Psp 6084 - interest holders within stakeholder tab (#3221)
devinleighsmith Jun 6, 2023
a8fd046
CI: Bump version to v3.2.0-55.19
github-actions[bot] Jun 6, 2023
2bfa548
PSP-6023 : Add/Edit OWNER Payee to Create/Edit H120 (Compensation Req…
eddherrera Jun 6, 2023
6994c35
CI: Bump version to v3.2.0-55.20
github-actions[bot] Jun 6, 2023
8bd52ab
update pims user script, add all regions to devs by default, also mak…
devinleighsmith Jun 6, 2023
413adb1
CI: Bump version to v3.2.0-55.21
github-actions[bot] Jun 6, 2023
dee6158
Merge remote-tracking branch 'upstream/test' into backmerge_test_to_dev
asanchezr Jun 6, 2023
9c31850
Merge pull request #3230 from asanchezr/backmerge_test_to_dev
asanchezr Jun 6, 2023
4683121
CI: Bump version to v3.2.0-55.22
github-actions[bot] Jun 6, 2023
6c7c5a4
PSP-6279 Add a tooltip to the Compensation tab for "Total Payment" (#…
asanchezr Jun 7, 2023
41889c0
CI: Bump version to v3.2.0-55.23
github-actions[bot] Jun 7, 2023
e829a53
Added interest holders to the payee options (#3231)
FuriousLlama Jun 7, 2023
c140880
CI: Bump version to v3.2.0-55.24
github-actions[bot] Jun 7, 2023
5e5cf8b
PSP-5952 : View H120 Details (Compensation Requisition) (#3232)
eddherrera Jun 8, 2023
93b3f8f
CI: Bump version to v3.2.0-55.25
github-actions[bot] Jun 8, 2023
1781ce2
Psp 5908 - generation for interest holders (#3226)
devinleighsmith Jun 8, 2023
96eab33
CI: Bump version to v3.2.0-55.26
github-actions[bot] Jun 8, 2023
18c5f87
psp-4425 remove this TODO in backend (#3237)
buddy326 Jun 8, 2023
df53df1
CI: Bump version to v3.2.0-55.27
github-actions[bot] Jun 8, 2023
a37eda8
psp-6259 make 'days' tag bold next to due no later than field (#3235)
buddy326 Jun 8, 2023
c5bf835
CI: Bump version to v3.2.0-55.28
github-actions[bot] Jun 8, 2023
97cb559
Merge remote-tracking branch 'upstream/dev' into release/is55_test
asanchezr Jun 8, 2023
1afcd42
Merge pull request #3238 from bcgov/release/is55_test
asanchezr Jun 8, 2023
16d7b32
CI: Bump version to v3.2.0-55.29
github-actions[bot] Jun 8, 2023
0211d1b
Merge remote-tracking branch 'upstream/master' into backmerge_master_…
asanchezr Jun 9, 2023
b66833a
Merge pull request #3243 from asanchezr/backmerge_master_to_test
asanchezr Jun 9, 2023
21e049e
CI: Bump version to v3.2.0-55.30
invalid-email-address Jun 9, 2023
d5538f0
Proper git config for a github-actions bot (#3244)
asanchezr Jun 9, 2023
d544cd3
CI: Bump version to v3.2.0-55.31
github-actions[bot] Jun 9, 2023
e4dfab2
Set All Users to Ministry Staff (#3248)
dfilteau Jun 14, 2023
544d2e6
CI: Bump version to v3.2.0-55.32
github-actions[bot] Jun 14, 2023
4d488ea
correct typings of string values in report. (#3254)
devinleighsmith Jun 15, 2023
0df0607
CI: Bump version to v3.2.0-55.33
github-actions[bot] Jun 15, 2023
e9600f2
PSP-6393 Add missing mapping for comments (#3257)
asanchezr Jun 15, 2023
38dd0bd
CI: Bump version to v3.2.0-55.34
github-actions[bot] Jun 15, 2023
fc040ec
h120 development-only option removed from sidebar. (#3255)
devinleighsmith Jun 16, 2023
a3beeed
CI: Bump version to v3.2.0-55.35
github-actions[bot] Jun 16, 2023
8b7be02
Psp 6382 fixes for payee related npe's on backend/frontend. (#3260)
devinleighsmith Jun 16, 2023
28ec64d
CI: Bump version to v3.2.0-55.36
github-actions[bot] Jun 16, 2023
77ca473
Psp 6404, psp-6152 (#3258)
devinleighsmith Jun 16, 2023
bfec34f
CI: Bump version to v3.2.0-55.37
github-actions[bot] Jun 16, 2023
e7bc9b7
psp-6365 fix display issues with organization based solicitors. (#3261)
devinleighsmith Jun 16, 2023
cf8a6c9
CI: Bump version to v3.2.0-55.38
github-actions[bot] Jun 16, 2023
2d8338c
Psp 6410 (#3264)
devinleighsmith Jun 20, 2023
8b2bdb2
CI: Bump version to v3.2.0-55.39
github-actions[bot] Jun 20, 2023
79981da
psp-6386 allow interest holders to be deleted. (#3262)
devinleighsmith Jun 20, 2023
67bb097
CI: Bump version to v3.2.0-55.40
github-actions[bot] Jun 20, 2023
dfd5f36
PSP-6364 : FT: H120 Payee List - Owner Solicitor, when selected as a …
eddherrera Jun 20, 2023
ed7ac03
CI: Bump version to v3.2.0-55.41
github-actions[bot] Jun 20, 2023
e486c1b
PSP-6422 : Not possible to save compensation requisition that has a p…
eddherrera Jun 20, 2023
00923b8
CI: Bump version to v3.2.0-55.42
github-actions[bot] Jun 20, 2023
6484059
ensure that interest holder organizations display correctly in payee …
devinleighsmith Jun 20, 2023
adc90dd
CI: Bump version to v3.2.0-55.43
github-actions[bot] Jun 20, 2023
b55727b
Set Lease Payment Status (#3256)
dfilteau Jun 21, 2023
73a8f8e
CI: Bump version to v3.2.0-55.44
github-actions[bot] Jun 21, 2023
658eda4
PSP-6428 : FT: Compensation requisition - Typo when user wants to era…
eddherrera Jun 21, 2023
7e450a2
CI: Bump version to v3.2.0-55.45
github-actions[bot] Jun 21, 2023
9d9ccbf
PSP-6422 : Not possible to save compensation requisition that has a p…
eddherrera Jun 21, 2023
d5b75a7
CI: Bump version to v3.2.0-55.46
github-actions[bot] Jun 21, 2023
db94acc
psp-6227: fix leases filtering for tenant names (#3272)
buddy326 Jun 21, 2023
bb41255
CI: Bump version to v3.2.0-55.47
github-actions[bot] Jun 21, 2023
7ce3b5b
psp-6263 display 'missing fields required' message in edit mode (#3277)
buddy326 Jun 21, 2023
a96951b
CI: Bump version to v3.2.0-55.48
github-actions[bot] Jun 21, 2023
8f47736
remove 0 padding trim. (#3278)
devinleighsmith Jun 21, 2023
d0fe386
CI: Bump version to v3.2.0-55.49
github-actions[bot] Jun 21, 2023
8b24750
Psp 6429 agreement commencement date hide on non-h0074 on view screen…
devinleighsmith Jun 21, 2023
504acf7
CI: Bump version to v3.2.0-55.50
github-actions[bot] Jun 21, 2023
570ea27
Merge remote-tracking branch 'upstream/test' into release/is55_uat
asanchezr Jun 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:

- name: Setup git
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Create release
id: create_release
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:

- name: Setup git
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Check release version
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:

- name: Setup git
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Bump version number
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Areas.CompensationRequisition.Controllers;
using Pims.Api.Models;
using Pims.Api.Models.Concepts;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Extensions;
using Pims.Core.Json;
using Pims.Dal.Exceptions;
using Pims.Dal.Entities;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;

Expand Down Expand Up @@ -117,6 +117,7 @@
[HasPermission(Permissions.AcquisitionFileEdit)]
[Produces("application/json")]
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[ProducesResponseType(typeof(ErrorResponseModel), 409)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
public IActionResult UpdateAcquisitionFile(long id, [FromBody] AcquisitionFileModel model, [FromQuery] string[] userOverrideCodes)
{
Expand Down Expand Up @@ -182,6 +183,38 @@
return new JsonResult(_mapper.Map<IEnumerable<AcquisitionFileOwnerModel>>(owners));
}

/// <summary>
/// Get the acquisition file Owner representatives.
/// </summary>
/// <returns></returns>
[HttpGet("{id:long}/owner-representatives")]
[HasPermission(Permissions.AcquisitionFileView)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileOwnerRepresentativeModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
public IActionResult GetAcquisitionFileOwnerRepresentatives([FromRoute] long id)
{
var owners = _acquisitionService.GetOwnerRepresentatives(id);

Check warning on line 197 in source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs#L196-L197

Added lines #L196 - L197 were not covered by tests

return new JsonResult(_mapper.Map<IEnumerable<AcquisitionFileOwnerRepresentativeModel>>(owners));
}

Check warning on line 200 in source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs#L199-L200

Added lines #L199 - L200 were not covered by tests

/// <summary>
/// Get the acquisition file Owner solicitors.
/// </summary>
/// <returns></returns>
[HttpGet("{id:long}/owner-solicitors")]
[HasPermission(Permissions.AcquisitionFileView)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileOwnerSolicitorModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
public IActionResult GetAcquisitionFileOwnerSolicitors([FromRoute] long id)
{
var owners = _acquisitionService.GetOwnerSolicitors(id);

Check warning on line 213 in source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs#L212-L213

Added lines #L212 - L213 were not covered by tests

return new JsonResult(_mapper.Map<IEnumerable<AcquisitionFileOwnerSolicitorModel>>(owners));
}

Check warning on line 216 in source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs#L215-L216

Added lines #L215 - L216 were not covered by tests

/// <summary>
/// Get all the compensations corresponding to the passed file id.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System.Collections.Generic;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models;
using Pims.Api.Models.Concepts;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Json;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;

namespace Pims.Api.Areas.Acquisition.Controllers
{
/// <summary>
/// InterestHolderController class, provides endpoints for interacting with acquisition file InterestHolders.
/// </summary>
[Authorize]
[ApiController]
[ApiVersion("1.0")]
[Area("acquisitionfiles")]
[Route("v{version:apiVersion}/[area]")]
[Route("[area]")]
public class InterestHolderController : ControllerBase
{
#region Variables
private readonly IAcquisitionFileService _acquisitionService;
private readonly IMapper _mapper;
#endregion

#region Constructors

/// <summary>
/// Creates a new instance of a InterestHolderController class, initializes it with the specified arguments.
/// </summary>
/// <param name="acquisitionService"></param>
/// <param name="mapper"></param>
///
public InterestHolderController(IAcquisitionFileService acquisitionService, IMapper mapper)
{
_acquisitionService = acquisitionService;
_mapper = mapper;
}
#endregion

#region Endpoints

/// <summary>
/// Get the acquisition file InterestHolders.
/// </summary>
/// <returns>The interest holder items.</returns>
[HttpGet("{id:long}/interestholders")]
[HasPermission(Permissions.AcquisitionFileView)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<InterestHolderModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFileInterestHolders([FromRoute] long id)
{
var interestHolders = _acquisitionService.GetInterestHolders(id);
return new JsonResult(_mapper.Map<List<Api.Models.Concepts.InterestHolderModel>>(interestHolders));
}

/// <summary>
/// Update the acquisition file InterestHolders.
/// </summary>
/// <returns>The updated interest holder items.</returns>
[HttpPut("{id:long}/interestholders")]
[HasPermission(Permissions.AcquisitionFileView)]
[Produces("application/json")]
[ProducesResponseType(typeof(InterestHolderModel), 200)]
[ProducesResponseType(typeof(ErrorResponseModel), 409)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateInterestHolderFile([FromRoute] long id, [FromBody] List<InterestHolderModel> interestHolders)
{
var interestHolderEntities = _mapper.Map<List<Dal.Entities.PimsInterestHolder>>(interestHolders);
var updatedInterestHolders = _acquisitionService.UpdateInterestHolders(id, interestHolderEntities);
return new JsonResult(_mapper.Map<List<Dal.Entities.PimsInterestHolder>>(updatedInterestHolders));
}

#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Helpers.Exceptions;
using Pims.Api.Models.Concepts;
using Pims.Api.Policies;
using Pims.Api.Services;
Expand Down Expand Up @@ -45,7 +46,7 @@
[Produces("application/json")]
[ProducesResponseType(typeof(CompensationRequisitionModel), 200)]
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
public IActionResult GetCompensationRequisitionById([FromRoute]long id)
public IActionResult GetCompensationRequisitionById([FromRoute] long id)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
Expand All @@ -65,7 +66,7 @@
[Produces("application/json")]
[ProducesResponseType(typeof(CompensationRequisitionModel), 200)]
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
public IActionResult UpdateCompensationRequisition([FromRoute]long id, [FromBody]CompensationRequisitionModel compensationRequisition)
public IActionResult UpdateCompensationRequisition([FromRoute] long id, [FromBody] CompensationRequisitionModel compensationRequisition)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
Expand All @@ -75,8 +76,13 @@
DateTime.Now);
_logger.LogInformation("Dispatching to service: {Service}", _compensationRequisitionService.GetType());

if (id != compensationRequisition.Id)
{
throw new BadRequestException("Invalid compensationRequisitionId.");

Check warning on line 81 in source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs#L80-L81

Added lines #L80 - L81 were not covered by tests
}

var compensationReqEntity = _mapper.Map<Dal.Entities.PimsCompensationRequisition>(compensationRequisition);
var compensation = _compensationRequisitionService.Update(id, compensationReqEntity);
var compensation = _compensationRequisitionService.Update(compensationReqEntity);

Check warning on line 85 in source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs#L85

Added line #L85 was not covered by tests

return new JsonResult(_mapper.Map<CompensationRequisitionModel>(compensation));
}
Expand All @@ -92,10 +98,35 @@
[ProducesResponseType(typeof(bool), 200)]
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult DeleteCompensation([FromRoute]long id)
public IActionResult DeleteCompensation([FromRoute] long id)
{
var result = _compensationRequisitionService.DeleteCompensation(id);
return new JsonResult(result);
}

/// <summary>
/// Get the payee for a compensation requisition.
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("{id:long}/payee")]
[HasPermission(Permissions.CompensationRequisitionView)]
[Produces("application/json")]
[ProducesResponseType(typeof(CompensationPayeeModel), 200)]
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
public IActionResult GetCompensationRequisitionPayee([FromRoute] long id)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(CompensationRequisitionController),
nameof(GetCompensationRequisitionPayee),
User.GetUsername(),
DateTime.Now);
_logger.LogInformation("Dispatching to service: {Service}", _compensationRequisitionService.GetType());

Check warning on line 125 in source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs#L118-L125

Added lines #L118 - L125 were not covered by tests

var compensationPayee = _compensationRequisitionService.GetPayeeByCompensationId(id);

Check warning on line 127 in source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs#L127

Added line #L127 was not covered by tests

return new JsonResult(_mapper.Map<CompensationPayeeModel>(compensationPayee));
}

Check warning on line 130 in source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/CompensationRequisition/Controllers/CompensationRequisitionController.cs#L129-L130

Added lines #L129 - L130 were not covered by tests
}
}
56 changes: 56 additions & 0 deletions source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,62 @@
{
return new JsonResult(_financialCodeService.GetFinancialCodesByType(type));
}

/// <summary>
/// Gets financial Activity Type Codes.
/// </summary>
/// <returns>An array with financial activity types codes.</returns>
[HttpGet("financial-activities")]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<FinancialCodeModel>), 200)]
[ProducesResponseType(typeof(Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "financialcodes" })]
public IActionResult GetFinancialActivityCodes()
{
return new JsonResult(_financialCodeService.GetFinancialCodesByType(FinancialCodeTypes.FinancialActivity));
}

Check warning on line 67 in source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs#L65-L67

Added lines #L65 - L67 were not covered by tests

/// <summary>
/// Gets Chart of Acccounts Type Codes.
/// </summary>
/// <returns>An array with chart of accounts types codes.</returns>
[HttpGet("chart-accounts")]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<FinancialCodeModel>), 200)]
[ProducesResponseType(typeof(Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "financialcodes" })]
public IActionResult GetChartOfAccounts()
{
return new JsonResult(_financialCodeService.GetFinancialCodesByType(FinancialCodeTypes.ChartOfAccounts));
}

Check warning on line 81 in source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs#L79-L81

Added lines #L79 - L81 were not covered by tests

/// <summary>
/// Gets Responsibility Type Codes.
/// </summary>
/// <returns>An array with Responsibility types codes.</returns>
[HttpGet("responsibilities")]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<FinancialCodeModel>), 200)]
[ProducesResponseType(typeof(Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "financialcodes" })]
public IActionResult GetResponsibilities()
{
return new JsonResult(_financialCodeService.GetFinancialCodesByType(FinancialCodeTypes.Responsibility));
}

Check warning on line 95 in source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs#L93-L95

Added lines #L93 - L95 were not covered by tests

/// <summary>
/// Gets Yearly Financials Type Codes.
/// </summary>
/// <returns>An array with yearly financials types codes.</returns>
[HttpGet("yearly-financials")]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<FinancialCodeModel>), 200)]
[ProducesResponseType(typeof(Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "financialcodes" })]
public IActionResult GetYearlyFinancials()
{
return new JsonResult(_financialCodeService.GetFinancialCodesByType(FinancialCodeTypes.YearlyFinancial));
}

Check warning on line 109 in source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/FinancialCodes/FinancialCodeController.cs#L107-L109

Added lines #L107 - L109 were not covered by tests
#endregion
}
}
4 changes: 4 additions & 0 deletions source/backend/api/Controllers/LookupController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ public IActionResult GetAll()
var takeTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllTakeTypes());
var takeStatusTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllTakeStatusTypes());
var takeSiteContamTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllTakeSiteContamTypes());
var landActTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllLandActTypes());
var acqChecklistSectionTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionChecklistSectionTypes());
var acqChecklistItemStatusTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAcquisitionChecklistItemStatusTypes());
var agreementTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllAgreementTypes());
var interestHolderTypes = _mapper.Map<Model.LookupModel[]>(_lookupRepository.GetAllInterestHolderTypes());

var codes = new List<object>();
codes.AddRange(areaUnitTypes);
Expand Down Expand Up @@ -197,9 +199,11 @@ public IActionResult GetAll()
codes.AddRange(takeTypes);
codes.AddRange(takeStatusTypes);
codes.AddRange(takeSiteContamTypes);
codes.AddRange(landActTypes);
codes.AddRange(acqChecklistSectionTypes);
codes.AddRange(acqChecklistItemStatusTypes);
codes.AddRange(agreementTypes);
codes.AddRange(interestHolderTypes);

var response = new JsonResult(codes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ private async Task HandleExceptionAsync(HttpContext context, Exception ex)

_logger.LogError(ex, "User override required to complete this action.");
}
else if (ex is ForeignKeyDependencyException)
{
var exception = ex as ForeignKeyDependencyException;
code = HttpStatusCode.Conflict;
message = exception.Message;
errorCode = null;

_logger.LogError(ex, "User deleting a foreign key dependency");
}
else if (ex is ApiHttpRequestException)
{
var exception = ex as ApiHttpRequestException;
Expand Down
28 changes: 28 additions & 0 deletions source/backend/api/Mapping/Lookup/LookupMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,34 @@ public void Register(TypeAdapterConfig config)
.Map(dest => dest.Name, src => src.DistrictName)
.Map(dest => dest.IsDisabled, src => src.IsDisabled)
.Map(dest => dest.Type, src => src.GetType().Name);

config.NewConfig<Entity.PimsFinancialActivityCode, Model.LookupModel>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.Code, src => src.Code)
.Map(dest => dest.Name, src => src.Description)
.Map(dest => dest.IsDisabled, src => src.IsDisabled)
.Map(dest => dest.Type, src => src.GetType().Name);

config.NewConfig<Entity.PimsChartOfAccountsCode, Model.LookupModel>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.Code, src => src.Code)
.Map(dest => dest.Name, src => src.Description)
.Map(dest => dest.IsDisabled, src => src.IsDisabled)
.Map(dest => dest.Type, src => src.GetType().Name);

config.NewConfig<Entity.PimsResponsibilityCode, Model.LookupModel>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.Code, src => src.Code)
.Map(dest => dest.Name, src => src.Description)
.Map(dest => dest.IsDisabled, src => src.IsDisabled)
.Map(dest => dest.Type, src => src.GetType().Name);

config.NewConfig<Entity.PimsYearlyFinancialCode, Model.LookupModel>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.Code, src => src.Code)
.Map(dest => dest.Name, src => src.Description)
.Map(dest => dest.IsDisabled, src => src.IsDisabled)
.Map(dest => dest.Type, src => src.GetType().Name);
}
}
}
Loading
Loading