This commit is contained in:
@@ -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:
|
||||
|
||||
22
server/AyaNova/biz/FilterOptions.cs
Normal file
22
server/AyaNova/biz/FilterOptions.cs
Normal file
@@ -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<FilterField> Fields { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class FilterField
|
||||
{
|
||||
public string Fld { get; set; }
|
||||
public string Lt { get; set; }
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
37
server/AyaNova/biz/IFilterableObject.cs
Normal file
37
server/AyaNova/biz/IFilterableObject.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using AyaNova.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for biz objects that support list filtering
|
||||
/// </summary>
|
||||
internal interface IFilterableObject
|
||||
{
|
||||
|
||||
//FILTEROPTIONS COLLECTION
|
||||
//{list:"widget",fields:[{fld:"name",lt:"WidgetName",type:"text"},{fld:"dollarAmount",lt:"WidgetDollarAmount",type:"currency"}]}
|
||||
|
||||
//VALIDATE FILTER
|
||||
|
||||
// /// <summary>
|
||||
// /// Import from the JSON data provided
|
||||
// /// </summary>
|
||||
// /// <param name="v7ImportData">Json object containing source record</param>
|
||||
// /// <param name="importMap">A collection that can be used to match import records to new records, NOT persistent between imports</param>
|
||||
// /// <param name="JobId">JobId for logging or controlling jobs from within processor</param>
|
||||
// /// <returns>True if imported, False if not imported due to invalid or other error (logged in job log)</returns>
|
||||
// Task<bool> ImportV7Async(JObject v7ImportData, List<ImportAyaNova7MapItem> importMap, Guid JobId);
|
||||
|
||||
// /// <summary>
|
||||
// /// If true, relaxes validation rules so that incomplete data can be imported
|
||||
// /// </summary>
|
||||
// bool SeedOrImportRelaxedRulesMode { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user