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

Fixup: Remove DTO PR #348

Merged
merged 8 commits into from
Jan 9, 2025
2 changes: 2 additions & 0 deletions src/Geopilot.Api/ContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ public static void SeedMandates(this Context context)
var knownFileFormats = new string[] { ".xtf", ".gpkg", ".*", ".itf", ".xml", ".zip", ".csv" };
var mandateFaker = new Faker<Mandate>()
.UseDateTimeReference(referenceDateTime)
.StrictMode(true)
.RuleFor(o => o.Id, f => 0)
.RuleFor(o => o.Name, f => f.Commerce.ProductName())
.RuleFor(o => o.FileTypes, f => f.PickRandom(knownFileFormats, 4).Distinct().ToArray())
.RuleFor(o => o.SpatialExtent, f => GetExtent())
.Ignore(o => o.Coordinates)
.RuleFor(o => o.Organisations, f => f.PickRandom(context.Organisations.ToList(), 1).ToList())
.RuleFor(o => o.Deliveries, _ => new List<Delivery>());

Expand Down
2 changes: 1 addition & 1 deletion src/Geopilot.Api/Models/Asset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Asset
/// <summary>
/// Backreference to the delivery the asset belongs to.
/// </summary>
public Delivery? Delivery { get; set; } = new Delivery();
public Delivery Delivery { get; set; } = new Delivery();

/// <summary>
/// The deletion status of the asset.
Expand Down
2 changes: 1 addition & 1 deletion src/Geopilot.Api/Models/Delivery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Delivery
/// <summary>
/// The mandate the delivery fulfills.
/// </summary>
public Mandate? Mandate { get; set; } = new Mandate();
public Mandate Mandate { get; set; } = new Mandate();

/// <summary>
/// Assets delivered or created by the validation and delivery process.
Expand Down
Loading