This commit is contained in:
2021-07-26 19:41:31 +00:00
parent cd56594286
commit c5a5f102ab
3 changed files with 76 additions and 30 deletions

View File

@@ -579,7 +579,7 @@ namespace AyaNova.Util
KnownUserTechRestrictedId = await SeedUserAsync(log, 1, AuthorizationRoles.TechRestricted, UserType.Service, "TechRestricted", "TechRestricted", KnownUserTags);
KnownUserTechId = await SeedUserAsync(log, 1, AuthorizationRoles.Tech, UserType.Service, "Tech", "Tech", KnownUserTags);
await SeedUserAsync(log, 1, AuthorizationRoles.SalesRestricted, UserType.NotService, "SalesRestricted", "SalesRestricted", KnownUserTags);
await SeedUserAsync(log, 1, AuthorizationRoles.Sales, UserType.NotService, "Sales", "Sales", KnownUserTags);
KnownUserSalesId = await SeedUserAsync(log, 1, AuthorizationRoles.Sales, UserType.NotService, "Sales", "Sales", KnownUserTags);
@@ -1692,6 +1692,7 @@ namespace AyaNova.Util
public long KnownUserCustomerId = 0;
public long KnownUserCustomerRestrictedId = 0;
public long KnownCustomerForShadownUnitsId = 0;
public long KnownUserSalesId = 0;
public async Task<long> SeedUserAsync(
@@ -2770,6 +2771,15 @@ namespace AyaNova.Util
return ServiceUserIds[Fake.Random.Int(1, ServiceUserIds.Count - 1)];
}
/*
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗
██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝ ██╔═══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗
██║ █╗ ██║██║ ██║██████╔╝█████╔╝█████╗██║ ██║██████╔╝██║ ██║█████╗ ██████╔╝
██║███╗██║██║ ██║██╔══██╗██╔═██╗╚════╝██║ ██║██╔══██╗██║ ██║██╔══╝ ██╔══██╗
╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗ ╚██████╔╝██║ ██║██████╔╝███████╗██║ ██║
╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝
*/
private int TotalSeededWorkOrders = 0;
//////////////////////////////////////////////////////
//WORK ORDER
@@ -3239,8 +3249,15 @@ namespace AyaNova.Util
//--------------------- QUOTE --------------------------
/*
██████╗ ██╗ ██╗ ██████╗ ████████╗███████╗
██╔═══██╗██║ ██║██╔═══██╗╚══██╔══╝██╔════╝
██║ ██║██║ ██║██║ ██║ ██║ █████╗
██║▄▄ ██║██║ ██║██║ ██║ ██║ ██╔══╝
╚██████╔╝╚██████╔╝╚██████╔╝ ██║ ███████╗
╚══▀▀═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝
*/
private int TotalSeededQuotes = 0;
//////////////////////////////////////////////////////
//Quote
@@ -3261,8 +3278,8 @@ namespace AyaNova.Util
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0));
o.CreatedDate = woDate > DateTime.UtcNow ? DateTime.UtcNow : woDate;//no created dates in future but want a range of past dates to show off age of wo
// o.CompleteByDate = woDate.AddDays(5);
// o.CustomerContactName = "contact name here";
o.Requested = woDate.AddDays(-2);
o.PreparedById = KnownUserSalesId;
o.CustomerId = GetRandomCustomerId();//Fake.Random.Long(1, TotalSeededCustomers);
using (AyContext ct = ServiceProviderProvider.DBContext)
@@ -3620,6 +3637,7 @@ namespace AyaNova.Util
Created = woDate.AddMinutes(5)
};
o.States.Add(WoState);
o.LastStatusId = WoState.QuoteStatusId;
}