diff --git a/server/AyaNova/util/Seeder.cs b/server/AyaNova/util/Seeder.cs index c4d4eaee..d5a73f83 100644 --- a/server/AyaNova/util/Seeder.cs +++ b/server/AyaNova/util/Seeder.cs @@ -498,7 +498,9 @@ namespace AyaNova.Util { try { - + var KnownUserTags=new List(); + KnownUserTags.Add("known-user"); + KnownUserTags.Add("test-role-user"); //TEST USERS //one of each role type await GenSeedUserAsync(log, 1, AuthorizationRoles.BizAdminLimited, UserType.NonSchedulable, "BizAdminLimited", "BizAdminLimited"); @@ -545,18 +547,12 @@ namespace AyaNova.Util /// /// Generate seed user with active=true /// (override to save typing) - /// - /// - /// - /// - /// - /// - /// - public static async Task GenSeedUserAsync(ILogger log, int count, AuthorizationRoles roles, UserType userType, string login, string password) + /// + public static async Task GenSeedUserAsync(ILogger log, int count, AuthorizationRoles roles, UserType userType, string login, string password, List tags = null) { try { - await GenSeedUserAsync(log, count, roles, userType, true, login, password); + await GenSeedUserAsync(log, count, roles, userType, true, login, password, 0, tags); } catch { @@ -567,7 +563,7 @@ namespace AyaNova.Util public static async Task GenSeedUserAsync(ILogger log, int count, AuthorizationRoles roles, UserType userType, - bool active = true, string login = null, string password = null, long translationId = 0) + bool active = true, string login = null, string password = null, long translationId = 0, List tags = null) { if (translationId == 0) translationId = ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID; @@ -604,9 +600,13 @@ namespace AyaNova.Util u.UserType = userType; u.EmployeeNumber = "A-" + (454 + SeededUserCount).ToString() + "-Y"; - u.Notes = Fake.Lorem.Sentence();//Fake.Lorem.Paragraph(2); - //TODO: After have USER and HEADOFFICE and VENDOR, if usertype is subcontractor or client or headoffice it needs to set a corresponding user's parent org record id to go with it - u.Tags = RandomTags(Fake); + u.Notes = Fake.Lorem.Sentence();//Fake.Lorem.Paragraph(2); + //TODO: After have USER and HEADOFFICE and VENDOR, if usertype is subcontractor or client or headoffice it needs to set a corresponding user's parent org record id to go with it + //use provided tags or generate them + if (tags == null) + u.Tags = RandomTags(Fake); + else + u.Tags = tags; //Children and relations u.UserOptions = new UserOptions(); u.UserOptions.TranslationId = translationId;