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

Fix migration issues #1185

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/api/Controllers/InspectionFindingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ IInspectionService inspectionService
/// </remarks>
[HttpPost("add-findings")]
[Authorize(Roles = Role.Admin)]
[ProducesResponseType(typeof(InspectionFindings), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(InspectionFinding), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status409Conflict)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<InspectionFindings>> AddFindings([FromBody] InspectionFindingsQuery inspectionFinding)
public async Task<ActionResult<InspectionFinding>> AddFindings([FromBody] InspectionFindingsQuery inspectionFinding)
{
_logger.LogInformation("Updating inspection findings for inspection with isarStepId '{Id}'", inspectionFinding.IsarStepId);
try
Expand Down Expand Up @@ -92,4 +92,5 @@ public async Task<ActionResult<Inspection>> GetInspections([FromRoute] string id

}


}
2 changes: 1 addition & 1 deletion backend/api/Database/Models/Inspection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ or InspectionStatus.Successful

public DateTime? EndTime { get; private set; }

public List<InspectionFindings> InspectionFindings { get; set; }
public List<InspectionFinding> InspectionFindings { get; set; }

public void UpdateWithIsarInfo(IsarStep isarStep)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma warning disable CS8618
namespace Api.Database.Models
{
public class InspectionFindings
public class InspectionFinding
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
Expand All @@ -18,15 +18,15 @@ public class InspectionFindings

public string Findings { get; set; }

public InspectionFindings(InspectionFindingsQuery createInspectionFindingQuery)
public InspectionFinding(InspectionFindingsQuery createInspectionFindingQuery)
{
InspectionDate = createInspectionFindingQuery.InspectionDate;
Area = createInspectionFindingQuery.Area;
IsarStepId = createInspectionFindingQuery.IsarStepId;
Findings = createInspectionFindingQuery.Findings;
}

public InspectionFindings()
public InspectionFinding()
{
InspectionDate = DateTime.UtcNow;
Area = "string";
Expand Down
Loading
Loading