This commit is contained in:
2022-03-15 23:47:24 +00:00
parent 8a9285fce7
commit 47cc22a181
3 changed files with 7 additions and 7 deletions

View File

@@ -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;

View File

@@ -316,7 +316,7 @@ namespace AyaNova
////////////////////////////////////////////////////////////
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
//
public async void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IWebHostEnvironment env,
public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IWebHostEnvironment env,
AyContext dbContext, IApiVersionDescriptionProvider provider, AyaNova.Api.ControllerHelpers.ApiServerState apiServerState,
IServiceProvider serviceProvider)
{

View File

@@ -349,7 +349,7 @@
"ErrorUserNotAuthenticated": "Not authenticated (E16)",
"ErrorUserNotAuthorized": "Not authorized",
"Evaluate": "Evaluate",
"EvaluateAppendPassword": "Append this text to all sample User passwords (optional)",
"EvaluateAppendPassword": "Append this to all sample User passwords (optional)",
"EvaluateForceEmail": "Set all email addresses to this (optional)",
"EvaluationGuide": "Evaluation guide",
"EvaluationRequestReceived": "Request received, check your email for verification",