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

Tech debt| use new api files and null enhancements #3739

Merged
merged 83 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
997bb80
Refactoring of modals and changes on Smoke Test Automation Test Cases
stairaku Dec 6, 2023
3b96319
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Dec 6, 2023
6fdc19b
Merge branch 'dev' into automation-branch
stairaku Dec 7, 2023
a192ae2
Merge branch 'dev' into automation-branch
stairaku Dec 11, 2023
2ef6db3
Merge branch 'dev' into automation-branch
asanchezr Dec 13, 2023
b216dbc
Merge branch 'bcgov:dev' into automation-branch
stairaku Jan 3, 2024
c7ed43e
Automation refactoring - modals, updating fields on Compensation, Dig…
stairaku Jan 3, 2024
fcd9779
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Jan 3, 2024
07b5e0d
Merge branch 'dev' into automation-branch
stairaku Jan 3, 2024
7a29555
Merge branch 'bcgov:dev' into automation-branch
stairaku Jan 9, 2024
c1133ea
Refactoring modals
stairaku Jan 9, 2024
5fc6f86
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Jan 9, 2024
9d46d19
Merge branch 'bcgov:dev' into automation-branch
stairaku Jan 10, 2024
18c55e9
Automation refactoring - modals, updating fields on Compensation, Dig…
stairaku Jan 3, 2024
8a4635a
Refactoring modals
stairaku Jan 9, 2024
dbf4408
Merge branch 'bcgov:dev' into automation-branch
stairaku Jan 15, 2024
ed434d0
Automation updates
stairaku Jan 16, 2024
919bacb
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Jan 16, 2024
31a27e4
Automation updates
stairaku Jan 16, 2024
b6a51d2
Contacts elements update
stairaku Jan 16, 2024
f439706
Merge branch 'bcgov:dev' into automation-branch
stairaku Jan 16, 2024
4db8bbc
Merge branch 'bcgov:dev' into automation-branch
stairaku Jan 22, 2024
19e0a23
Removal of old frontend api files
FuriousLlama Jan 22, 2024
2e4877f
Improved checklist Api and backend services
FuriousLlama Jan 22, 2024
7f9ff4c
Moved association models to the api project and added code types to b…
FuriousLlama Jan 22, 2024
b221d7b
minor - backend import updates
FuriousLlama Jan 22, 2024
238f4f0
major - fixed backend file models inheritance missalingments
FuriousLlama Jan 22, 2024
716e884
major - fixed lease missing fields and improper inheritance
FuriousLlama Jan 22, 2024
d7f0375
major - fixed backend typos
FuriousLlama Jan 22, 2024
437a6e9
major - utilty method changes
FuriousLlama Jan 22, 2024
e96b29e
minor - updated type references. This commit can be skimed as it shou…
FuriousLlama Jan 23, 2024
395eeee
major - type updates and nullable conversions on form models
FuriousLlama Jan 23, 2024
2c1dfb2
major - type changes with possible logic implications. isValidId chan…
FuriousLlama Jan 23, 2024
053376d
minor - type code alignments and cleanup
FuriousLlama Jan 23, 2024
0b88d46
major - more type changes. Removal of adjacent land form model
FuriousLlama Jan 23, 2024
69969c3
minor - test and mock updates
FuriousLlama Jan 23, 2024
27130f0
generation code changesa
FuriousLlama Jan 23, 2024
80c9bbd
Merge branch 'dev' into tech-debt/use-new-api-files
FuriousLlama Jan 23, 2024
258855a
manual merge
FuriousLlama Jan 23, 2024
fd45a09
minor - added nullable property to controllers that use nullable models
FuriousLlama Jan 24, 2024
7657842
major - lease fixes and removal of adjacent land code
FuriousLlama Jan 25, 2024
5a60d8b
major - improved handling and validation of ID related values and dat…
FuriousLlama Jan 25, 2024
69b7f0e
major - test updates and regenerated snaps
FuriousLlama Jan 25, 2024
f84fb4d
major - lease fixes around address
FuriousLlama Jan 25, 2024
1bbf98b
minor - workspace change to force vscode to use the ts compiler speci…
FuriousLlama Jan 25, 2024
b49172c
major - fixed backend references and cyclical parsing due to the file…
FuriousLlama Jan 26, 2024
9edd618
major - fixed disposition
FuriousLlama Jan 26, 2024
5ff19a9
PSP-7509 : Allow Contractor to Create or Edit Disposition File (#3735)
eddherrera Jan 26, 2024
6aca687
CI: Bump version to v5.0.0-72.14
github-actions[bot] Jan 26, 2024
453fdbf
Merge branch 'bcgov:dev' into automation-branch
stairaku Jan 26, 2024
47c3128
Disposition File details, documents and notes. Refactoring on File Pr…
stairaku Jan 26, 2024
cb2653c
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Jan 26, 2024
7d6720e
PSP-7510 : Disallow Contractor to Remove Themself from Disposition Fi…
eddherrera Jan 26, 2024
868b19b
CI: Bump version to v5.0.0-72.15
github-actions[bot] Jan 26, 2024
b197458
correct disposition list view file number. (#3736)
devinleighsmith Jan 27, 2024
8756e7d
CI: Bump version to v5.0.0-72.16
github-actions[bot] Jan 27, 2024
99a6596
Offers and sales tab automation
pravkuma14 Jan 27, 2024
78d73f5
updated with remote changes
pravkuma14 Jan 27, 2024
ff337fa
Merge branch 'bcgov:dev' into automation-branch
stairaku Jan 29, 2024
1763118
disposition offers and sales tab
pravkuma14 Jan 29, 2024
3374099
Psp 7614, 7657, 7626, 7610 assorted text corrections. (#3737)
devinleighsmith Jan 29, 2024
bba7bd8
CI: Bump version to v5.0.0-72.17
github-actions[bot] Jan 29, 2024
5735399
Merge branch 'dev' into Checklist_Offerstab
stairaku Jan 29, 2024
e455642
Merge pull request #3748 from pravkuma14/Checklist_Offerstab
pravkuma14 Jan 29, 2024
bb0f072
CI: Bump version to v5.0.0-72.18
github-actions[bot] Jan 29, 2024
c77a927
Refactoring and Disposition file automation
stairaku Jan 29, 2024
bb293cc
Merge branch 'automation-branch' of https://github.com/stairaku/PSP i…
stairaku Jan 29, 2024
f7a6637
Merge branch 'dev' of https://github.com/bcgov/PSP into automation-br…
stairaku Jan 29, 2024
4819ee8
Merge conflicts between local and remote
stairaku Jan 29, 2024
2b43c39
Disposition files - Offers and sale create and update
stairaku Jan 30, 2024
64e8d6b
Deleting AcquisitionProperties class, replaced by SharedFileProperties
stairaku Jan 30, 2024
1306480
Text changes (#3752)
asanchezr Jan 30, 2024
4e2e969
CI: Bump version to v5.0.0-72.19
github-actions[bot] Jan 30, 2024
0639b54
correct message text. (#3749)
devinleighsmith Jan 30, 2024
7f9e9ca
CI: Bump version to v5.0.0-72.20
github-actions[bot] Jan 30, 2024
104ef10
Refactoring LeaseTenants class
stairaku Jan 30, 2024
fd2833f
Merge branch 'dev' into automation-branch
stairaku Jan 30, 2024
da29ee5
Merge pull request #3754 from stairaku/automation-branch
stairaku Jan 30, 2024
24f9dd1
CI: Bump version to v5.0.0-72.21
github-actions[bot] Jan 30, 2024
d7ee78d
Merge branch '5.1' into tech-debt/use-new-api-files
FuriousLlama Jan 31, 2024
be98afd
Manual merge fixes
FuriousLlama Jan 31, 2024
b1b4793
Addressed pr comments
FuriousLlama Jan 31, 2024
aaec0dc
fixed date formatting
FuriousLlama Jan 31, 2024
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
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public AcquisitionFileController(IAcquisitionFileService acquisitionService, ICo
[Produces("application/json")]
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFile(long id)
{
// RECOMMENDED - Add valuable metadata to logs
Expand Down Expand Up @@ -109,6 +110,7 @@ public IActionResult GetLastUpdatedBy(long id)
[Produces("application/json")]
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddAcquisitionFile([FromBody] AcquisitionFileModel model, [FromQuery] string[] userOverrideCodes)
{
_logger.LogInformation(
Expand Down Expand Up @@ -136,6 +138,7 @@ public IActionResult AddAcquisitionFile([FromBody] AcquisitionFileModel model, [
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[ProducesResponseType(typeof(ErrorResponseModel), 409)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateAcquisitionFile(long id, [FromBody] AcquisitionFileModel model, [FromQuery] string[] userOverrideCodes)
{
_logger.LogInformation(
Expand All @@ -161,6 +164,7 @@ public IActionResult UpdateAcquisitionFile(long id, [FromBody] AcquisitionFileMo
[Produces("application/json")]
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateAcquisitionFileProperties([FromBody] AcquisitionFileModel acquisitionFileModel, [FromQuery] string[] userOverrideCodes)
{
var acquisitionFileEntity = _mapper.Map<Dal.Entities.PimsAcquisitionFile>(acquisitionFileModel);
Expand All @@ -177,6 +181,7 @@ public IActionResult UpdateAcquisitionFileProperties([FromBody] AcquisitionFileM
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<AcquisitionFilePropertyModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFileProperties(long id)
{
var acquisitionFileProperties = _acquisitionService.GetProperties(id);
Expand All @@ -193,6 +198,7 @@ public IActionResult GetAcquisitionFileProperties(long id)
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileOwnerModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFileOwners([FromRoute] long id)
{
var owners = _acquisitionService.GetOwners(id);
Expand All @@ -210,6 +216,7 @@ public IActionResult GetAcquisitionFileOwners([FromRoute] long id)
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileTeamModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionTeamMembers()
{
var team = _acquisitionService.GetTeamMembers();
Expand Down Expand Up @@ -243,6 +250,7 @@ public IActionResult GetFileCompensations(long id)
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<CompensationFinancialModel>), 200)]
[SwaggerOperation(Tags = new[] { "comp-req-h120s" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetFileCompReqH120(long id, bool? finalOnly)
{
_logger.LogInformation(
Expand All @@ -269,6 +277,7 @@ public IActionResult GetFileCompReqH120(long id, bool? finalOnly)
[Produces("application/json")]
[ProducesResponseType(typeof(CompensationRequisitionModel), 201)]
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddCompensationRequisition([FromRoute] long id, [FromBody] CompensationRequisitionModel compensationRequisition)
{
_logger.LogInformation(
Expand Down Expand Up @@ -323,6 +332,7 @@ public IActionResult GetAcquisitionFileExpropriationPayments([FromRoute] long id
[Produces("application/json")]
[ProducesResponseType(typeof(ExpropriationPaymentModel), 201)]
[SwaggerOperation(Tags = new[] { "expropriation-payments" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddExpropriationPayment([FromRoute] long id, [FromBody] ExpropriationPaymentModel expropriationPayment)
{
_logger.LogInformation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Pims.Api.Models.Concepts.AcquisitionFile;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Json;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;

Expand Down Expand Up @@ -67,6 +68,7 @@ public IActionResult GetAcquisitionFileAgreements([FromRoute] long id)
[Produces("application/json")]
[ProducesResponseType(typeof(AgreementModel), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateAcquisitionFileAgreements([FromRoute] long id, [FromBody] List<AgreementModel> agreements)
{
var agreementEntities = _mapper.Map<List<Dal.Entities.PimsAgreement>>(agreements);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Helpers.Exceptions;
using Pims.Api.Models.Concepts.AcquisitionFile;
using Pims.Api.Models.Concepts.File;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Json;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;

Expand Down Expand Up @@ -53,6 +55,7 @@ public ChecklistController(IAcquisitionFileService acquisitionService, IMapper m
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<FileChecklistItemModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFileChecklist([FromRoute] long id)
{
var checklist = _acquisitionService.GetChecklistItems(id);
Expand All @@ -63,15 +66,25 @@ public IActionResult GetAcquisitionFileChecklist([FromRoute] long id)
/// Update the acquisition file checklist.
/// </summary>
/// <returns>The updated checklist items.</returns>
[HttpPut("{id:long}/checklist")]
[HttpPut("{acquisitionFileId:long}/checklist")]
[HasPermission(Permissions.AcquisitionFileEdit)]
[Produces("application/json")]
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
public IActionResult UpdateAcquisitionFileChecklist([FromBody] AcquisitionFileModel acquisitionFileModel)
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateAcquisitionFileChecklist(long acquisitionFileId, [FromBody] IList<FileChecklistItemModel> checklistItems)
{
var acquisitionFileEntity = _mapper.Map<Dal.Entities.PimsAcquisitionFile>(acquisitionFileModel);
var acquisitionFile = _acquisitionService.UpdateChecklistItems(acquisitionFileEntity);

foreach (var item in checklistItems)
{
if (item.FileId != acquisitionFileId)
{
throw new BadRequestException("All checklist items file id must match the acquisition file id");
}
}

var checklistItemEntities = _mapper.Map<IList<Dal.Entities.PimsAcquisitionChecklistItem>>(checklistItems);
var acquisitionFile = _acquisitionService.UpdateChecklistItems(checklistItemEntities);
return new JsonResult(_mapper.Map<AcquisitionFileModel>(acquisitionFile));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Pims.Api.Areas.Acquisition.Controllers
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Extensions;
using Pims.Core.Json;
using Pims.Dal.Entities.Models;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
Expand Down Expand Up @@ -66,6 +67,7 @@ public SearchController(IAcquisitionFileService acquisitionService, IMapper mapp
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFiles()
{
var uri = new Uri(this.Request.GetDisplayUrl());
Expand All @@ -83,6 +85,7 @@ public IActionResult GetAcquisitionFiles()
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFiles([FromBody] AcquisitionFilterModel filter)
{
// RECOMMENDED - Add valuable metadata to logs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.AccessRequest;
using Pims.Api.Policies;
using Pims.Core.Json;
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
Expand Down Expand Up @@ -57,6 +58,7 @@ public AccessRequestController(IAccessRequestRepository accessRequestRepository,
[ProducesResponseType(typeof(PageModel<AccessRequestModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-access-requests" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetPage(int page = 1, int quantity = 10, string searchText = null, string sort = null)
{
if (page < 1)
Expand Down Expand Up @@ -94,6 +96,7 @@ public IActionResult GetPage(int page = 1, int quantity = 10, string searchText
[ProducesResponseType(typeof(ErrorResponseModel), 400)]
[ProducesResponseType(typeof(ErrorResponseModel), 403)]
[SwaggerOperation(Tags = new[] { "user" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAccessRequest(long id)
{
var accessRequest = _accessRequestRepository.GetById(id);
Expand All @@ -111,6 +114,7 @@ public IActionResult GetAccessRequest(long id)
[ProducesResponseType(typeof(AccessRequestModel), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-access-requests" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult Delete(long id, [FromBody] AccessRequestModel model)
{
var entity = _mapper.Map<Entity.PimsAccessRequest>(model);
Expand Down
2 changes: 2 additions & 0 deletions source/backend/api/Areas/Admin/Controllers/ClaimController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.Claim;
using Pims.Api.Policies;
using Pims.Core.Json;
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
Expand Down Expand Up @@ -55,6 +56,7 @@ public ClaimController(IClaimRepository claimRepository, IMapper mapper)
[ProducesResponseType(typeof(PageModel<ClaimModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-claim" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetClaims(int page = 1, int quantity = 10, string name = null)
{
if (page < 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Exceptions;
using Pims.Core.Json;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;

Expand Down Expand Up @@ -49,6 +50,7 @@ public FinancialCodeController(IFinancialCodeService financialCodeService)
[ProducesResponseType(typeof(IEnumerable<FinancialCodeModel>), 200)]
[ProducesResponseType(typeof(Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-financialcodes" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetFinancialCodes()
{
var allCodes = _financialCodeService.GetAllFinancialCodes();
Expand All @@ -67,6 +69,7 @@ public IActionResult GetFinancialCodes()
[ProducesResponseType(typeof(Models.ErrorResponseModel), 400)]
[ProducesResponseType(typeof(Models.ErrorResponseModel), 409)]
[SwaggerOperation(Tags = new[] { "admin-financialcodes" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetFinancialCode(FinancialCodeTypes type, long codeId)
{
return new JsonResult(_financialCodeService.GetById(type, codeId));
Expand All @@ -84,6 +87,7 @@ public IActionResult GetFinancialCode(FinancialCodeTypes type, long codeId)
[ProducesResponseType(typeof(Models.ErrorResponseModel), 400)]
[ProducesResponseType(typeof(Models.ErrorResponseModel), 409)]
[SwaggerOperation(Tags = new[] { "admin-financialcodes" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddFinancialCode(FinancialCodeTypes type, [FromBody] FinancialCodeModel codeModel)
{
try
Expand All @@ -110,6 +114,7 @@ public IActionResult AddFinancialCode(FinancialCodeTypes type, [FromBody] Financ
[ProducesResponseType(typeof(Models.ErrorResponseModel), 400)]
[ProducesResponseType(typeof(Models.ErrorResponseModel), 409)]
[SwaggerOperation(Tags = new[] { "admin-financialcodes" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateFinancialCode(FinancialCodeTypes type, long codeId, [FromBody] FinancialCodeModel codeModel)
{
try
Expand Down
3 changes: 3 additions & 0 deletions source/backend/api/Areas/Admin/Controllers/RoleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.Role;
using Pims.Api.Policies;
using Pims.Core.Json;
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
Expand Down Expand Up @@ -55,6 +56,7 @@ public RoleController(IRoleRepository roleRepository, IMapper mapper)
[ProducesResponseType(typeof(PageModel<RoleModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-role" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetRoles(int page = 1, int quantity = 10, string name = null)
{
if (page < 1)
Expand Down Expand Up @@ -87,6 +89,7 @@ public IActionResult GetRoles(int page = 1, int quantity = 10, string name = nul
[ProducesResponseType(typeof(RoleModel), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-role" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetRole(Guid key)
{
var entity = _roleRepository.GetByKey(key);
Expand Down
10 changes: 8 additions & 2 deletions source/backend/api/Areas/Admin/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.User;
using Pims.Api.Policies;
using Pims.Core.Json;
using Pims.Dal.Entities;
using Pims.Dal.Entities.Models;
using Pims.Dal.Repositories;
Expand Down Expand Up @@ -54,6 +55,7 @@ public UserController(IUserRepository userRepository, IMapper mapper)
[ProducesResponseType(typeof(PageModel<UserModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetUsers()
{
var uri = new Uri(this.Request.GetDisplayUrl());
Expand All @@ -71,6 +73,7 @@ public IActionResult GetUsers()
[ProducesResponseType(typeof(PageModel<UserModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetUsers(UserFilter filter)
{
var page = _userRepository.GetAllByFilter(filter);
Expand All @@ -88,6 +91,7 @@ public IActionResult GetUsers(UserFilter filter)
[ProducesResponseType(typeof(UserModel), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetUser(long id)
{
var entity = _userRepository.GetById(id);
Expand All @@ -105,6 +109,7 @@ public IActionResult GetUser(long id)
[ProducesResponseType(typeof(UserModel), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetUser(Guid key)
{
var entity = _userRepository.GetByKeycloakUserId(key);
Expand All @@ -122,6 +127,7 @@ public IActionResult GetUser(Guid key)
[ProducesResponseType(typeof(UserModel), 201)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddUser([FromBody] UserModel model)
{
var entity = _mapper.Map<PimsUser>(model);
Expand All @@ -143,7 +149,7 @@ public IActionResult AddUser([FromBody] UserModel model)
[ProducesResponseType(typeof(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.")]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateUser(Guid key, [FromBody] UserModel model)
{
var entity = _mapper.Map<PimsUser>(model);
Expand All @@ -164,7 +170,7 @@ public IActionResult UpdateUser(Guid key, [FromBody] UserModel model)
[ProducesResponseType(typeof(UserModel), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Parameter 'key' is required for route.")]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult DeleteUser(Guid key, [FromBody] UserModel model)
{
var entity = _mapper.Map<PimsUser>(model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public CompensationRequisitionController(IMapper mapper, ILogger<CompensationReq
[Produces("application/json")]
[ProducesResponseType(typeof(CompensationRequisitionModel), 200)]
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetCompensationRequisitionById([FromRoute] long id)
{
_logger.LogInformation(
Expand All @@ -66,6 +67,7 @@ public IActionResult GetCompensationRequisitionById([FromRoute] long id)
[Produces("application/json")]
[ProducesResponseType(typeof(CompensationRequisitionModel), 200)]
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateCompensationRequisition([FromRoute] long id, [FromBody] CompensationRequisitionModel compensationRequisition)
{
_logger.LogInformation(
Expand Down
Loading