From d47f8d64b751cec62b7c4d0dbcd2f6f208696fbc Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 17 Jan 2020 00:18:10 +0000 Subject: [PATCH] --- devdocs/todo.txt | 19 ++++++--------- server/AyaNova/biz/ObjectFields.cs | 37 ++++++++++++++++++++++++++---- server/AyaNova/models/AyContext.cs | 2 +- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index e5a6162f..baf5a244 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -5,11 +5,6 @@ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOiIxNTcxODU5OTU0IiwiZXhwIjoiMTU3MjQ ## IMMEDIATE ITEMS -UPDATE all the things before commencing work -- Update client end - - - ------------------------------------------------------------------------------------------------------------------------------------- Need a sprint to get to a fully testable client with entry form, list and as much as possible all features from COMMON-* specs list @@ -21,15 +16,15 @@ REALLY MAKING MORE PROGRESS WHEN CLIENT DEV DRIVES BACKEND DEV, STICK TO THAT!! TODO: return the list as objects as specified -TODO: Make a joined table list for development - - Widget->User->emailaddress - - Modify Widget, add UserId to it (maybe prepared by like a quote) - - Modify all the widget related code to work with this and also populate it - - Going to need to modify a lot of shit for this at the client too but it's necessary to be on the right path now +TODO: Make a joined table list for development - Widget list with User and their email - Working query: - Select awidget.id as widgetid, awidget.name, auser.name, auser.id as userid, auseroptions.emailaddress from awidget left outer join auser on (awidget.userid=auser.id) left outer join auseroptions on (auser.id=auseroptions.userid) - + /* + Select awidget.id as widgetid, awidget.name as widgetname, auser.name as username, auser.id as userid, auseroptions.emailaddress + from awidget + left outer join auser on (awidget.userid=auser.id) + left outer join auseroptions on (auser.id=auseroptions.userid) + */ CLIENT CUSTOM FIELDS CHANGE - Must use numeric instead of text values now diff --git a/server/AyaNova/biz/ObjectFields.cs b/server/AyaNova/biz/ObjectFields.cs index 01cc5788..2548c84d 100644 --- a/server/AyaNova/biz/ObjectFields.cs +++ b/server/AyaNova/biz/ObjectFields.cs @@ -23,7 +23,7 @@ namespace AyaNova.Biz //For objects that are compound list objects or reporting objects it's whatever uniquely but clearly identifies that and ends in _LIST public const string WIDGET_KEY = "widget"; public const string USER_KEY = "user"; - public const string USER_EMAIL_ADDRESS_LIST_KEY = "UserEmailAddress";//for development testing, not a real thing going forward + public const string TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY = "TEST_WIDGET_USER_EMAIL_ADDRESS_LIST";//for development testing, not a real thing going forward public static List AvailableObjectKeys @@ -219,9 +219,38 @@ namespace AyaNova.Biz l.Add(new ObjectField { Key = "UserCustom16", PropertyName = "UserCustom16", Custom = true }); break; #endregion - case USER_EMAIL_ADDRESS_LIST_KEY: - #region USER_EMAIL_ADDRESS_LIST_KEY - l.Add(new ObjectField { Key = "df", AyObjectType = (int)AyaType.User }); + case TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY: + #region WIDGET_USER_EMAIL_ADDRESS_LIST_KEY + /* + Select awidget.id as widgetid, awidget.name as widgetname, auser.name as username, auser.id as userid, auseroptions.emailaddress + from awidget + left outer join auser on (awidget.userid=auser.id) + left outer join auseroptions on (auser.id=auseroptions.userid) + + public string Key { get; set; } + public string PropertyName { get; set; } + public bool Hideable { get; set; } + public bool SharedLTKey { get; set; } + public bool Custom { get; set; } + public bool Filterable { get; set; } + public bool Sortable { get; set; } + public bool MiniAvailable { get; set; } + public int DataType { get; set; } + //If it's an enum DataType then this is the specific enum type which sb the name of the class that holds the enum in the server project + public string EnumType { get; set; } + //if field is a reference to another object (i.e. a client in a workorders list) + //then the type to open is set here + public int AyObjectType { get; set; } + + //For query building + //This is the equivalent of the v7 SqlColumnNameAttribute + public string SqlIdColumn { get; set; } + public string SqlColumn { get; set; } + */ + l.Add(new ObjectField { Key = "df", AyObjectType = (int)AyaType.Widget }); + l.Add(new ObjectField { Key = "WidgetName", PropertyName = "Name", DataType = (int)AyaDataType.Text, Hideable = false, });//not hideable for strictly list must mean it has to be in template? + + l.Add(new ObjectField { Key = "User", PropertyName = "userid", DataType = (int)AyaDataType.Text, AyObjectType = (int)AyaType.User }); l.Add(new ObjectField { Key = "Name", PropertyName = "Name", SharedLTKey = true, DataType = (int)AyaDataType.Text, Hideable = false }); l.Add(new ObjectField { Key = "UserEmailAddress", PropertyName = "Emailaddress", DataType = (int)AyaDataType.EmailAddress, SqlColumn = "emailaddress" }); break; diff --git a/server/AyaNova/models/AyContext.cs b/server/AyaNova/models/AyContext.cs index 51f6fa77..f4cc1ff2 100644 --- a/server/AyaNova/models/AyContext.cs +++ b/server/AyaNova/models/AyContext.cs @@ -95,7 +95,7 @@ namespace AyaNova.Models .HasForeignKey(b => b.UserId) .OnDelete(DeleteBehavior.Cascade);//Hopefully will delete the useroptions with the user? - //User->Widget this might be wrong + //User->Widget Not certain about this definition modelBuilder.Entity() .HasOne(p => p.Widget) .WithOne(i => i.User)