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."));
|
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)
|
if (seedLevel == Seeder.Level.SeedLevel.NotValid)
|
||||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_FOUND, "size", "Valid values are \"small\", \"medium\", \"large\", \"huge\""));
|
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
|
JObject o = JObject.FromObject(new
|
||||||
{
|
{
|
||||||
seedLevel = seedOptions.Size,
|
seedLevel = seedLevel,
|
||||||
timeZoneOffset = seedOptions.TimeZoneOffset,
|
timeZoneOffset = seedOptions.TimeZoneOffset,
|
||||||
e2e = seedOptions.E2e,
|
e2e = seedOptions.E2e,
|
||||||
forceEmail=seedOptions.ForceEmail,
|
forceEmail=seedOptions.ForceEmail,
|
||||||
@@ -87,14 +87,14 @@ namespace AyaNova.Api.Controllers
|
|||||||
});
|
});
|
||||||
|
|
||||||
OpsJob j = new OpsJob();
|
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.JobType = JobType.SeedTestData;
|
||||||
j.Exclusive = true;//don't run other jobs, this will erase the db
|
j.Exclusive = true;//don't run other jobs, this will erase the db
|
||||||
j.JobInfo = o.ToString();
|
j.JobInfo = o.ToString();
|
||||||
await JobsBiz.AddJobAsync(j);
|
await JobsBiz.AddJobAsync(j);
|
||||||
|
|
||||||
//Log
|
//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
|
return Accepted(new { JobId = j.GId });//202 accepted
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
public class SeedOptions
|
public class SeedOptions
|
||||||
{
|
{
|
||||||
[Required]
|
[Required]
|
||||||
public string Size { get; set; }
|
public string SeedLevel { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
public decimal TimeZoneOffset { get; set; }
|
public decimal TimeZoneOffset { get; set; }
|
||||||
public bool E2e { get; set; } = false;
|
public bool E2e { get; set; } = false;
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ namespace AyaNova
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
// 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,
|
AyContext dbContext, IApiVersionDescriptionProvider provider, AyaNova.Api.ControllerHelpers.ApiServerState apiServerState,
|
||||||
IServiceProvider serviceProvider)
|
IServiceProvider serviceProvider)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -349,7 +349,7 @@
|
|||||||
"ErrorUserNotAuthenticated": "Not authenticated (E16)",
|
"ErrorUserNotAuthenticated": "Not authenticated (E16)",
|
||||||
"ErrorUserNotAuthorized": "Not authorized",
|
"ErrorUserNotAuthorized": "Not authorized",
|
||||||
"Evaluate": "Evaluate",
|
"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)",
|
"EvaluateForceEmail": "Set all email addresses to this (optional)",
|
||||||
"EvaluationGuide": "Evaluation guide",
|
"EvaluationGuide": "Evaluation guide",
|
||||||
"EvaluationRequestReceived": "Request received, check your email for verification",
|
"EvaluationRequestReceived": "Request received, check your email for verification",
|
||||||
|
|||||||
Reference in New Issue
Block a user