This commit is contained in:
@@ -228,6 +228,10 @@ namespace AyaNova.Util
|
|||||||
await SeedUserAsync(log, 1, AuthorizationRoles.BizAdmin | AuthorizationRoles.Service | AuthorizationRoles.Inventory | AuthorizationRoles.OpsAdmin, UserType.Service);
|
await SeedUserAsync(log, 1, AuthorizationRoles.BizAdmin | AuthorizationRoles.Service | AuthorizationRoles.Inventory | AuthorizationRoles.OpsAdmin, UserType.Service);
|
||||||
//Generate one office person / secretary
|
//Generate one office person / secretary
|
||||||
await SeedUserAsync(log, 1, AuthorizationRoles.Service | AuthorizationRoles.Inventory | AuthorizationRoles.Accounting, UserType.NotService);
|
await SeedUserAsync(log, 1, AuthorizationRoles.Service | AuthorizationRoles.Inventory | AuthorizationRoles.Accounting, UserType.NotService);
|
||||||
|
|
||||||
|
//4 other techs (must always be enough to have no dupes per workorder)
|
||||||
|
await SeedUserAsync(log, 4, AuthorizationRoles.Tech | AuthorizationRoles.ServiceRestricted, UserType.Service);
|
||||||
|
|
||||||
await SeedVendorAsync(log, 10);
|
await SeedVendorAsync(log, 10);
|
||||||
await SeedUnitModelAsync(log, 10);
|
await SeedUnitModelAsync(log, 10);
|
||||||
await SeedCustomerAsync(log, 25, slevel);
|
await SeedCustomerAsync(log, 25, slevel);
|
||||||
@@ -246,7 +250,7 @@ namespace AyaNova.Util
|
|||||||
await SeedPurchaseOrderAsync(log, 10);
|
await SeedPurchaseOrderAsync(log, 10);
|
||||||
await SeedQuoteAsync(log, 5);
|
await SeedQuoteAsync(log, 5);
|
||||||
await SeedPMAsync(log, 3);
|
await SeedPMAsync(log, 3);
|
||||||
await SeedWorkOrderAsync(log, 450, slevel);
|
await SeedWorkOrderAsync(log, 100, slevel);
|
||||||
|
|
||||||
//PERF
|
//PERF
|
||||||
watch.Stop();
|
watch.Stop();
|
||||||
@@ -2725,7 +2729,7 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
public long RandomServiceTechUserId()
|
public long RandomServiceTechUserId()
|
||||||
{
|
{
|
||||||
return ServiceUserIds[Fake.Random.Int(1, ServiceUserIds.Count - 1)];
|
return ServiceUserIds[Fake.Random.Int(0, ServiceUserIds.Count - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2748,26 +2752,26 @@ namespace AyaNova.Util
|
|||||||
//need a very large window for huge level seeding
|
//need a very large window for huge level seeding
|
||||||
|
|
||||||
//small defaults
|
//small defaults
|
||||||
int PastMonthsToSeed = 2;
|
int PastMonthsToSeed = 3;
|
||||||
int woItemCount = 4;
|
int MaximumWorkOrderItemCount = 2;
|
||||||
int woItemUnitCount = 2;
|
int woItemUnitCount = 2;
|
||||||
|
|
||||||
switch (seedLevel)
|
switch (seedLevel)
|
||||||
{
|
{
|
||||||
case Level.SeedLevel.Medium:
|
case Level.SeedLevel.Medium:
|
||||||
PastMonthsToSeed = 5;
|
PastMonthsToSeed = 5;
|
||||||
woItemCount = 3;
|
MaximumWorkOrderItemCount = 2;
|
||||||
woItemUnitCount = 1;
|
woItemUnitCount = 1;
|
||||||
break;
|
break;
|
||||||
case Level.SeedLevel.Large:
|
case Level.SeedLevel.Large:
|
||||||
PastMonthsToSeed = 11;
|
PastMonthsToSeed = 11;
|
||||||
woItemCount = 2;
|
MaximumWorkOrderItemCount = 2;
|
||||||
|
|
||||||
woItemUnitCount = 1;
|
woItemUnitCount = 1;
|
||||||
break;
|
break;
|
||||||
case Level.SeedLevel.Huge:
|
case Level.SeedLevel.Huge:
|
||||||
PastMonthsToSeed = 23;
|
PastMonthsToSeed = 23;
|
||||||
woItemCount = 1;
|
MaximumWorkOrderItemCount = 2;
|
||||||
woItemUnitCount = 1;
|
woItemUnitCount = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -2828,8 +2832,8 @@ namespace AyaNova.Util
|
|||||||
o.InternalReferenceNumber = "irf-" + Fake.Finance.Account(4);
|
o.InternalReferenceNumber = "irf-" + Fake.Finance.Account(4);
|
||||||
o.ServiceDate = woDate;
|
o.ServiceDate = woDate;
|
||||||
|
|
||||||
|
var actualWorkorderItemCount=Fake.Random.Int(1,MaximumWorkOrderItemCount);
|
||||||
for (int y = 0; y < woItemCount; y++)
|
for (int y = 0; y < actualWorkorderItemCount; y++)
|
||||||
{
|
{
|
||||||
var woItem = new WorkOrderItem()
|
var woItem = new WorkOrderItem()
|
||||||
{
|
{
|
||||||
@@ -2853,7 +2857,8 @@ namespace AyaNova.Util
|
|||||||
}
|
}
|
||||||
|
|
||||||
//SCHEDULED USERS
|
//SCHEDULED USERS
|
||||||
for (int a = 0; a < 2; a++)
|
var actualScheduledUserCount=Fake.Random.Int(1,2);
|
||||||
|
for (int a = 0; a < actualScheduledUserCount; a++)
|
||||||
{
|
{
|
||||||
var randomStart = Fake.Random.Int(0, 5);
|
var randomStart = Fake.Random.Int(0, 5);
|
||||||
var randomHours = Fake.Random.Int(1, 4);
|
var randomHours = Fake.Random.Int(1, 4);
|
||||||
|
|||||||
Reference in New Issue
Block a user