Skip to content

Commit

Permalink
Add required fields to inspections and poses
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Jan 12, 2024
1 parent a02d529 commit 6b24b4c
Show file tree
Hide file tree
Showing 9 changed files with 1,484 additions and 10 deletions.
1 change: 1 addition & 0 deletions backend/api/Database/Models/DefaultLocalizationPose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class DefaultLocalizationPose
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public string Id { get; set; }

[Required]
public Pose Pose { get; set; }

public DefaultLocalizationPose()
Expand Down
5 changes: 3 additions & 2 deletions backend/api/Database/Models/Inspection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ public Inspection(Inspection copy, InspectionStatus? inspectionStatus = null)
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public string Id { get; set; }

[Required]
[MaxLength(200)]
// ReSharper disable once AutoPropertyCanBeMadeGetOnly.Local
public string? IsarStepId { get; private set; } = Guid.NewGuid().ToString();
public string IsarStepId { get; private set; } = Guid.NewGuid().ToString();

public Position InspectionTarget { get; set; }
public Position? InspectionTarget { get; set; }

[Required]
public InspectionStatus Status
Expand Down
3 changes: 3 additions & 0 deletions backend/api/Database/Models/InspectionFinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ public class InspectionFinding
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public string Id { get; set; }

[Required]
public DateTime InspectionDate { get; set; }

[Required]
public string IsarStepId { get; set; }

[Required]
public string Finding { get; set; }

public InspectionFinding(InspectionFindingQuery createInspectionFindingQuery)
Expand Down
9 changes: 8 additions & 1 deletion backend/api/Database/Models/Pose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace Api.Database.Models
[Owned]
public class Orientation
{

public Orientation()
{
X = 0;
Expand All @@ -32,9 +31,14 @@ public Orientation(float x = 0, float y = 0, float z = 0, float w = 1)
Z = z;
W = w;
}

[Required]
public float X { get; set; }
[Required]
public float Y { get; set; }
[Required]
public float Z { get; set; }
[Required]
public float W { get; set; }

public override bool Equals(object obj)
Expand Down Expand Up @@ -80,8 +84,11 @@ public Position(float x = 0, float y = 0, float z = 0)
Z = z;
}

[Required]
public float X { get; set; }
[Required]
public float Y { get; set; }
[Required]
public float Z { get; set; }

public override bool Equals(object obj)
Expand Down
3 changes: 1 addition & 2 deletions backend/api/Database/Models/SortableRecord.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma warning disable CS8618
namespace Api.Database.Models
namespace Api.Database.Models
{
public interface SortableRecord
{
Expand Down
Loading

0 comments on commit 6b24b4c

Please sign in to comment.