Skip to content

Commit

Permalink
Merge pull request #3637 from asanchezr/is68_uat_release
Browse files Browse the repository at this point in the history
IS68 UAT Release
  • Loading branch information
asanchezr authored Dec 7, 2023
2 parents 3c3883f + 4a372a6 commit 1169c3d
Show file tree
Hide file tree
Showing 675 changed files with 7,046 additions and 2,816 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,15 @@ mayan-up: ## Calls the docker compose up for the mayan images
@echo "$(P) Create or start mayan-edms system"
@cd tools/mayan-edms; docker-compose --profile all up -d

generate-tsapi: ## Generates the pims API typescript files
@echo "$(P) Generating pims api Ts files..."
@cd tools/TsModelGenerator; dotnet build; dotnet run;
@make frontend-lint


frontend-lint:
@echo "$(P) Running lint:fix..."
@cd source/frontend; npm run lint:fix;

.PHONY: logs start destroy local setup restart refresh up down stop build rebuild clean client-test server-test pause-30 server-run db-clean db-drop db-seed db-refresh db-script db-scaffold npm-clean npm-refresh keycloak-sync convert backend-coverage frontend-coverage backend-test frontend-test env mayan-up

16 changes: 16 additions & 0 deletions source/backend/Pims.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Api", "api\Pims.Api.cs
{1ED5DF03-7784-44EC-B02B-516167210CCF} = {1ED5DF03-7784-44EC-B02B-516167210CCF}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pims.Api.Models", "apimodels\Pims.Api.Models.csproj", "{58C42283-68DA-477F-915D-C67597543546}"
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}"
Expand Down Expand Up @@ -108,6 +110,20 @@ Global
{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

{58C42283-68DA-477F-915D-C67597543546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Debug|x64.ActiveCfg = Debug|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Debug|x64.Build.0 = Debug|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Debug|x86.ActiveCfg = Debug|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Debug|x86.Build.0 = Debug|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Release|Any CPU.Build.0 = Release|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Release|x64.ActiveCfg = Release|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Release|x64.Build.0 = Release|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.Release|x86.ActiveCfg = Release|Any CPU
{58C42283-68DA-477F-915D-C67597543546}.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Models;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Concepts.AcquisitionFile;
using Pims.Api.Models.Concepts.CompensationRequisition;
using Pims.Api.Models.Concepts.ExpropriationPayment;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Extensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Concepts.AcquisitionFile;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Dal.Security;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Concepts.AcquisitionFile;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Dal.Security;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Concepts.InterestHolder;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Json;
Expand Down Expand Up @@ -58,7 +58,7 @@ public InterestHolderController(IAcquisitionFileService acquisitionService, IMap
public IActionResult GetAcquisitionFileInterestHolders([FromRoute] long id)
{
var interestHolders = _acquisitionService.GetInterestHolders(id);
return new JsonResult(_mapper.Map<List<Api.Models.Concepts.InterestHolderModel>>(interestHolders));
return new JsonResult(_mapper.Map<List<InterestHolderModel>>(interestHolders));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace Pims.Api.Areas.Acquisition.Controllers
using Pims.Api.Areas.Acquisition.Models.Search;
using Pims.Api.Helpers.Exceptions;
using Pims.Api.Helpers.Extensions;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.AcquisitionFile;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Extensions;
Expand Down Expand Up @@ -102,7 +103,7 @@ public IActionResult GetAcquisitionFiles([FromBody] AcquisitionFilterModel filte
_logger.LogInformation("Dispatching to service: {Service}", acquisitionService.GetType());

var acquisitionFiles = acquisitionService.GetPage((AcquisitionFilter)filter);
return new JsonResult(mapper.Map<Api.Models.PageModel<AcquisitionFileModel>>(acquisitionFiles));
return new JsonResult(mapper.Map<PageModel<AcquisitionFileModel>>(acquisitionFiles));
}
#endregion
#endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using MapsterMapper;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.AccessRequest;
using Pims.Api.Policies;
using Pims.Dal.Repositories;
using Pims.Dal.Security;
Expand Down
8 changes: 4 additions & 4 deletions source/backend/api/Areas/Admin/Controllers/ClaimController.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.Claim;
using Pims.Api.Policies;
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
using Model = Pims.Api.Models.Concepts;

namespace Pims.Api.Areas.Admin.Controllers
{
Expand Down Expand Up @@ -52,7 +52,7 @@ public ClaimController(IClaimRepository claimRepository, IMapper mapper)
/// <returns>Paged object with an array of claims.</returns>
[HttpGet]
[Produces("application/json")]
[ProducesResponseType(typeof(Api.Models.PageModel<Model.ClaimModel>), 200)]
[ProducesResponseType(typeof(PageModel<ClaimModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-claim" })]
public IActionResult GetClaims(int page = 1, int quantity = 10, string name = null)
Expand All @@ -73,7 +73,7 @@ public IActionResult GetClaims(int page = 1, int quantity = 10, string name = nu
}

var paged = _claimRepository.GetPage(page, quantity, name);
var result = _mapper.Map<Api.Models.PageModel<Model.ClaimModel>>(paged);
var result = _mapper.Map<PageModel<ClaimModel>>(paged);
return new JsonResult(result);
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Concepts.FinancialCode;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Exceptions;
Expand Down
11 changes: 6 additions & 5 deletions source/backend/api/Areas/Admin/Controllers/RoleController.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System;
using MapsterMapper;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.Role;
using Pims.Api.Policies;
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
using Model = Pims.Api.Models.Concepts;

namespace Pims.Api.Areas.Admin.Controllers
{
Expand Down Expand Up @@ -51,7 +52,7 @@ public RoleController(IRoleRepository roleRepository, IMapper mapper)
/// <returns>Paged object with an array of roles.</returns>
[HttpGet]
[Produces("application/json")]
[ProducesResponseType(typeof(Api.Models.PageModel<Model.RoleModel>), 200)]
[ProducesResponseType(typeof(PageModel<RoleModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-role" })]
public IActionResult GetRoles(int page = 1, int quantity = 10, string name = null)
Expand All @@ -72,7 +73,7 @@ public IActionResult GetRoles(int page = 1, int quantity = 10, string name = nul
}

var paged = _roleRepository.GetPage(page, quantity, name);
var result = _mapper.Map<Api.Models.PageModel<Model.RoleModel>>(paged);
var result = _mapper.Map<PageModel<RoleModel>>(paged);
return new JsonResult(result);
}

Expand All @@ -83,13 +84,13 @@ public IActionResult GetRoles(int page = 1, int quantity = 10, string name = nul
/// <returns>The role requested.</returns>
[HttpGet("{key}")]
[Produces("application/json")]
[ProducesResponseType(typeof(Model.RoleModel), 200)]
[ProducesResponseType(typeof(RoleModel), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-role" })]
public IActionResult GetRole(Guid key)
{
var entity = _roleRepository.GetByKey(key);
var role = _mapper.Map<Model.RoleModel>(entity);
var role = _mapper.Map<RoleModel>(entity);
return new JsonResult(role);
}
#endregion
Expand Down
47 changes: 24 additions & 23 deletions source/backend/api/Areas/Admin/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
using MapsterMapper;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Mvc;
using Pims.Api.Models.Base;
using Pims.Api.Models.Concepts.User;
using Pims.Api.Policies;
using Pims.Dal.Entities;
using Pims.Dal.Entities.Models;
using Pims.Dal.Repositories;
using Pims.Dal.Security;
using Swashbuckle.AspNetCore.Annotations;
using EModel = Pims.Dal.Entities.Models;
using Entity = Pims.Dal.Entities;
using Model = Pims.Api.Models.Concepts;

namespace Pims.Api.Areas.Admin.Controllers
{
Expand Down Expand Up @@ -50,14 +51,14 @@ public UserController(IUserRepository userRepository, IMapper mapper)
/// <returns>Paged object with an array of users.</returns>
[HttpGet]
[Produces("application/json")]
[ProducesResponseType(typeof(Api.Models.PageModel<Model.UserModel>), 200)]
[ProducesResponseType(typeof(PageModel<UserModel>), 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));
return GetUsers(new UserFilter(query));
}

/// <summary>
Expand All @@ -67,13 +68,13 @@ public IActionResult GetUsers()
/// <returns>Paged object with an array of users.</returns>
[HttpPost("filter")]
[Produces("application/json")]
[ProducesResponseType(typeof(Api.Models.PageModel<Model.UserModel>), 200)]
[ProducesResponseType(typeof(PageModel<UserModel>), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
public IActionResult GetUsers(EModel.UserFilter filter)
public IActionResult GetUsers(UserFilter filter)
{
var page = _userRepository.GetAllByFilter(filter);
var result = _mapper.Map<Api.Models.PageModel<Model.UserModel>>(page);
var result = _mapper.Map<PageModel<UserModel>>(page);
return new JsonResult(result);
}

Expand All @@ -84,13 +85,13 @@ public IActionResult GetUsers(EModel.UserFilter filter)
/// <returns>The user requested.</returns>
[HttpGet("{id:long}")]
[Produces("application/json")]
[ProducesResponseType(typeof(Model.UserModel), 200)]
[ProducesResponseType(typeof(UserModel), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
public IActionResult GetUser(long id)
{
var entity = _userRepository.GetById(id);
var user = _mapper.Map<Model.UserModel>(entity);
var user = _mapper.Map<UserModel>(entity);
return new JsonResult(user);
}

Expand All @@ -101,13 +102,13 @@ public IActionResult GetUser(long id)
/// <returns>The user requested.</returns>
[HttpGet("{key}")]
[Produces("application/json")]
[ProducesResponseType(typeof(Model.UserModel), 200)]
[ProducesResponseType(typeof(UserModel), 200)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
public IActionResult GetUser(Guid key)
{
var entity = _userRepository.GetByKeycloakUserId(key);
var user = _mapper.Map<Model.UserModel>(entity);
var user = _mapper.Map<UserModel>(entity);
return new JsonResult(user);
}

Expand All @@ -118,15 +119,15 @@ public IActionResult GetUser(Guid key)
/// <returns>The user added.</returns>
[HttpPost]
[Produces("application/json")]
[ProducesResponseType(typeof(Model.UserModel), 201)]
[ProducesResponseType(typeof(UserModel), 201)]
[ProducesResponseType(typeof(Api.Models.ErrorResponseModel), 400)]
[SwaggerOperation(Tags = new[] { "admin-user" })]
public IActionResult AddUser([FromBody] Model.UserModel model)
public IActionResult AddUser([FromBody] UserModel model)
{
var entity = _mapper.Map<Entity.PimsUser>(model);
var entity = _mapper.Map<PimsUser>(model);
_userRepository.Add(entity);

var user = _mapper.Map<Model.UserModel>(entity);
var user = _mapper.Map<UserModel>(entity);

return CreatedAtAction(nameof(GetUser), new { key = user.GuidIdentifierValue }, user);
}
Expand All @@ -139,16 +140,16 @@ public IActionResult AddUser([FromBody] Model.UserModel model)
/// <returns>The user updated.</returns>
[HttpPut("{key}")]
[Produces("application/json")]
[ProducesResponseType(typeof(Model.UserModel), 200)]
[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.")]
public IActionResult UpdateUser(Guid key, [FromBody] Model.UserModel model)
public IActionResult UpdateUser(Guid key, [FromBody] UserModel model)
{
var entity = _mapper.Map<Entity.PimsUser>(model);
var entity = _mapper.Map<PimsUser>(model);
_userRepository.Update(entity);

var user = _mapper.Map<Model.UserModel>(entity);
var user = _mapper.Map<UserModel>(entity);
return new JsonResult(user);
}

Expand All @@ -160,13 +161,13 @@ public IActionResult UpdateUser(Guid key, [FromBody] Model.UserModel model)
/// <returns>The user who was deleted.</returns>
[HttpDelete("{key}")]
[Produces("application/json")]
[ProducesResponseType(typeof(Model.UserModel), 200)]
[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.")]
public IActionResult DeleteUser(Guid key, [FromBody] Model.UserModel model)
public IActionResult DeleteUser(Guid key, [FromBody] UserModel model)
{
var entity = _mapper.Map<Entity.PimsUser>(model);
var entity = _mapper.Map<PimsUser>(model);
_userRepository.Delete(entity);

return new JsonResult(model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Helpers.Exceptions;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Concepts.CompensationRequisition;
using Pims.Api.Policies;
using Pims.Api.Services;
using Pims.Core.Extensions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Pims.Api.Models.Concepts;
using Pims.Api.Models.Concepts.H120Category;
using Pims.Api.Services;
using Pims.Core.Extensions;
using Swashbuckle.AspNetCore.Annotations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Pims.Api.Areas.Contact.Models.Search;
using Pims.Api.Helpers.Exceptions;
using Pims.Api.Helpers.Extensions;
using Pims.Api.Models.Base;
using Pims.Api.Policies;
using Pims.Api.Services.Interfaces;
using Pims.Dal.Entities.Models;
Expand Down Expand Up @@ -86,7 +87,7 @@ public IActionResult GetContacts([FromBody] ContactFilterModel filter)
}

Paged<Dal.Entities.PimsContactMgrVw> contacts = _contactService.GetPage((ContactFilter)filter);
return new JsonResult(_mapper.Map<Api.Models.PageModel<ContactSummaryModel>>(contacts));
return new JsonResult(_mapper.Map<PageModel<ContactSummaryModel>>(contacts));
}
#endregion
#endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Pims.Api.Models;
using Pims.Api.Models.Base;

namespace Pims.Api.Areas.Contact.Models.Contact
{
Expand Down
Loading

0 comments on commit 1169c3d

Please sign in to comment.