-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into chrrust/readstatus
- Loading branch information
Showing
21 changed files
with
491 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Altinn.App.Api/Extensions/InstanceDataUnitOfWorkExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Altinn.App.Core.Internal.Data; | ||
using Altinn.App.Core.Models.Validation; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Altinn.App.Api.Extensions; | ||
|
||
internal static class InstanceDataUnitOfWorkExtensions | ||
{ | ||
internal class FileValidationIssueProblemDetails : ProblemDetails | ||
{ | ||
public List<ValidationIssueWithSource>? UploadValidationIssues { get; set; } | ||
} | ||
|
||
public static ProblemDetails? GetAbandonResponse(this InstanceDataUnitOfWork instanceDataUnitOfWork) | ||
{ | ||
if (instanceDataUnitOfWork.HasAbandonIssues) | ||
{ | ||
var issues = instanceDataUnitOfWork | ||
.AbandonIssues.Select(issue => | ||
ValidationIssueWithSource.FromIssue(issue, "DataProcessorAbandon", noIncrementalUpdates: false) | ||
) | ||
.ToList(); | ||
return new FileValidationIssueProblemDetails | ||
{ | ||
Title = "File validation failed", | ||
Detail = "Validation issues were found in the file upload", | ||
Status = 400, | ||
UploadValidationIssues = issues, | ||
}; | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.