This commit is contained in:
2020-05-18 18:33:53 +00:00
parent 7257b9ad0f
commit 646b3f21e5
10 changed files with 103 additions and 158 deletions

View File

@@ -8,6 +8,7 @@ PRIORITY - ALWAYS Lowest level stuff first
todo: usertype scheduleable? Or sb Service and nonScheduleble sb NonService and subcontractor sb ServiceContractor? todo: usertype scheduleable? Or sb Service and nonScheduleble sb NonService and subcontractor sb ServiceContractor?
will require some renaming of things but this is more logical and meets intended usage will require some renaming of things but this is more logical and meets intended usage
todo: Pick a consistent single letter lambda expression variable and standardize on it. todo: Pick a consistent single letter lambda expression variable and standardize on it.
one of X Y or Z is best as it doesn't trigger intellisense one of X Y or Z is best as it doesn't trigger intellisense
todo: OPS routes (SERVER AND CLIENT) todo: OPS routes (SERVER AND CLIENT)

View File

@@ -131,22 +131,22 @@ namespace AyaNova.Api.Controllers
} }
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(UserType).ToString()).ToLowerInvariant()) else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(UserType).ToString()).ToLowerInvariant())
{ {
TranslationKeysToFetch.Add("UserTypesAdministrator"); TranslationKeysToFetch.Add("UserTypeAdministrator");
TranslationKeysToFetch.Add("UserTypesSchedulable"); TranslationKeysToFetch.Add("UserTypeService");
TranslationKeysToFetch.Add("UserTypesNonSchedulable"); TranslationKeysToFetch.Add("UserTypeNotService");
TranslationKeysToFetch.Add("UserTypesCustomer"); TranslationKeysToFetch.Add("UserTypeCustomer");
TranslationKeysToFetch.Add("UserTypesHeadOffice"); TranslationKeysToFetch.Add("UserTypeHeadOffice");
TranslationKeysToFetch.Add("UserTypesSubContractor"); TranslationKeysToFetch.Add("UserTypesSubContractor");
TranslationKeysToFetch.Add("UserTypesUtility"); TranslationKeysToFetch.Add("UserTypeUtility");
var LT = TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, TranslationId).Result; var LT = TranslationBiz.GetSubsetStaticAsync(TranslationKeysToFetch, TranslationId).Result;
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesAdministrator"], Id = (long)UserType.Administrator }); ReturnList.Add(new NameIdItem() { Name = LT["UserTypeAdministrator"], Id = (long)UserType.Administrator });
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesSchedulable"], Id = (long)UserType.Schedulable }); ReturnList.Add(new NameIdItem() { Name = LT["UserTypeService"], Id = (long)UserType.Service });
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesNonSchedulable"], Id = (long)UserType.NonSchedulable }); ReturnList.Add(new NameIdItem() { Name = LT["UserTypeNotService"], Id = (long)UserType.NotService });
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesCustomer"], Id = (long)UserType.Customer }); ReturnList.Add(new NameIdItem() { Name = LT["UserTypeCustomer"], Id = (long)UserType.Customer });
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesHeadOffice"], Id = (long)UserType.HeadOffice }); ReturnList.Add(new NameIdItem() { Name = LT["UserTypeHeadOffice"], Id = (long)UserType.HeadOffice });
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesUtility"], Id = (long)UserType.Utility }); ReturnList.Add(new NameIdItem() { Name = LT["UserTypeUtility"], Id = (long)UserType.Utility });
ReturnList.Add(new NameIdItem() { Name = LT["UserTypesSubContractor"], Id = (long)UserType.Subcontractor }); ReturnList.Add(new NameIdItem() { Name = LT["UserTypesSubContractor"], Id = (long)UserType.ServiceContractor });
} }
else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()).ToLowerInvariant()) else if (keyNameInLowerCase == StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()).ToLowerInvariant())
{ {

View File

@@ -33,8 +33,8 @@ namespace AyaNova.Biz
{ {
var ct = ServiceProviderProvider.DBContext; var ct = ServiceProviderProvider.DBContext;
var ret = await ct.User.Where(x => x.Active == true && ( var ret = await ct.User.Where(x => x.Active == true && (
x.UserType == UserType.Schedulable || x.UserType == UserType.Service ||
x.UserType == UserType.Subcontractor)).LongCountAsync(); x.UserType == UserType.ServiceContractor)).LongCountAsync();
return ret; return ret;
} }
@@ -466,7 +466,7 @@ namespace AyaNova.Biz
} }
//Validate headoffice type user //Validate headoffice type user
if (!SeedOrImportRelaxedRulesMode && proposedObj.UserType == UserType.Subcontractor) if (!SeedOrImportRelaxedRulesMode && proposedObj.UserType == UserType.ServiceContractor)
{ {
if (proposedObj.SubVendorId == null || proposedObj.SubVendorId == 0) if (proposedObj.SubVendorId == null || proposedObj.SubVendorId == 0)
{ {

View File

@@ -1,72 +1,16 @@
namespace AyaNova.Biz namespace AyaNova.Biz
{ {
/// <summary> /// <summary>
/// All AyaNova user types /// AyaNova User types
/// </summary> /// </summary>
public enum UserType : int public enum UserType : int
{ {
Administrator = 1, Administrator = 1,
Schedulable = 2, Service = 2,
NonSchedulable = 3, NotService = 3,
Customer = 4, Customer = 4,
HeadOffice = 5, HeadOffice = 5,
Utility = 6, Utility = 6,
Subcontractor = 7 ServiceContractor = 7
} }
}//eons }//eons
/*
///////////////////////////////////////////////////////////
// UserTypes.cs
// Implementation of Class UserTypes
// CSLA type: enumeration
// Created on: 07-Jun-2004 8:41:44 AM
// Object design: Joyce
///////////////////////////////////////////////////////////
using System.ComponentModel;
namespace GZTW.AyaNova.BLL {
/// <summary>
/// Variations of <see cref="User"/> types
/// </summary>
public enum UserTypes : int {
/// <summary>
/// This is the special account used only for updates, for customizing layout, etc
/// </summary>
[Description("LT:UserTypes.Label.Administrator")] Administrator = 1,
/// <summary>
/// This is a user that can be assigned to a workorder or schedule and consumes an AyaNova license
/// </summary>
[Description("LT:UserTypes.Label.Schedulable")] Schedulable = 2,
/// <summary>
/// Standard user that can use all aspects of AyaNova but can not be chosen to assign to a work order or schedule
/// Does not consume an AyaNova license
/// </summary>
[Description("LT:UserTypes.Label.NonSchedulable")] NonSchedulable = 3,
/// <summary>
/// Client's login user account for WBI
/// </summary>
[Description("LT:UserTypes.Label.Client")] Client = 4,
/// <summary>
/// HeadOffice's login user account for WBI
/// </summary>
[Description("LT:UserTypes.Label.HeadOffice")] HeadOffice = 5,
/// <summary>
/// Utility user type for internal processing with limited functionality
/// ATTN. API users: Do not create or set a user to this type in your code, you will be dissapointed and will break things. :)
/// </summary>
[Description("UTILITY")] Utility = 6
//*** IF MORE ADDED USER OBJECT USERTYPE PROPERTIES
// BROKEN RULES MUST BE UPDATED AND SQL SERVER USER TABLE CHECK CONSTRAINT
// FOR USERTYPE VALUE ***
}//end UserTypes
}//end namespace GZTW.AyaNova.BLL
*/

View File

@@ -83,7 +83,7 @@ namespace AyaNova.Models
{ {
get get
{ {
return this.UserType == UserType.Subcontractor || this.UserType == UserType.Schedulable; return this.UserType == UserType.ServiceContractor || this.UserType == UserType.Service;
} }
} }

View File

@@ -1212,12 +1212,12 @@
"UserSkillDescription": "Beschreibung", "UserSkillDescription": "Beschreibung",
"UserSkillList": "Benutzerfähigkeiten", "UserSkillList": "Benutzerfähigkeiten",
"UserSkillName": "Benutzerfähigkeit - Name", "UserSkillName": "Benutzerfähigkeit - Name",
"UserTypesAdministrator": "Administrator", "UserTypeAdministrator": "Administrator",
"UserTypesCustomer": "Benutzer beim Kunden", "UserTypeCustomer": "Benutzer beim Kunden",
"UserTypesHeadOffice": "Benutzer am Hauptsitz des Kunden", "UserTypeHeadOffice": "Benutzer am Hauptsitz des Kunden",
"UserTypesNonSchedulable": "Nicht planbarer Benutzer", "UserTypeNotService": "Nicht planbarer Benutzer",
"UserTypesSchedulable": "Planbarer Benutzer", "UserTypeService": "Planbarer Benutzer",
"UserTypesUtility": "Dienstprogrammkonto", "UserTypeUtility": "Dienstprogrammkonto",
"VendorAccountNumber": "Kontonummer", "VendorAccountNumber": "Kontonummer",
"VendorContact": "Contact", "VendorContact": "Contact",
"VendorContactNotes": "Other contacts", "VendorContactNotes": "Other contacts",

View File

@@ -1212,12 +1212,12 @@
"UserSkillDescription": "Description", "UserSkillDescription": "Description",
"UserSkillList": "User Skills", "UserSkillList": "User Skills",
"UserSkillName": "User Skill Name", "UserSkillName": "User Skill Name",
"UserTypesAdministrator": "Administrator user", "UserTypeAdministrator": "Administrator user",
"UserTypesCustomer": "Customer user", "UserTypeCustomer": "Customer user",
"UserTypesHeadOffice": "Head office user", "UserTypeHeadOffice": "Head office user",
"UserTypesNonSchedulable": "Non-schedulable user", "UserTypeNotService": "Non-schedulable user",
"UserTypesSchedulable": "Schedulable user", "UserTypeService": "Schedulable user",
"UserTypesUtility": "Utility account", "UserTypeUtility": "Utility account",
"VendorAccountNumber": "Account Number", "VendorAccountNumber": "Account Number",
"VendorContact": "Contact", "VendorContact": "Contact",
"VendorContactNotes": "Other contacts", "VendorContactNotes": "Other contacts",

View File

@@ -1212,12 +1212,12 @@
"UserSkillDescription": "Descripción", "UserSkillDescription": "Descripción",
"UserSkillList": "Habilidades del usuario", "UserSkillList": "Habilidades del usuario",
"UserSkillName": "Nombre habilidad de usuario", "UserSkillName": "Nombre habilidad de usuario",
"UserTypesAdministrator": "Usuario administrador", "UserTypeAdministrator": "Usuario administrador",
"UserTypesCustomer": "Usuario cliente", "UserTypeCustomer": "Usuario cliente",
"UserTypesHeadOffice": "Usuario cliente de sede", "UserTypeHeadOffice": "Usuario cliente de sede",
"UserTypesNonSchedulable": "Usuario no programable", "UserTypeNotService": "Usuario no programable",
"UserTypesSchedulable": "Usuario programable", "UserTypeService": "Usuario programable",
"UserTypesUtility": "Cuenta de utilidad", "UserTypeUtility": "Cuenta de utilidad",
"VendorAccountNumber": "Número de cuenta", "VendorAccountNumber": "Número de cuenta",
"VendorContact": "Contact", "VendorContact": "Contact",
"VendorContactNotes": "Other contacts", "VendorContactNotes": "Other contacts",

View File

@@ -1212,12 +1212,12 @@
"UserSkillDescription": "Description", "UserSkillDescription": "Description",
"UserSkillList": "Aptitudes d'utilisateur", "UserSkillList": "Aptitudes d'utilisateur",
"UserSkillName": "Nom d'aptitude d'utilisateur", "UserSkillName": "Nom d'aptitude d'utilisateur",
"UserTypesAdministrator": "Utilisateur administrateur", "UserTypeAdministrator": "Utilisateur administrateur",
"UserTypesCustomer": "Utilisateur client", "UserTypeCustomer": "Utilisateur client",
"UserTypesHeadOffice": "Utilisateur client de siège social", "UserTypeHeadOffice": "Utilisateur client de siège social",
"UserTypesNonSchedulable": "Utilisateur non programmable", "UserTypeNotService": "Utilisateur non programmable",
"UserTypesSchedulable": "Utilisateur programmable", "UserTypeService": "Utilisateur programmable",
"UserTypesUtility": "Compte utilitaire", "UserTypeUtility": "Compte utilitaire",
"VendorAccountNumber": "Numéro de compte", "VendorAccountNumber": "Numéro de compte",
"VendorContact": "Contact", "VendorContact": "Contact",
"VendorContactNotes": "Other contacts", "VendorContactNotes": "Other contacts",

View File

@@ -208,10 +208,10 @@ namespace AyaNova.Util
var watch = new Stopwatch(); var watch = new Stopwatch();
watch.Start(); watch.Start();
//Generate owner and lead tech //Generate owner and lead tech
await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminFull | AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryFull | AuthorizationRoles.OpsAdminFull, UserType.Schedulable); await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminFull | AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryFull | AuthorizationRoles.OpsAdminFull, UserType.Service);
//Generate one office person / secretary //Generate one office person / secretary
await GenSeedUserAsync(log, 1, AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryFull | AuthorizationRoles.AccountingFull, UserType.NonSchedulable); await GenSeedUserAsync(log, 1, AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryFull | AuthorizationRoles.AccountingFull, UserType.NotService);
//PERF //PERF
watch.Stop(); watch.Stop();
await LogStatusAsync(JobId, LogJob, log, $"{SeededUserCount} Users seeded in {watch.ElapsedMilliseconds} ms"); await LogStatusAsync(JobId, LogJob, log, $"{SeededUserCount} Users seeded in {watch.ElapsedMilliseconds} ms");
@@ -238,34 +238,34 @@ namespace AyaNova.Util
var watch = new Stopwatch(); var watch = new Stopwatch();
watch.Start(); watch.Start();
//One IT administrator, can change ops but nothing else //One IT administrator, can change ops but nothing else
await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminFull, UserType.NonSchedulable); await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminFull, UserType.NotService);
//One business administrator, can view ops issues //One business administrator, can view ops issues
await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminLimited, UserType.NotService);
//One owner who doesn't control anything but views stuff //One owner who doesn't control anything but views stuff
await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminLimited | AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited | AuthorizationRoles.OpsAdminLimited | AuthorizationRoles.SalesLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminLimited | AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited | AuthorizationRoles.OpsAdminLimited | AuthorizationRoles.SalesLimited, UserType.NotService);
//20 techs //20 techs
await GenSeedUserAsync(log, 20, AuthorizationRoles.TechFull | AuthorizationRoles.DispatchLimited, UserType.Schedulable); await GenSeedUserAsync(log, 20, AuthorizationRoles.TechFull | AuthorizationRoles.DispatchLimited, UserType.Service);
//2 subcontractors //2 subcontractors
await GenSeedUserAsync(log, 2, AuthorizationRoles.SubContractorFull, UserType.Subcontractor); await GenSeedUserAsync(log, 2, AuthorizationRoles.SubContractorFull, UserType.ServiceContractor);
//3 generic office people people //3 generic office people people
await GenSeedUserAsync(log, 3, AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 3, AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited, UserType.NotService);
//2 Full sales people //2 Full sales people
await GenSeedUserAsync(log, 2, AuthorizationRoles.SalesFull, UserType.NonSchedulable); await GenSeedUserAsync(log, 2, AuthorizationRoles.SalesFull, UserType.NotService);
//1 dispatch manager //1 dispatch manager
await GenSeedUserAsync(log, 1, AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 1, AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryLimited, UserType.NotService);
//1 Inventory manager //1 Inventory manager
await GenSeedUserAsync(log, 1, AuthorizationRoles.InventoryFull | AuthorizationRoles.DispatchLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 1, AuthorizationRoles.InventoryFull | AuthorizationRoles.DispatchLimited, UserType.NotService);
//1 accountant / bookkeeper //1 accountant / bookkeeper
await GenSeedUserAsync(log, 1, AuthorizationRoles.AccountingFull | AuthorizationRoles.BizAdminLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 1, AuthorizationRoles.AccountingFull | AuthorizationRoles.BizAdminLimited, UserType.NotService);
//10 full on customer users //10 full on customer users
await GenSeedUserAsync(log, 10, AuthorizationRoles.CustomerLimited, UserType.Customer); await GenSeedUserAsync(log, 10, AuthorizationRoles.CustomerLimited, UserType.Customer);
@@ -302,46 +302,46 @@ namespace AyaNova.Util
watch.Start(); watch.Start();
//IT administrator, can change ops but nothing else //IT administrator, can change ops but nothing else
await GenSeedUserAsync(log, 2, AuthorizationRoles.OpsAdminFull, UserType.NonSchedulable); await GenSeedUserAsync(log, 2, AuthorizationRoles.OpsAdminFull, UserType.NotService);
//business administrator, can view ops issues //business administrator, can view ops issues
await GenSeedUserAsync(log, 2, AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 2, AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminLimited, UserType.NotService);
//owner / upper management who doesn't control anything but views stuff //owner / upper management who doesn't control anything but views stuff
await GenSeedUserAsync(log, 5, AuthorizationRoles.BizAdminLimited | AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited | AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 5, AuthorizationRoles.BizAdminLimited | AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited | AuthorizationRoles.OpsAdminLimited, UserType.NotService);
//100 techs //100 techs
await GenSeedUserAsync(log, 100, AuthorizationRoles.TechFull | AuthorizationRoles.DispatchLimited, UserType.Schedulable); await GenSeedUserAsync(log, 100, AuthorizationRoles.TechFull | AuthorizationRoles.DispatchLimited, UserType.Service);
//limited techs //limited techs
await GenSeedUserAsync(log, 50, AuthorizationRoles.TechLimited | AuthorizationRoles.DispatchLimited, UserType.Schedulable); await GenSeedUserAsync(log, 50, AuthorizationRoles.TechLimited | AuthorizationRoles.DispatchLimited, UserType.Service);
//20 subcontractors //20 subcontractors
await GenSeedUserAsync(log, 20, AuthorizationRoles.SubContractorFull, UserType.Subcontractor); await GenSeedUserAsync(log, 20, AuthorizationRoles.SubContractorFull, UserType.ServiceContractor);
//10 limited subcontractors //10 limited subcontractors
await GenSeedUserAsync(log, 10, AuthorizationRoles.SubContractorLimited, UserType.Subcontractor); await GenSeedUserAsync(log, 10, AuthorizationRoles.SubContractorLimited, UserType.ServiceContractor);
//30 generic office people people //30 generic office people people
await GenSeedUserAsync(log, 30, AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 30, AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited, UserType.NotService);
//10 Full sales people //10 Full sales people
await GenSeedUserAsync(log, 10, AuthorizationRoles.SalesFull, UserType.NonSchedulable); await GenSeedUserAsync(log, 10, AuthorizationRoles.SalesFull, UserType.NotService);
//5 Limited sales people //5 Limited sales people
await GenSeedUserAsync(log, 5, AuthorizationRoles.SalesLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 5, AuthorizationRoles.SalesLimited, UserType.NotService);
//5 dispatch manager //5 dispatch manager
await GenSeedUserAsync(log, 5, AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 5, AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryLimited, UserType.NotService);
//5 Inventory manager //5 Inventory manager
await GenSeedUserAsync(log, 5, AuthorizationRoles.InventoryFull | AuthorizationRoles.DispatchLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 5, AuthorizationRoles.InventoryFull | AuthorizationRoles.DispatchLimited, UserType.NotService);
//10 Inventory manager assistants //10 Inventory manager assistants
await GenSeedUserAsync(log, 5, AuthorizationRoles.InventoryLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 5, AuthorizationRoles.InventoryLimited, UserType.NotService);
//5 accountant / bookkeeper //5 accountant / bookkeeper
await GenSeedUserAsync(log, 5, AuthorizationRoles.AccountingFull | AuthorizationRoles.BizAdminLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 5, AuthorizationRoles.AccountingFull | AuthorizationRoles.BizAdminLimited, UserType.NotService);
//100 full on customer users //100 full on customer users
await GenSeedUserAsync(log, 20, AuthorizationRoles.CustomerFull, UserType.Customer); await GenSeedUserAsync(log, 20, AuthorizationRoles.CustomerFull, UserType.Customer);
@@ -379,46 +379,46 @@ namespace AyaNova.Util
watch.Start(); watch.Start();
//IT administrator, can change ops but nothing else //IT administrator, can change ops but nothing else
await GenSeedUserAsync(log, 10, AuthorizationRoles.OpsAdminFull, UserType.NonSchedulable); await GenSeedUserAsync(log, 10, AuthorizationRoles.OpsAdminFull, UserType.NotService);
//business administrator, can view ops issues //business administrator, can view ops issues
await GenSeedUserAsync(log, 10, AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 10, AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminLimited, UserType.NotService);
//owner / upper management who doesn't control anything but views stuff //owner / upper management who doesn't control anything but views stuff
await GenSeedUserAsync(log, 20, AuthorizationRoles.BizAdminLimited | AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited | AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 20, AuthorizationRoles.BizAdminLimited | AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited | AuthorizationRoles.OpsAdminLimited, UserType.NotService);
//regular techs //regular techs
await GenSeedUserAsync(log, 500, AuthorizationRoles.TechFull | AuthorizationRoles.DispatchLimited, UserType.Schedulable); await GenSeedUserAsync(log, 500, AuthorizationRoles.TechFull | AuthorizationRoles.DispatchLimited, UserType.Service);
//limited techs //limited techs
await GenSeedUserAsync(log, 200, AuthorizationRoles.TechLimited | AuthorizationRoles.DispatchLimited, UserType.Schedulable); await GenSeedUserAsync(log, 200, AuthorizationRoles.TechLimited | AuthorizationRoles.DispatchLimited, UserType.Service);
//subcontractors //subcontractors
await GenSeedUserAsync(log, 80, AuthorizationRoles.SubContractorFull, UserType.Subcontractor); await GenSeedUserAsync(log, 80, AuthorizationRoles.SubContractorFull, UserType.ServiceContractor);
//limited subcontractors //limited subcontractors
await GenSeedUserAsync(log, 40, AuthorizationRoles.SubContractorLimited, UserType.Subcontractor); await GenSeedUserAsync(log, 40, AuthorizationRoles.SubContractorLimited, UserType.ServiceContractor);
//generic office people people //generic office people people
await GenSeedUserAsync(log, 200, AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 200, AuthorizationRoles.DispatchLimited | AuthorizationRoles.InventoryLimited, UserType.NotService);
//20 Full sales people //20 Full sales people
await GenSeedUserAsync(log, 20, AuthorizationRoles.SalesFull, UserType.NonSchedulable); await GenSeedUserAsync(log, 20, AuthorizationRoles.SalesFull, UserType.NotService);
//10 Limited sales people //10 Limited sales people
await GenSeedUserAsync(log, 10, AuthorizationRoles.SalesLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 10, AuthorizationRoles.SalesLimited, UserType.NotService);
//dispatch manager //dispatch manager
await GenSeedUserAsync(log, 20, AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 20, AuthorizationRoles.DispatchFull | AuthorizationRoles.InventoryLimited, UserType.NotService);
//Inventory manager //Inventory manager
await GenSeedUserAsync(log, 40, AuthorizationRoles.InventoryFull | AuthorizationRoles.DispatchLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 40, AuthorizationRoles.InventoryFull | AuthorizationRoles.DispatchLimited, UserType.NotService);
//Inventory manager assistants //Inventory manager assistants
await GenSeedUserAsync(log, 20, AuthorizationRoles.InventoryLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 20, AuthorizationRoles.InventoryLimited, UserType.NotService);
//accountant / bookkeeper //accountant / bookkeeper
await GenSeedUserAsync(log, 20, AuthorizationRoles.AccountingFull | AuthorizationRoles.BizAdminLimited, UserType.NonSchedulable); await GenSeedUserAsync(log, 20, AuthorizationRoles.AccountingFull | AuthorizationRoles.BizAdminLimited, UserType.NotService);
//full on customer users //full on customer users
await GenSeedUserAsync(log, 200, AuthorizationRoles.CustomerFull, UserType.Customer); await GenSeedUserAsync(log, 200, AuthorizationRoles.CustomerFull, UserType.Customer);
@@ -499,32 +499,32 @@ namespace AyaNova.Util
KnownUserTags.Add("test-role-user"); KnownUserTags.Add("test-role-user");
//TEST USERS //TEST USERS
//one of each role type //one of each role type
await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminLimited, UserType.NonSchedulable, "BizAdminLimited", "BizAdminLimited", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminLimited, UserType.NotService, "BizAdminLimited", "BizAdminLimited", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminFull, UserType.NonSchedulable, "BizAdminFull", "BizAdminFull", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminFull, UserType.NotService, "BizAdminFull", "BizAdminFull", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.DispatchLimited, UserType.NonSchedulable, "DispatchLimited", "DispatchLimited", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.DispatchLimited, UserType.NotService, "DispatchLimited", "DispatchLimited", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.DispatchFull, UserType.NonSchedulable, "DispatchFull", "DispatchFull", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.DispatchFull, UserType.NotService, "DispatchFull", "DispatchFull", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.InventoryLimited, UserType.NonSchedulable, "InventoryLimited", "InventoryLimited", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.InventoryLimited, UserType.NotService, "InventoryLimited", "InventoryLimited", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.InventoryFull, UserType.NonSchedulable, "InventoryFull", "InventoryFull", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.InventoryFull, UserType.NotService, "InventoryFull", "InventoryFull", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.AccountingFull, UserType.NonSchedulable, "Accounting", "Accounting", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.AccountingFull, UserType.NotService, "Accounting", "Accounting", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.TechLimited, UserType.Schedulable, "TechLimited", "TechLimited", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.TechLimited, UserType.Service, "TechLimited", "TechLimited", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.TechFull, UserType.Schedulable, "TechFull", "TechFull", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.TechFull, UserType.Service, "TechFull", "TechFull", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.SalesLimited, UserType.NonSchedulable, "SalesLimited", "SalesLimited", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.SalesLimited, UserType.NotService, "SalesLimited", "SalesLimited", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.SalesFull, UserType.NonSchedulable, "SalesFull", "SalesFull", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.SalesFull, UserType.NotService, "SalesFull", "SalesFull", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.SubContractorLimited, UserType.Subcontractor, "SubContractorLimited", "SubContractorLimited", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.SubContractorLimited, UserType.ServiceContractor, "SubContractorLimited", "SubContractorLimited", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.SubContractorFull, UserType.Subcontractor, "SubContractorFull", "SubContractorFull", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.SubContractorFull, UserType.ServiceContractor, "SubContractorFull", "SubContractorFull", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.CustomerLimited, UserType.Customer, "CustomerLimited", "CustomerLimited", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.CustomerLimited, UserType.Customer, "CustomerLimited", "CustomerLimited", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.CustomerFull, UserType.Customer, "CustomerFull", "CustomerFull", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.CustomerFull, UserType.Customer, "CustomerFull", "CustomerFull", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.CustomerFull, UserType.HeadOffice, "HeadOffice", "HeadOffice", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.CustomerFull, UserType.HeadOffice, "HeadOffice", "HeadOffice", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable, "OpsAdminLimited", "OpsAdminLimited", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NotService, "OpsAdminLimited", "OpsAdminLimited", KnownUserTags);
await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminFull, UserType.NonSchedulable, "OpsAdminFull", "OpsAdminFull", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminFull, UserType.NotService, "OpsAdminFull", "OpsAdminFull", KnownUserTags);
//PRIVACY TEST USER - this is used for a test to see if user info leaks into the logs //PRIVACY TEST USER - this is used for a test to see if user info leaks into the logs
await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable, "TEST_PRIVACY_USER_ACCOUNT", "TEST_PRIVACY_USER_ACCOUNT", KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, 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 //TEST NOT ACTIVE - this is used for a test to see if inactive user can login
await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NonSchedulable, false, "TEST_INACTIVE", "TEST_INACTIVE", 0, KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.OpsAdminLimited, UserType.NotService, false, "TEST_INACTIVE", "TEST_INACTIVE", 0, KnownUserTags);
//Alternate translation users for each stock translation //Alternate translation users for each stock translation
await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "de", "de", await TranslationBiz.TranslationNameToIdStaticAsync("de"), KnownUserTags); await GenSeedUserAsync(log, 1, AuthorizationRoles.All, UserType.Administrator, true, "de", "de", await TranslationBiz.TranslationNameToIdStaticAsync("de"), KnownUserTags);