This commit is contained in:
2021-01-29 21:31:09 +00:00
parent 32c1a3a4b6
commit 2e9c570272
31 changed files with 41 additions and 41 deletions

View File

@@ -47,22 +47,22 @@ namespace AyaNova.Api.Controllers
/// Authorization varies list by list, will return 403 - Not Authorized if user has insufficient role
///
/// </summary>
/// <param name="listOptions">List key, Paging, filtering and sorting options</param>
/// <param name="tableRequest">List key, Paging, filtering and sorting options</param>
/// <returns>Collection with paging data</returns>
// [HttpPost("List", Name = nameof(List))]
[HttpPost]
public async Task<IActionResult> List([FromBody] DataListTableOptions listOptions)
public async Task<IActionResult> List([FromBody] DataListTableRequest tableRequest)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (listOptions.Limit == null || listOptions.Limit < 1)
if (tableRequest.Limit == null || tableRequest.Limit < 1)
{
listOptions.Limit = DataListTableOptions.DefaultLimit;
tableRequest.Limit = DataListTableOptions.DefaultLimit;
}
if (listOptions.Offset == null)
if (tableRequest.Offset == null)
{
listOptions.Offset = 0;
tableRequest.Offset = 0;
}
@@ -74,7 +74,7 @@ namespace AyaNova.Api.Controllers
try
{
DataListReturnData r = await DataListFetcher.GetResponseAsync(ct, listOptions, UserRoles, log, UserId);
DataListReturnData r = await DataListFetcher.GetResponseAsync(ct, tableRequest, UserRoles, log, UserId);
return Ok(r);
}
catch (System.UnauthorizedAccessException)

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class AttachmentDataList : DataListBase
internal class AttachmentDataList : DataListProcessingBase
{
public AttachmentDataList()

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class CustomerDataList : DataListBase
internal class CustomerDataList : DataListProcessingBase
{
public CustomerDataList()
{

View File

@@ -4,7 +4,7 @@ using AyaNova.Models;
namespace AyaNova.DataList
{
internal class CustomerNoteDataList : DataListBase, IDataListInternalCriteria
internal class CustomerNoteDataList : DataListProcessingBase, IDataListInternalCriteria
{
public CustomerNoteDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class CustomerServiceRequestDataList : DataListBase
internal class CustomerServiceRequestDataList : DataListProcessingBase
{
public CustomerServiceRequestDataList()
{

View File

@@ -17,14 +17,14 @@ namespace AyaNova.DataList
// Get the data list data requested
//
//
internal static async Task<DataListReturnData> GetResponseAsync(AyContext ct, DataListTableOptions dataListTableOptions, AuthorizationRoles userRoles, ILogger log, long userId)
internal static async Task<DataListReturnData> GetResponseAsync(AyContext ct, DataListTableRequest dataListTableRequest, AuthorizationRoles userRoles, ILogger log, long userId)
{
var DataList = DataListFactory.GetAyaDataList(dataListTableOptions.DataListKey);
var DataList = DataListFactory.GetAyaDataList(dataListTableRequest.DataListKey);
//was the name not found as a list?
if (DataList == null)
throw new System.ArgumentOutOfRangeException($"DataList \"{dataListTableOptions.DataListKey}\" specified does not exist");
throw new System.ArgumentOutOfRangeException($"DataList \"{dataListTableRequest.DataListKey}\" specified does not exist");
//check rights

View File

@@ -12,11 +12,11 @@ namespace AyaNova.DataList
/// <summary>
/// DataList object base class
/// </summary>
internal abstract class DataListBase : IDataList
internal abstract class DataListProcessingBase : IDataList
{
//CoreBizObject add here
//well, not here exactly but add a new DATALIST class if it will be displayed as a list anywhere in the UI or reported on
public DataListBase()
public DataListProcessingBase()
{
/*
@@ -40,7 +40,7 @@ namespace AyaNova.DataList
public Dictionary<string, string> DefaultSortBy { get; set; }
//set defaults if not provided in listOptions
public void SetListOptionDefaultsIfNecessary(Models.DataListBase listOptions)
public void SetListOptionDefaultsIfNecessary(DataListBase listOptions)
{
//columns, filter and sortby could all be null
if (listOptions.Filter == null)

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class EventDataList : DataListBase
internal class EventDataList : DataListProcessingBase
{/*
Select aevent.id, aevent.created, aevent.ayid, aevent.ayatype, aevent.ayevent,
aevent.textra, auser.name, auser.id

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class HeadOfficeDataList : DataListBase
internal class HeadOfficeDataList : DataListProcessingBase
{
public HeadOfficeDataList()
{

View File

@@ -4,7 +4,7 @@ using AyaNova.Models;
namespace AyaNova.DataList
{
internal class InsideUserDataList : DataListBase, IDataListInternalCriteria
internal class InsideUserDataList : DataListProcessingBase, IDataListInternalCriteria
{
public InsideUserDataList()

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class LoanUnitDataList : DataListBase
internal class LoanUnitDataList : DataListProcessingBase
{
public LoanUnitDataList()
{

View File

@@ -3,7 +3,7 @@ using AyaNova.Models;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class MemoDataList : DataListBase, IDataListInternalCriteria
internal class MemoDataList : DataListProcessingBase, IDataListInternalCriteria
{
public MemoDataList()
{

View File

@@ -3,7 +3,7 @@ using AyaNova.Models;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class OutsideUserDataList : DataListBase, IDataListInternalCriteria
internal class OutsideUserDataList : DataListProcessingBase, IDataListInternalCriteria
{
public OutsideUserDataList()

View File

@@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class PartAssemblyDataList : DataListBase
internal class PartAssemblyDataList : DataListProcessingBase
{
public PartAssemblyDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class PartDataList : DataListBase
internal class PartDataList : DataListProcessingBase
{
public PartDataList()
{

View File

@@ -5,7 +5,7 @@ using AyaNova.Models;
namespace AyaNova.DataList
{
internal class PartInventoryDataList : DataListBase, IDataListInternalCriteria
internal class PartInventoryDataList : DataListProcessingBase, IDataListInternalCriteria
{
public PartInventoryDataList()
{

View File

@@ -5,7 +5,7 @@ using AyaNova.Models;
namespace AyaNova.DataList
{
internal class PartInventoryTransactionsDataList : DataListBase, IDataListInternalCriteria
internal class PartInventoryTransactionsDataList : DataListProcessingBase, IDataListInternalCriteria
{
public PartInventoryTransactionsDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class PartWarehouseDataList : DataListBase
internal class PartWarehouseDataList : DataListProcessingBase
{
public PartWarehouseDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class ProjectDataList : DataListBase
internal class ProjectDataList : DataListProcessingBase
{
public ProjectDataList()
{

View File

@@ -3,7 +3,7 @@ using AyaNova.Models;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class ReminderDataList : DataListBase, IDataListInternalCriteria
internal class ReminderDataList : DataListProcessingBase, IDataListInternalCriteria
{
public ReminderDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class ReportDataList : DataListBase
internal class ReportDataList : DataListProcessingBase
{
public ReportDataList()

View File

@@ -3,7 +3,7 @@ using AyaNova.Models;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class ReviewDataList : DataListBase, IDataListInternalCriteria
internal class ReviewDataList : DataListProcessingBase, IDataListInternalCriteria
{
public ReviewDataList()
{

View File

@@ -4,7 +4,7 @@ using AyaNova.Models;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class ServiceBankDataList : DataListBase
internal class ServiceBankDataList : DataListProcessingBase
{
public ServiceBankDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class ServiceRateDataList : DataListBase
internal class ServiceRateDataList : DataListProcessingBase
{
public ServiceRateDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class TaxCodeDataList : DataListBase
internal class TaxCodeDataList : DataListProcessingBase
{
public TaxCodeDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class TestWidgetDataList : DataListBase
internal class TestWidgetDataList : DataListProcessingBase
{
public TestWidgetDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class TranslationDataList : DataListBase
internal class TranslationDataList : DataListProcessingBase
{
public TranslationDataList()

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class TravelRateDataList : DataListBase
internal class TravelRateDataList : DataListProcessingBase
{
public TravelRateDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class UnitDataList : DataListBase
internal class UnitDataList : DataListProcessingBase
{
public UnitDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class UnitModelDataList : DataListBase
internal class UnitModelDataList : DataListProcessingBase
{
public UnitModelDataList()
{

View File

@@ -2,7 +2,7 @@ using System.Collections.Generic;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class VendorDataList : DataListBase
internal class VendorDataList : DataListProcessingBase
{
public VendorDataList()
{