This commit is contained in:
@@ -589,7 +589,7 @@ namespace AyaNova.Util
|
||||
var KnownUserTags = new List<string>();
|
||||
KnownUserTags.Add("known-user");
|
||||
KnownUserTags.Add("test-role-user");
|
||||
//TEST USERS
|
||||
//TRIAL USERS
|
||||
//one of each role type
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.BizAdminRestricted, UserType.NotService, "BizAdminRestricted", "BizAdminRestricted", KnownUserTags);
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.BizAdmin, UserType.NotService, "BizAdmin", "BizAdmin", KnownUserTags);
|
||||
@@ -602,29 +602,18 @@ namespace AyaNova.Util
|
||||
KnownUserTechId = await SeedUserAsync(log, 1, AuthorizationRoles.Tech, UserType.Service, "Tech", "Tech", KnownUserTags);
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.SalesRestricted, UserType.NotService, "SalesRestricted", "SalesRestricted", KnownUserTags);
|
||||
KnownUserSalesId = await SeedUserAsync(log, 1, AuthorizationRoles.Sales, UserType.NotService, "Sales", "Sales", KnownUserTags);
|
||||
|
||||
|
||||
|
||||
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.OpsAdminRestricted, UserType.NotService, "OpsAdminRestricted", "OpsAdminRestricted", KnownUserTags);
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.OpsAdmin, UserType.NotService, "OpsAdmin", "OpsAdmin", KnownUserTags);
|
||||
|
||||
|
||||
|
||||
//Alternate translation users for each stock translation
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.BizAdmin | AuthorizationRoles.OpsAdmin, UserType.NotService, true, "de", "de", await TranslationBiz.TranslationNameToIdStaticAsync("de"), KnownUserTags);
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.BizAdmin | AuthorizationRoles.OpsAdmin, UserType.NotService, true, "es", "es", await TranslationBiz.TranslationNameToIdStaticAsync("es"), KnownUserTags);
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.BizAdmin | AuthorizationRoles.OpsAdmin, UserType.NotService, true, "fr", "fr", await TranslationBiz.TranslationNameToIdStaticAsync("fr"), KnownUserTags);
|
||||
|
||||
#if (DEBUG)
|
||||
//PRIVACY TEST USER - this is used for a test to see if user info leaks into the logs
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.OpsAdminRestricted, UserType.NotService, "TEST_PRIVACY_USER_ACCOUNT", "TEST_PRIVACY_USER_ACCOUNT", KnownUserTags);
|
||||
|
||||
//TEST NOT ACTIVE - this is used for a test to see if inactive user can login
|
||||
await SeedUserAsync(log, 1, AuthorizationRoles.OpsAdminRestricted, UserType.NotService, false, "TEST_INACTIVE", "TEST_INACTIVE", 0, KnownUserTags);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//CONTRACTS
|
||||
{
|
||||
@@ -1525,7 +1514,7 @@ namespace AyaNova.Util
|
||||
TaskGroup t = new TaskGroup();
|
||||
t.Name = "Clean and inspect Class 7C";
|
||||
t.Active = true;
|
||||
t.Notes = Fake.Lorem.Sentence(null,3);
|
||||
t.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
t.Items.Add(new TaskGroupItem() { Sequence = 1, Task = "Open unit" });
|
||||
t.Items.Add(new TaskGroupItem() { Sequence = 2, Task = "Test tinclavic seals" });
|
||||
t.Items.Add(new TaskGroupItem() { Sequence = 3, Task = "Inspect triple-bonded polysium for cracks" });
|
||||
@@ -1552,7 +1541,7 @@ namespace AyaNova.Util
|
||||
TaskGroup t = new TaskGroup();
|
||||
t.Name = "Aerostat monitor standard refurb";
|
||||
t.Active = true;
|
||||
t.Notes = Fake.Lorem.Sentence(null,3);
|
||||
t.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
t.Items.Add(new TaskGroupItem() { Sequence = 1, Task = "Power down unit" });
|
||||
t.Items.Add(new TaskGroupItem() { Sequence = 2, Task = "Open seals" });
|
||||
t.Items.Add(new TaskGroupItem() { Sequence = 3, Task = "Replace central core" });
|
||||
@@ -2030,7 +2019,7 @@ namespace AyaNova.Util
|
||||
} while (!HashProjectNames.Add(o.Name));
|
||||
o.AccountNumber = Fake.Finance.Account();
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
DateTime dtSeed = Fake.Date.Between(seedStartWindow, seedEndWindow).ToUniversalTime();
|
||||
o.DateStarted = dtSeed;
|
||||
@@ -2081,7 +2070,7 @@ namespace AyaNova.Util
|
||||
} while (!HashRateNames.Add(o.Name));
|
||||
o.AccountNumber = Fake.Finance.Account();
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
|
||||
o.Cost = Fake.Random.Decimal(0.25m, 50);
|
||||
@@ -2131,7 +2120,7 @@ namespace AyaNova.Util
|
||||
} while (!HashRateNames.Add(o.Name));
|
||||
o.AccountNumber = Fake.Finance.Account();
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
|
||||
o.Cost = Fake.Random.Decimal(0.25m, 10);
|
||||
@@ -2182,7 +2171,7 @@ namespace AyaNova.Util
|
||||
|
||||
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
o.VendorId = Fake.Random.Long(1, TotalSeededVendors);//random picks in range Inclusive but sql id's start at 1 so this is kosher (not zero based)
|
||||
o.UPC = Fake.Commerce.Ean13();
|
||||
@@ -2234,7 +2223,7 @@ namespace AyaNova.Util
|
||||
} while (!HashUnitNames.Add(o.Serial));
|
||||
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
//Override model warranty 5% chance (1/20)
|
||||
if (Fake.Random.Number(1, 20) == 5)
|
||||
@@ -2343,7 +2332,7 @@ namespace AyaNova.Util
|
||||
//o.UnitId is shadow unit
|
||||
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
|
||||
o.RateHour = Fake.Random.Decimal(1, 25);
|
||||
@@ -2424,7 +2413,7 @@ namespace AyaNova.Util
|
||||
CustomerServiceRequest o = new CustomerServiceRequest();
|
||||
|
||||
o.Name = Fake.Hacker.Phrase();
|
||||
o.Notes = Fake.Lorem.Sentence(null,8);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 8);
|
||||
o.Tags = RandomTags();
|
||||
o.DateRequested = Fake.Date.Between(seedStartWindow, seedEndWindow).ToUniversalTime();
|
||||
o.CustomerId = GetRandomCustomerId();//Fake.Random.Long(1, TotalSeededCustomers);
|
||||
@@ -2464,7 +2453,7 @@ namespace AyaNova.Util
|
||||
} while (!HashPartWarehouseNames.Add(o.Name));
|
||||
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
|
||||
|
||||
@@ -2507,7 +2496,7 @@ namespace AyaNova.Util
|
||||
} while (!HashPartNumbers.Add(o.PartNumber));
|
||||
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
o.ManufacturerId = Fake.Random.Long(1, 3);//There are minimum 10 vendors seeded, want parts all in the first few so that some po stuff can kick in (vendorpartnumber etc)
|
||||
o.ManufacturerNumber = "man-" + o.PartNumber;
|
||||
@@ -2612,7 +2601,7 @@ namespace AyaNova.Util
|
||||
} while (!HashPartAssemblyNames.Add(o.Name));
|
||||
|
||||
o.Active = true;
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
int partCount = Fake.Random.Int(2, 5);
|
||||
for (int y = 0; y < partCount; y++)
|
||||
@@ -2655,7 +2644,7 @@ namespace AyaNova.Util
|
||||
for (int x = 0; x < count; x++)
|
||||
{
|
||||
PurchaseOrder o = new PurchaseOrder();
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
o.VendorId = Fake.Random.Long(1, 9);//this matches the range set in parts so that we get ALL vendor numbers being set
|
||||
var poDate = Fake.Date.Between(seedStartWindow, seedEndWindow);
|
||||
@@ -2663,7 +2652,7 @@ namespace AyaNova.Util
|
||||
o.ExpectedReceiveDate = poDate.AddDays(5).ToUniversalTime();
|
||||
|
||||
o.ReferenceNumber = Fake.Finance.Account(6);
|
||||
o.VendorMemo = Fake.Lorem.Sentence(null,3);
|
||||
o.VendorMemo = Fake.Lorem.Sentence(null, 3);
|
||||
if (Fake.Random.Number(1, 10) == 5)
|
||||
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
|
||||
|
||||
@@ -2796,7 +2785,7 @@ namespace AyaNova.Util
|
||||
for (int x = 0; x < count; x++)
|
||||
{
|
||||
WorkOrder o = new WorkOrder();
|
||||
o.Notes = Fake.Lorem.Sentence(null,6);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 6);
|
||||
o.Tags = RandomTags();
|
||||
if (Fake.Random.Bool())//50% have projects
|
||||
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
|
||||
@@ -2865,7 +2854,7 @@ namespace AyaNova.Util
|
||||
var woItemUnit = new WorkOrderItemUnit()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3)
|
||||
Notes = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Units.Add(woItemUnit);
|
||||
}
|
||||
@@ -3037,7 +3026,7 @@ namespace AyaNova.Util
|
||||
ServiceStartDate = woDate,
|
||||
ServiceStopDate = woDate.AddHours(1),
|
||||
ServiceRateId = Fake.Random.Long(1, TotalSeededServiceRates),
|
||||
ServiceDetails = Fake.Lorem.Sentence(null,6)
|
||||
ServiceDetails = Fake.Lorem.Sentence(null, 6)
|
||||
};
|
||||
woItem.Labors.Add(woItemLabor);
|
||||
if (Fake.Random.Bool())//50%
|
||||
@@ -3049,7 +3038,7 @@ namespace AyaNova.Util
|
||||
ServiceStartDate = woDate,
|
||||
ServiceStopDate = woDate.AddHours(1),
|
||||
ServiceRateId = Fake.Random.Long(1, TotalSeededServiceRates),
|
||||
ServiceDetails = Fake.Lorem.Sentence(null,6)
|
||||
ServiceDetails = Fake.Lorem.Sentence(null, 6)
|
||||
};
|
||||
woItem.Labors.Add(woItemLabor);
|
||||
}
|
||||
@@ -3065,7 +3054,7 @@ namespace AyaNova.Util
|
||||
TravelStartDate = woDate,
|
||||
TravelStopDate = woDate.AddHours(1),
|
||||
TravelRateId = Fake.Random.Long(1, TotalSeededTravelRates),
|
||||
TravelDetails = Fake.Lorem.Sentence(null,3),
|
||||
TravelDetails = Fake.Lorem.Sentence(null, 3),
|
||||
Distance = Fake.Random.Int(1, 20)
|
||||
};
|
||||
woItem.Travels.Add(woItemTravel);
|
||||
@@ -3168,7 +3157,7 @@ namespace AyaNova.Util
|
||||
var woItemOutsideService = new WorkOrderItemOutsideService()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3),
|
||||
Notes = Fake.Lorem.Sentence(null, 3),
|
||||
VendorSentToId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
VendorSentViaId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
RMANumber = "RMA" + Fake.Finance.Account(6),
|
||||
@@ -3339,7 +3328,7 @@ namespace AyaNova.Util
|
||||
for (int x = 0; x < count; x++)
|
||||
{
|
||||
Quote o = new Quote();
|
||||
o.Notes = Fake.Lorem.Sentence(null,6);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 6);
|
||||
o.Tags = RandomTags();
|
||||
if (Fake.Random.Bool())//50% have projects
|
||||
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
|
||||
@@ -3405,14 +3394,14 @@ namespace AyaNova.Util
|
||||
var woItemUnit = new QuoteItemUnit()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3)
|
||||
Notes = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Units.Add(woItemUnit);
|
||||
|
||||
woItemUnit = new QuoteItemUnit()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3)
|
||||
Notes = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Units.Add(woItemUnit);
|
||||
|
||||
@@ -3532,7 +3521,7 @@ namespace AyaNova.Util
|
||||
ServiceStartDate = woDate,
|
||||
ServiceStopDate = woDate.AddHours(1),
|
||||
ServiceRateId = Fake.Random.Long(1, TotalSeededServiceRates),
|
||||
ServiceDetails = Fake.Lorem.Sentence(null,3)
|
||||
ServiceDetails = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Labors.Add(woItemLabor);
|
||||
|
||||
@@ -3543,7 +3532,7 @@ namespace AyaNova.Util
|
||||
ServiceStartDate = woDate,
|
||||
ServiceStopDate = woDate.AddHours(1),
|
||||
ServiceRateId = Fake.Random.Long(1, TotalSeededServiceRates),
|
||||
ServiceDetails = Fake.Lorem.Sentence(null,3)
|
||||
ServiceDetails = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Labors.Add(woItemLabor);
|
||||
|
||||
@@ -3556,7 +3545,7 @@ namespace AyaNova.Util
|
||||
TravelStartDate = woDate,
|
||||
TravelStopDate = woDate.AddHours(1),
|
||||
TravelRateId = Fake.Random.Long(1, TotalSeededTravelRates),
|
||||
TravelDetails = Fake.Lorem.Sentence(null,3),
|
||||
TravelDetails = Fake.Lorem.Sentence(null, 3),
|
||||
Distance = Fake.Random.Int(1, 20)
|
||||
};
|
||||
woItem.Travels.Add(woItemTravel);
|
||||
@@ -3568,7 +3557,7 @@ namespace AyaNova.Util
|
||||
TravelStartDate = woDate,
|
||||
TravelStopDate = woDate.AddHours(1),
|
||||
TravelRateId = Fake.Random.Long(1, TotalSeededTravelRates),
|
||||
TravelDetails = Fake.Lorem.Sentence(null,3),
|
||||
TravelDetails = Fake.Lorem.Sentence(null, 3),
|
||||
Distance = Fake.Random.Int(1, 20)
|
||||
};
|
||||
woItem.Travels.Add(woItemTravel);
|
||||
@@ -3658,7 +3647,7 @@ namespace AyaNova.Util
|
||||
var woItemOutsideService = new QuoteItemOutsideService()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3),
|
||||
Notes = Fake.Lorem.Sentence(null, 3),
|
||||
VendorSentToId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
VendorSentViaId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
RMANumber = "RMA" + Fake.Finance.Account(6),
|
||||
@@ -3679,7 +3668,7 @@ namespace AyaNova.Util
|
||||
woItemOutsideService = new QuoteItemOutsideService()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3),
|
||||
Notes = Fake.Lorem.Sentence(null, 3),
|
||||
VendorSentToId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
VendorSentViaId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
RMANumber = "RMA" + Fake.Finance.Account(6),
|
||||
@@ -3755,7 +3744,7 @@ namespace AyaNova.Util
|
||||
for (int x = 0; x < count; x++)
|
||||
{
|
||||
PM o = new PM();
|
||||
o.Notes = Fake.Lorem.Sentence(null,3);
|
||||
o.Notes = Fake.Lorem.Sentence(null, 3);
|
||||
o.Tags = RandomTags();
|
||||
if (Fake.Random.Bool())//50% have projects
|
||||
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
|
||||
@@ -3834,14 +3823,14 @@ namespace AyaNova.Util
|
||||
var woItemUnit = new PMItemUnit()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3)
|
||||
Notes = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Units.Add(woItemUnit);
|
||||
|
||||
woItemUnit = new PMItemUnit()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3)
|
||||
Notes = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Units.Add(woItemUnit);
|
||||
|
||||
@@ -3961,7 +3950,7 @@ namespace AyaNova.Util
|
||||
ServiceStartDate = woDate,
|
||||
ServiceStopDate = woDate.AddHours(1),
|
||||
ServiceRateId = Fake.Random.Long(1, TotalSeededServiceRates),
|
||||
ServiceDetails = Fake.Lorem.Sentence(null,3)
|
||||
ServiceDetails = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Labors.Add(woItemLabor);
|
||||
|
||||
@@ -3972,7 +3961,7 @@ namespace AyaNova.Util
|
||||
ServiceStartDate = woDate,
|
||||
ServiceStopDate = woDate.AddHours(1),
|
||||
ServiceRateId = Fake.Random.Long(1, TotalSeededServiceRates),
|
||||
ServiceDetails = Fake.Lorem.Sentence(null,3)
|
||||
ServiceDetails = Fake.Lorem.Sentence(null, 3)
|
||||
};
|
||||
woItem.Labors.Add(woItemLabor);
|
||||
|
||||
@@ -3985,7 +3974,7 @@ namespace AyaNova.Util
|
||||
TravelStartDate = woDate,
|
||||
TravelStopDate = woDate.AddHours(1),
|
||||
TravelRateId = Fake.Random.Long(1, TotalSeededTravelRates),
|
||||
TravelDetails = Fake.Lorem.Sentence(null,3),
|
||||
TravelDetails = Fake.Lorem.Sentence(null, 3),
|
||||
Distance = Fake.Random.Int(1, 20)
|
||||
};
|
||||
woItem.Travels.Add(woItemTravel);
|
||||
@@ -3997,7 +3986,7 @@ namespace AyaNova.Util
|
||||
TravelStartDate = woDate,
|
||||
TravelStopDate = woDate.AddHours(1),
|
||||
TravelRateId = Fake.Random.Long(1, TotalSeededTravelRates),
|
||||
TravelDetails = Fake.Lorem.Sentence(null,3),
|
||||
TravelDetails = Fake.Lorem.Sentence(null, 3),
|
||||
Distance = Fake.Random.Int(1, 20)
|
||||
};
|
||||
woItem.Travels.Add(woItemTravel);
|
||||
@@ -4087,7 +4076,7 @@ namespace AyaNova.Util
|
||||
var woItemOutsideService = new PMItemOutsideService()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3),
|
||||
Notes = Fake.Lorem.Sentence(null, 3),
|
||||
VendorSentToId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
VendorSentViaId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
RMANumber = "RMA" + Fake.Finance.Account(6),
|
||||
@@ -4108,7 +4097,7 @@ namespace AyaNova.Util
|
||||
woItemOutsideService = new PMItemOutsideService()
|
||||
{
|
||||
UnitId = GetRandomUnitForCustomer(o.CustomerId),
|
||||
Notes = Fake.Lorem.Sentence(null,3),
|
||||
Notes = Fake.Lorem.Sentence(null, 3),
|
||||
VendorSentToId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
VendorSentViaId = Fake.Random.Long(1, TotalSeededVendors),
|
||||
RMANumber = "RMA" + Fake.Finance.Account(6),
|
||||
|
||||
Reference in New Issue
Block a user