This commit is contained in:
@@ -71,7 +71,7 @@ namespace AyaNova.Api.Controllers
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, null, "Current license is not a trial license key. Only a trial can be seeded."));
|
||||
}
|
||||
|
||||
Seeder.Level.SeedLevel seedLevel = Seeder.Level.StringToSeedLevel(seedOptions.Size);
|
||||
Seeder.Level.SeedLevel seedLevel = Seeder.Level.StringToSeedLevel(seedOptions.SeedLevel);
|
||||
if (seedLevel == Seeder.Level.SeedLevel.NotValid)
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_FOUND, "size", "Valid values are \"small\", \"medium\", \"large\", \"huge\""));
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
JObject o = JObject.FromObject(new
|
||||
{
|
||||
seedLevel = seedOptions.Size,
|
||||
seedLevel = seedLevel,
|
||||
timeZoneOffset = seedOptions.TimeZoneOffset,
|
||||
e2e = seedOptions.E2e,
|
||||
forceEmail=seedOptions.ForceEmail,
|
||||
@@ -87,14 +87,14 @@ namespace AyaNova.Api.Controllers
|
||||
});
|
||||
|
||||
OpsJob j = new OpsJob();
|
||||
j.Name = $"Seed test data (size={seedOptions.Size})";
|
||||
j.Name = $"Seed test data (size={seedOptions.SeedLevel})";
|
||||
j.JobType = JobType.SeedTestData;
|
||||
j.Exclusive = true;//don't run other jobs, this will erase the db
|
||||
j.JobInfo = o.ToString();
|
||||
await JobsBiz.AddJobAsync(j);
|
||||
|
||||
//Log
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created, seedOptions.Size), ct);
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.TrialSeeder, AyaEvent.Created, seedOptions.SeedLevel), ct);
|
||||
|
||||
return Accepted(new { JobId = j.GId });//202 accepted
|
||||
}
|
||||
@@ -103,7 +103,7 @@ namespace AyaNova.Api.Controllers
|
||||
public class SeedOptions
|
||||
{
|
||||
[Required]
|
||||
public string Size { get; set; }
|
||||
public string SeedLevel { get; set; }
|
||||
[Required]
|
||||
public decimal TimeZoneOffset { get; set; }
|
||||
public bool E2e { get; set; } = false;
|
||||
|
||||
Reference in New Issue
Block a user