diff --git a/devdocs/coding-standards.txt b/devdocs/coding-standards.txt index d8cdebf8..6c453c9c 100644 --- a/devdocs/coding-standards.txt +++ b/devdocs/coding-standards.txt @@ -1,5 +1,10 @@ # “Do the simplest thing that will work.” +//COMMENT FLAGS: +//TODO: means something that needs to be done but is awaiting something else. This is a *MUST* do. +//LOOKAT: means something that I want to think about and revisit later but is not urgent +//BEFORE_RELEASE: means something that MUST be changed before release, usually special debugging code for development or testing + Error messages / Numbers diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 07fff4a6..33d75cc9 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -22,9 +22,6 @@ Overall plan for now: anything standing in the way of making the initial client - v7importusers (on hold?) - Mostly done for now with the exception of client id and headoffice id which await the client and headoffice objects respectively and their importers - - Why are inactive users allowed to login? - - Seed data is seeding users inactive, sb active - - USER OBJECT - Check biz rules in v7 for anything that might be missed in RAVEN biz rules - NEED a document with checklist to go over to ensure that a v7 object ported to RAVEN is "DONE" i.e. not missing any biz rules or properties or something diff --git a/server/AyaNova/Controllers/AttachmentController.cs b/server/AyaNova/Controllers/AttachmentController.cs index 9e75d54d..2be62cc1 100644 --- a/server/AyaNova/Controllers/AttachmentController.cs +++ b/server/AyaNova/Controllers/AttachmentController.cs @@ -61,7 +61,7 @@ namespace AyaNova.Api.Controllers - //TODO: Centralize this code somewhere else, it's going to be needed for backup as well + //LOOKAT: Centralize this code somewhere else, it's going to be needed for backup as well //consider the 1 hour thing, is this legit depending on client? /// diff --git a/server/AyaNova/Controllers/BackupController.cs b/server/AyaNova/Controllers/BackupController.cs index 1e2217b8..90b4f20e 100644 --- a/server/AyaNova/Controllers/BackupController.cs +++ b/server/AyaNova/Controllers/BackupController.cs @@ -72,7 +72,7 @@ namespace AyaNova.Api.Controllers } /* -TODO: +LOOKAT: A backup archive consists of a similar format to the v7 data dumper utility, json file per object in subdirectories corresponding to object type all in a zip archive Route to trigger restore from selected file diff --git a/server/AyaNova/Controllers/ImportAyaNova7Controller.cs b/server/AyaNova/Controllers/ImportAyaNova7Controller.cs index c220f569..f8caf17c 100644 --- a/server/AyaNova/Controllers/ImportAyaNova7Controller.cs +++ b/server/AyaNova/Controllers/ImportAyaNova7Controller.cs @@ -236,7 +236,7 @@ namespace AyaNova.Api.Controllers } //UPDATE: I think it should be ok so commenting this out for now pending something coming up in testing -// //TODO: I decided not to allow trial to import v7 data. +// //LOOKAT: I decided not to allow trial to import v7 data. // //This was a snap decision, I didn't think about it much other than // //I'm concerned right now as of April 17 2018 during development that // //a trial user will import their old AyaNova data and then ... well somehow continue to use it I guess, diff --git a/server/AyaNova/biz/ImportAyaNova7Biz.cs b/server/AyaNova/biz/ImportAyaNova7Biz.cs index 1aa0babb..31fa34b0 100644 --- a/server/AyaNova/biz/ImportAyaNova7Biz.cs +++ b/server/AyaNova/biz/ImportAyaNova7Biz.cs @@ -132,12 +132,12 @@ namespace AyaNova.Biz //Now can do user locale settings properly await DoImport("GZTW.AyaNova.BLL.User", "locale", AyaType.User, job.GId, importMap, importFileName, zipEntries); - //CLIENT + //TODO: CLIENT //do import for client here //Now can do user client settings properly //await DoImport("GZTW.AyaNova.BLL.User","clientid", AyaType.User, job.GId, importMap, importFileName, zipEntries); - //HEADOFFICE + //TODO: HEADOFFICE //do import for ho here //Now can do user ho settings properly //await DoImport("GZTW.AyaNova.BLL.User","headofficeid", AyaType.User, job.GId, importMap, importFileName, zipEntries); @@ -146,8 +146,6 @@ namespace AyaNova.Biz - //TODO: second pass now that all objects are in the db, need to go through again and set properties based on all imported data, e.g. scheduleableUserGroups are tags that must now be set on users - //---------------- JobsBiz.LogJob(job.GId, "ImportAyaNova7 finished", ct); JobsBiz.UpdateJobStatus(job.GId, JobStatus.Completed, ct); diff --git a/server/AyaNova/biz/JobsBiz.cs b/server/AyaNova/biz/JobsBiz.cs index e38def8b..a9ee0188 100644 --- a/server/AyaNova/biz/JobsBiz.cs +++ b/server/AyaNova/biz/JobsBiz.cs @@ -297,7 +297,7 @@ namespace AyaNova.Biz } //Get a list of non-exlusive jobs that are due - //TODO: Parallelize / background this block + //LOOKAT: Parallelize / background this block //http://www.dotnetcurry.com/dotnet/1360/concurrent-programming-dotnet-core //var backgroundTask = Task.Run(() => DoComplexCalculation(42)); diff --git a/server/AyaNova/biz/TagBiz.cs b/server/AyaNova/biz/TagBiz.cs index c9119064..e430a3e9 100644 --- a/server/AyaNova/biz/TagBiz.cs +++ b/server/AyaNova/biz/TagBiz.cs @@ -32,9 +32,7 @@ namespace AyaNova.Biz } - /* - TODO: add methods here to deal with various tag operations in the db - */ + //////////////////////////////////////////////////////////////////////////////////////////////// //CREATE diff --git a/server/AyaNova/biz/TagMapBiz.cs b/server/AyaNova/biz/TagMapBiz.cs index 5a30cf3e..47d08879 100644 --- a/server/AyaNova/biz/TagMapBiz.cs +++ b/server/AyaNova/biz/TagMapBiz.cs @@ -30,10 +30,7 @@ namespace AyaNova.Biz } - /* - TODO: add methods here to deal with various tag operations in the db - */ - + //////////////////////////////////////////////////////////////////////////////////////////////// //CREATE internal async Task CreateAsync(TagMapInfo inObj) diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index bfaa5208..7e18ba4e 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -238,6 +238,30 @@ namespace AyaNova.Biz } + + //TODO: Validation rules that require future other objects that aren't present yet: + /* + //Don't allow to go from non scheduleable if there are any scheduled workorder items because + //it would damage the history + BrokenRules.Assert("UserType","User.Label.MustBeScheduleable","UserType",(mUserType==UserTypes.Schedulable) && (ScheduledUserCount(this.mID,false)>0)); + + mUserType = value; + + BrokenRules.Assert("UserTypeInvalid","Error.Object.FieldValueNotBetween,User.Label.UserType,1,7","UserType",((int)value<1 || (int)value>6)); + + bool bOutOfLicenses=OutOfLicenses; + BrokenRules.Assert("ActiveLicense","Error.Security.UserCapacity","Active",bOutOfLicenses); + BrokenRules.Assert("UserTypeLicense","Error.Security.UserCapacity","UserType",bOutOfLicenses); + + //Case 850 + BrokenRules.Assert("ClientIDInvalid", "Error.Object.RequiredFieldEmpty,O.Client", "ClientID", + (mUserType== UserTypes.Client && mClientID==Guid.Empty)); + + BrokenRules.Assert("HeadOfficeIDInvalid", "Error.Object.RequiredFieldEmpty,O.HeadOffice", "HeadOfficeID", + (mUserType == UserTypes.HeadOffice && mHeadOfficeID == Guid.Empty)); + + */ + if (!inObj.UserType.IsValid()) { AddError(ValidationErrorType.InvalidValue, "UserType"); @@ -290,6 +314,10 @@ namespace AyaNova.Biz AddError(ValidationErrorType.InvalidValue, "Roles"); } + + + + return; } @@ -327,11 +355,12 @@ namespace AyaNova.Biz public async Task ImportV7Async(JObject j, List importMap, Guid jobId) { + //TODO: Some of these items will need to be imported in future USEROPTIONS object that doesn't exist yet #region V7 record format /* { "DefaultLanguage": "Custom English", - TODO: "DefaultServiceTemplateID": "ca83a7b8-4e5f-4a7b-a02b-9cf78d5f983f", + "DefaultServiceTemplateID": "ca83a7b8-4e5f-4a7b-a02b-9cf78d5f983f", "UserType": 2, "Active": true, "ClientID": "00000000-0000-0000-0000-000000000000", @@ -537,7 +566,7 @@ namespace AyaNova.Biz #endregion set locale } break; - + case "clientid": { var V7Id = new Guid(j["ID"].Value()); diff --git a/server/AyaNova/generator/Generate.cs b/server/AyaNova/generator/Generate.cs index e627622c..33c53a8c 100644 --- a/server/AyaNova/generator/Generate.cs +++ b/server/AyaNova/generator/Generate.cs @@ -15,7 +15,7 @@ namespace AyaNova.Generator /* - TODO: Generator tasks that should happen: + LOOKAT: Generator tasks that should happen: - Periodically erase any temp files written to userfiles root (attachments temp files) that are older than a day - These files should be normally erased within seconds after uploading and processing into their permanent folder but shit will go wrong */ diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 0d765f08..5e50272a 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -124,7 +124,7 @@ namespace AyaNova.Util exec("CREATE TABLE aevent (id BIGSERIAL PRIMARY KEY, created timestamp not null, ownerid bigint not null," + "ayid bigint not null, aytype integer not null, ayevent integer not null, textra varchar(255))"); - //TODO: do I *really* need these or do they bloat unnecessarily? Need to test with big dataset + //LOOKAT: do I *really* need these or do they bloat unnecessarily? Need to test with big dataset //index for quick searching // exec("CREATE INDEX ayid_idx ON aevent (ayid);"); // exec("CREATE INDEX aytype_idx ON aevent (aytype);"); @@ -226,7 +226,7 @@ namespace AyaNova.Util ////////////////////////////////////////////////// //LICENSE table new columns - //TODO: DO I need this anymore??? + //LOOKAT: DO I need this anymore??? if (currentSchema < 8) { LogUpdateMessage(log); diff --git a/server/AyaNova/util/DbUtil.cs b/server/AyaNova/util/DbUtil.cs index fe1696a8..1e4ee38a 100644 --- a/server/AyaNova/util/DbUtil.cs +++ b/server/AyaNova/util/DbUtil.cs @@ -306,7 +306,8 @@ namespace AyaNova.Util /////////////////////////////////////////// - // Check if DB is empty + // Check if DB is empty + // CALLED BY LICENSE CONTROLLER AND LICENSE.CS FOR TRIAL Request check // internal static bool DBIsEmpty(AyContext ctx, ILogger _log) { diff --git a/server/AyaNova/util/License.cs b/server/AyaNova/util/License.cs index 309d0c27..a393b0df 100644 --- a/server/AyaNova/util/License.cs +++ b/server/AyaNova/util/License.cs @@ -334,6 +334,7 @@ namespace AyaNova.Core /// Result string internal static string RequestTrial(string email, string regto, ILogger log) { + //BEFORE_RELEASE: DO THE FOLLOWING BEFORE RELEASE: //TODO: TESTING REMOVE BEFORE RELEASE //for test purposes if this route is hit and this code executed then the dbid is temporarily changed to the special trial request //dbid so I can test remotely without hassle @@ -513,7 +514,8 @@ namespace AyaNova.Core //Update current license CurrentInDbKeyRecord.Key = RawTextNewKey; - //TODO: reason, resultcode etc + //LOOKAT: reason, resultcode etc + //There is similar block related to this in ayschema for db schema version 8 ctx.SaveChanges(); } catch (Exception ex) diff --git a/server/AyaNova/util/Seeder.cs b/server/AyaNova/util/Seeder.cs index 0d100f6e..cc020447 100644 --- a/server/AyaNova/util/Seeder.cs +++ b/server/AyaNova/util/Seeder.cs @@ -252,7 +252,7 @@ namespace AyaNova.Util u.Roles = roles; u.LocaleId = ServerBootConfig.AYANOVA_DEFAULT_LANGUAGE_ID; u.UserType = userType; - //TODO: if usertype is subcontractor or client or headoffice it needs to set a corresponding user's parent org record id to go with it + //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 ct.User.Add(u); } diff --git a/test/raven-integration/Tags/TagMapOps.cs b/test/raven-integration/Tags/TagMapOps.cs index f2bc0f39..db3e5826 100644 --- a/test/raven-integration/Tags/TagMapOps.cs +++ b/test/raven-integration/Tags/TagMapOps.cs @@ -73,10 +73,6 @@ namespace raven_integration a = await Util.DeleteAsync("Tag/" + tagId.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateViolatesReferentialIntegrityError(a); - //TODO: - //Test delete parent object deletes tagmaps (widget delete) - - //DELETE TAGMAP a = await Util.DeleteAsync("TagMap/" + tagMapId.ToString(), await Util.GetTokenAsync("BizAdminFull")); Util.ValidateHTTPStatusCode(a, 204);