From 6ed176201c2d4cb32b4a75db95dc5081e9c05e6a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 29 Nov 2018 16:15:13 +0000 Subject: [PATCH] --- ...-list-graph-datatable-filtering-paging.txt | 3 +- server/AyaNova/biz/FilterOptions.cs | 22 +++++++++++ server/AyaNova/biz/IFilterableObject.cs | 37 +++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 server/AyaNova/biz/FilterOptions.cs create mode 100644 server/AyaNova/biz/IFilterableObject.cs diff --git a/devdocs/specs/core-list-graph-datatable-filtering-paging.txt b/devdocs/specs/core-list-graph-datatable-filtering-paging.txt index f93ba107..10de6512 100644 --- a/devdocs/specs/core-list-graph-datatable-filtering-paging.txt +++ b/devdocs/specs/core-list-graph-datatable-filtering-paging.txt @@ -8,7 +8,8 @@ Two types of filters Named or Default: User can save a filter with a name for later selection or it will always default to "Default" (localized) if not edited but will always require saving to server. Generic "default" filter is always personal, not public / shared Named filters can be made public or personal. If public then all users with rights to that object can see them, personal are always only personal. -Filter is constructed from an FILTEROPTIONS object fetched from the server list route that has a list type name which is unique to that list route and also lists all the fields filterable, their type and the locale key to display it +Filter is constructed from an FILTEROPTIONS object fetched from the server list route that has a list type name which is unique to that list route +and also lists all the fields filterable, their type and the locale key to display it - e.g.: {list:"widget",fields:[{fld:"name",lt:"WidgetName",type:"text"},{fld:"dollarAmount",lt:"WidgetDollarAmount",type:"currency"}]} Certain types have extended abilities, for example dates have the classic floating AyaNova date ranges pre-defined or specific dates Filters are saved to the database: diff --git a/server/AyaNova/biz/FilterOptions.cs b/server/AyaNova/biz/FilterOptions.cs new file mode 100644 index 00000000..402e0c89 --- /dev/null +++ b/server/AyaNova/biz/FilterOptions.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; + + +namespace AyaNova.Biz +{ + + public class FilterOptions + { + public string ListKey { get; set; } + public List Fields { get; set; } + + } + + public class FilterField + { + public string Fld { get; set; } + public string Lt { get; set; } + public string Type { get; set; } + } +} diff --git a/server/AyaNova/biz/IFilterableObject.cs b/server/AyaNova/biz/IFilterableObject.cs new file mode 100644 index 00000000..26026f4e --- /dev/null +++ b/server/AyaNova/biz/IFilterableObject.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using AyaNova.Models; +using Newtonsoft.Json.Linq; + + +namespace AyaNova.Biz +{ + /// + /// Interface for biz objects that support list filtering + /// + internal interface IFilterableObject + { + + //FILTEROPTIONS COLLECTION + //{list:"widget",fields:[{fld:"name",lt:"WidgetName",type:"text"},{fld:"dollarAmount",lt:"WidgetDollarAmount",type:"currency"}]} + + //VALIDATE FILTER + + // /// + // /// Import from the JSON data provided + // /// + // /// Json object containing source record + // /// A collection that can be used to match import records to new records, NOT persistent between imports + // /// JobId for logging or controlling jobs from within processor + // /// True if imported, False if not imported due to invalid or other error (logged in job log) + // Task ImportV7Async(JObject v7ImportData, List importMap, Guid JobId); + + // /// + // /// If true, relaxes validation rules so that incomplete data can be imported + // /// + // bool SeedOrImportRelaxedRulesMode { get; set; } + + } + +} \ No newline at end of file