Skip to content

Commit

Permalink
Rename Operate to Mandates
Browse files Browse the repository at this point in the history
  • Loading branch information
tschumpr committed May 28, 2024
1 parent 497053b commit 81cdd14
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Geopilot.Api/ContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static void SeedTestData(this Context context)

context.SeedUsers();
context.SeedOrganisations();
context.SeedOperate();
context.SeedMandates();
context.SeedDeliveries();
context.SeedAssets();
context.AuthorizeFirstUser();
Expand Down Expand Up @@ -119,10 +119,10 @@ public static Geometry GetExtent()
});
}

public static void SeedOperate(this Context context)
public static void SeedMandates(this Context context)
{
var knownFileFormats = new string[] { ".xtf", ".gpkg", ".*", ".itf", ".xml", ".zip", ".csv" };
var operateFaker = new Faker<Mandate>()
var mandateFaker = new Faker<Mandate>()
.StrictMode(true)
.RuleFor(o => o.Id, f => 0)
.RuleFor(o => o.Name, f => f.Commerce.ProductName())
Expand All @@ -131,8 +131,8 @@ public static void SeedOperate(this Context context)
.RuleFor(o => o.Organisations, f => f.PickRandom(context.Organisations.ToList(), 1).ToList())
.RuleFor(o => o.Deliveries, _ => new List<Delivery>());

Mandate SeedOperat(int seed) => operateFaker.UseSeed(seed).Generate();
context.Mandates.AddRange(Enumerable.Range(0, 10).Select(SeedOperat));
Mandate SeedMandate(int seed) => mandateFaker.UseSeed(seed).Generate();
context.Mandates.AddRange(Enumerable.Range(0, 10).Select(SeedMandate));
context.SaveChanges();
}

Expand Down

0 comments on commit 81cdd14

Please sign in to comment.