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

disposition merge to dev, dotnet 8 update, ef update. #3682

Merged
merged 43 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1d0fd93
add date and time aliases to frontend. Add model typing to backend.
devinleighsmith Oct 16, 2023
e558d5c
psp-6887 update backend/frontend to support dateonly/ts
devinleighsmith Nov 15, 2023
cdec314
IS-68.00 Database Schema - Disposition File (#3611)
dfilteau Nov 24, 2023
e37a0a7
Scaffold/disposition (#3615)
FuriousLlama Nov 24, 2023
d1c5291
PSP-7330 : Create disposition Claims (#3616)
eddherrera Nov 24, 2023
4fd93c5
Psp 7281 (#3617)
devinleighsmith Nov 25, 2023
435cc2b
Disposition alignment (#3623)
FuriousLlama Nov 29, 2023
6fcb6a1
Disposition menu (#3625)
FuriousLlama Nov 30, 2023
c03458a
psp-7281 unit tests for disposition framework and adding missing look…
devinleighsmith Nov 30, 2023
fb5e1a5
dotnet8, ef8 migration.
Nov 30, 2023
6b0ad6c
Merge remote-tracking branch 'origin/psp-6887' into dotnet8_update
Dec 1, 2023
ef9de9d
merge with date changes.
Dec 1, 2023
31b2787
Psp 6951 - view disposition file details. (#3626)
devinleighsmith Dec 2, 2023
43373bc
PSP-6952 disposition list view (#3627)
asanchezr Dec 2, 2023
14c1a4c
dateonly type corrections.
devinleighsmith Dec 4, 2023
fd49d7c
.net 8.0 github update.
devinleighsmith Dec 4, 2023
1f5210d
test updates, update openshift configuration.
devinleighsmith Dec 5, 2023
538a6d0
Disposition/align2 (#3640)
FuriousLlama Dec 7, 2023
5a52cfe
Disposition/menu entry (#3639)
FuriousLlama Dec 7, 2023
6875779
PSP-6948 : Create a disposition file (#3631)
eddherrera Dec 8, 2023
9c9c899
PSP-6952 tests (#3634)
asanchezr Dec 13, 2023
3cf3016
IS-69.00 Database Schema (#3642)
dfilteau Dec 14, 2023
6c6e56d
Generated Scaffold (#3660)
FuriousLlama Dec 14, 2023
a3aa26a
Fix disposition scaffold (#3664)
eddherrera Dec 14, 2023
16e493a
Merge branch 'dev' into disposition_align
FuriousLlama Dec 15, 2023
7d484d5
manual merge
FuriousLlama Dec 15, 2023
70fae36
Merge pull request #3668 from FuriousLlama/disposition_align
asanchezr Dec 18, 2023
35e46ca
PSP-6954 disposition documents (#3672)
asanchezr Dec 19, 2023
762fa14
Psp 6955 disposition notes. (#3673)
devinleighsmith Dec 20, 2023
e230d02
PSP-7269 create disposition from map popup (#3675)
asanchezr Dec 21, 2023
81d77b5
PSP-7247 : View disposition file (offers and sale) (#3669)
eddherrera Dec 21, 2023
bd9a461
Merge remote-tracking branch 'upstream/dev' into dotnet8_update
Dec 22, 2023
345470d
Merge branch 'dotnet8_update' into psp-6887
Dec 22, 2023
72fb124
Merge remote-tracking branch 'upstream/disposition' into dotnet8_update
Dec 22, 2023
f542f3e
DateOnly corrections, warnings, disposition appraisal entity/model co…
Dec 22, 2023
0dea7c3
Merge remote-tracking branch 'origin/dotnet8_update' into dotnet8_update
Dec 22, 2023
6872594
disposition file test corrections.
Dec 22, 2023
cbbd929
test correction.
Dec 22, 2023
16b08cb
correct some type mappings.
Dec 22, 2023
97666ca
disposition mapping corrections.
Dec 23, 2023
588dd56
fix property side display.
Dec 23, 2023
c1b6147
snapshot correction, fix missing override code.
devinleighsmith Jan 2, 2024
382a6e7
update .env file with extra connection string information required fo…
devinleighsmith Jan 2, 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
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/api-dotnetcore.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: API (.NET 6)
name: API (.NET 8)

on:
push:
Expand Down Expand Up @@ -39,10 +39,10 @@ jobs:
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch

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

- name: Install dependencies
run: dotnet restore
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
# Specify whether or not CI build should fail if Codecov runs into an error during upload
fail_ci_if_error: true

- name: SonarScanner for .NET 6 with pull request decoration support
- name: SonarScanner for .NET 8 with pull request decoration support
id: scan
uses: highbyte/sonarscan-dotnet@v2.1.2
if: ${{ github.event_name == 'push' }}
Expand Down
4 changes: 2 additions & 2 deletions openshift/4.0/templates/api/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ parameters:
- name: BUILDIMAGE_NAME
displayName: "Source Image Name"
description: "The image to use as the Builder Image."
value: "dotnet-60"
value: "dotnet-80"
- name: BUILDIMAGE_TAG
displayName: "Source Image Tag"
description: "The s2i image tag which is used to build the code."
value: "6.0"
value: "8.0"

- name: GIT_URL
displayName: Git Repository URL
Expand Down
14 changes: 7 additions & 7 deletions source/backend/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<AnalysisMode>Minimum</AnalysisMode>
<WarningLevel>4</WarningLevel>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
Expand All @@ -17,19 +17,19 @@
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.1.0">
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="4.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Net.Compilers" Version="4.1.0">
<PackageReference Include="Microsoft.Net.Compilers" Version="4.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.1.0">
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers;</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
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.Areas.Acquisition.Controllers;
using Pims.Api.Models.Concepts.DispositionFile;
using Pims.Api.Models.Models.Concepts.DispositionFile;
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;

namespace Pims.Api.Areas.Disposition.Controllers
{
/// <summary>
/// DispositionFileController class, provides endpoints for interacting with disposition files.
/// </summary>
[Authorize]
[ApiController]
[ApiVersion("1.0")]
[Area("dispositionfiles")]
[Route("v{version:apiVersion}/[area]")]
[Route("[area]")]
public class DispositionFileController : ControllerBase
{
#region Variables
private readonly IDispositionFileService _dispositionService;
private readonly IMapper _mapper;
private readonly ILogger _logger;
#endregion

#region Constructors

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

#region Endpoints

/// <summary>
/// Gets the specified disposition file.
/// </summary>
/// <returns></returns>
[HttpGet("{id:long}")]
[HasPermission(Permissions.DispositionView)]
[Produces("application/json")]
[ProducesResponseType(typeof(DispositionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "dispositionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetDispositionFile(long id)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(DispositionFileController),
nameof(GetDispositionFile),
User.GetUsername(),
DateTime.Now);

_logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());

var dispositionFile = _dispositionService.GetById(id);
return new JsonResult(_mapper.Map<DispositionFileModel>(dispositionFile));
}

/// <summary>
/// Creates a new Disposition File entity.
/// </summary>
/// <returns></returns>
[HttpPost]
[TypeFilter(typeof(NullJsonResultFilter))]
[HasPermission(Permissions.DispositionAdd)]
[Produces("application/json")]
[ProducesResponseType(typeof(DispositionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "dispositionfile" })]
public IActionResult AddDispositionFile([FromBody] DispositionFileModel model, [FromQuery] string[] userOverrideCodes)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(AcquisitionFileController),
nameof(AddDispositionFile),
User.GetUsername(),
DateTime.Now);

Check warning on line 99 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L93-L99

Added lines #L93 - L99 were not covered by tests

_logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());

Check warning on line 101 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L101

Added line #L101 was not covered by tests

var dispositionFileEntity = _mapper.Map<Dal.Entities.PimsDispositionFile>(model);
var dispositionFile = _dispositionService.Add(dispositionFileEntity, userOverrideCodes.Select(oc => UserOverrideCode.Parse(oc)));

Check warning on line 104 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L103-L104

Added lines #L103 - L104 were not covered by tests

return new JsonResult(_mapper.Map<DispositionFileModel>(dispositionFile));
}

Check warning on line 107 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L106-L107

Added lines #L106 - L107 were not covered by tests

/// <summary>
/// Gets the specified disposition file last updated-by information.
/// </summary>
/// <returns></returns>
[HttpGet("{id:long}/updateInfo")]
[HasPermission(Permissions.DispositionView)]
[Produces("application/json")]
[ProducesResponseType(typeof(Dal.Entities.Models.LastUpdatedByModel), 200)]
[SwaggerOperation(Tags = new[] { "dispositionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetLastUpdatedBy(long id)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(DispositionFileController),
nameof(GetLastUpdatedBy),
User.GetUsername(),
DateTime.Now);

var lastUpdated = _dispositionService.GetLastUpdateInformation(id);
return new JsonResult(lastUpdated);
}

/// <summary>
/// Get the disposition file properties.
/// </summary>
/// <returns></returns>
[HttpGet("{id:long}/properties")]
[HasPermission(Permissions.DispositionView, Permissions.PropertyView)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<DispositionFilePropertyModel>), 200)]
[SwaggerOperation(Tags = new[] { "dispositionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetDispositionFileProperties(long id)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(DispositionFileController),
nameof(GetDispositionFileProperties),
User.GetUsername(),
DateTime.Now);

var dispositionfileProperties = _dispositionService.GetProperties(id);

return new JsonResult(_mapper.Map<IEnumerable<DispositionFilePropertyModel>>(dispositionfileProperties));
}

/// <summary>
/// Get all unique persons and organizations that belong to at least one disposition file as a team member.
/// </summary>
/// <returns></returns>
[HttpGet("team-members")]
[HasPermission(Permissions.DispositionView)]
[HasPermission(Permissions.ContactView)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<DispositionFileTeamModel>), 200)]
[SwaggerOperation(Tags = new[] { "dispositionfile" })]
public IActionResult GetDispositionTeamMembers()
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(DispositionFileController),
nameof(GetDispositionTeamMembers),
User.GetUsername(),
DateTime.Now);

var team = _dispositionService.GetTeamMembers();

return new JsonResult(_mapper.Map<IEnumerable<DispositionFileTeamModel>>(team));
}

[HttpGet("{id:long}/offers")]
[HasPermission(Permissions.DispositionView)]
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<DispositionFileOfferModel>), 200)]
[SwaggerOperation(Tags = new[] { "dispositionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetDispositionFileOffers([FromRoute]long id)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(DispositionFileController),
nameof(GetDispositionFileOffers),
User.GetUsername(),
DateTime.Now);

Check warning on line 193 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L187-L193

Added lines #L187 - L193 were not covered by tests

_logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());

Check warning on line 195 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L195

Added line #L195 was not covered by tests

var dispositionOffers = _dispositionService.GetOffers(id);
return new JsonResult(_mapper.Map<IEnumerable<DispositionFileOfferModel>>(dispositionOffers));
}

Check warning on line 199 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L197-L199

Added lines #L197 - L199 were not covered by tests

[HttpGet("{id:long}/sale")]
[HasPermission(Permissions.DispositionView)]
[Produces("application/json")]
[ProducesResponseType(typeof(DispositionFileSaleModel), 200)]
[SwaggerOperation(Tags = new[] { "dispositionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetDispositionFileSales([FromRoute]long id)
{
_logger.LogInformation(
"Request received by Controller: {Controller}, Action: {ControllerAction}, User: {User}, DateTime: {DateTime}",
nameof(DispositionFileController),
nameof(GetDispositionFileSales),
User.GetUsername(),
DateTime.Now);

Check warning on line 214 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L208-L214

Added lines #L208 - L214 were not covered by tests

_logger.LogInformation("Dispatching to service: {Service}", _dispositionService.GetType());

Check warning on line 216 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L216

Added line #L216 was not covered by tests

var dispositionSale = _dispositionService.GetDispositionFileSale(id);
return new JsonResult(_mapper.Map<DispositionFileSaleModel>(dispositionSale));
}

Check warning on line 220 in source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs

View check run for this annotation

Codecov / codecov/patch

source/backend/api/Areas/Disposition/Controllers/DispositionFileController.cs#L218-L220

Added lines #L218 - L220 were not covered by tests

#endregion
}
}
Loading
Loading