This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class AttachmentDataList : DataListBase
|
||||
internal class AttachmentDataList : DataListProcessingBase
|
||||
{
|
||||
|
||||
public AttachmentDataList()
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class CustomerDataList : DataListBase
|
||||
internal class CustomerDataList : DataListProcessingBase
|
||||
{
|
||||
public CustomerDataList()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class CustomerNoteDataList : DataListBase, IDataListInternalCriteria
|
||||
internal class CustomerNoteDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public CustomerNoteDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class CustomerServiceRequestDataList : DataListBase
|
||||
internal class CustomerServiceRequestDataList : DataListProcessingBase
|
||||
{
|
||||
public CustomerServiceRequestDataList()
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class HeadOfficeDataList : DataListBase
|
||||
internal class HeadOfficeDataList : DataListProcessingBase
|
||||
{
|
||||
public HeadOfficeDataList()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class InsideUserDataList : DataListBase, IDataListInternalCriteria
|
||||
internal class InsideUserDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
|
||||
public InsideUserDataList()
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class LoanUnitDataList : DataListBase
|
||||
internal class LoanUnitDataList : DataListProcessingBase
|
||||
{
|
||||
public LoanUnitDataList()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PartAssemblyDataList : DataListBase
|
||||
internal class PartAssemblyDataList : DataListProcessingBase
|
||||
{
|
||||
public PartAssemblyDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PartDataList : DataListBase
|
||||
internal class PartDataList : DataListProcessingBase
|
||||
{
|
||||
public PartDataList()
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PartInventoryDataList : DataListBase, IDataListInternalCriteria
|
||||
internal class PartInventoryDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public PartInventoryDataList()
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using AyaNova.Models;
|
||||
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PartInventoryTransactionsDataList : DataListBase, IDataListInternalCriteria
|
||||
internal class PartInventoryTransactionsDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||
{
|
||||
public PartInventoryTransactionsDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class PartWarehouseDataList : DataListBase
|
||||
internal class PartWarehouseDataList : DataListProcessingBase
|
||||
{
|
||||
public PartWarehouseDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class ProjectDataList : DataListBase
|
||||
internal class ProjectDataList : DataListProcessingBase
|
||||
{
|
||||
public ProjectDataList()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class ReportDataList : DataListBase
|
||||
internal class ReportDataList : DataListProcessingBase
|
||||
{
|
||||
|
||||
public ReportDataList()
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using AyaNova.Models;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class ServiceBankDataList : DataListBase
|
||||
internal class ServiceBankDataList : DataListProcessingBase
|
||||
{
|
||||
public ServiceBankDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class ServiceRateDataList : DataListBase
|
||||
internal class ServiceRateDataList : DataListProcessingBase
|
||||
{
|
||||
public ServiceRateDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class TaxCodeDataList : DataListBase
|
||||
internal class TaxCodeDataList : DataListProcessingBase
|
||||
{
|
||||
public TaxCodeDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class TestWidgetDataList : DataListBase
|
||||
internal class TestWidgetDataList : DataListProcessingBase
|
||||
{
|
||||
public TestWidgetDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class TranslationDataList : DataListBase
|
||||
internal class TranslationDataList : DataListProcessingBase
|
||||
{
|
||||
|
||||
public TranslationDataList()
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class TravelRateDataList : DataListBase
|
||||
internal class TravelRateDataList : DataListProcessingBase
|
||||
{
|
||||
public TravelRateDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class UnitDataList : DataListBase
|
||||
internal class UnitDataList : DataListProcessingBase
|
||||
{
|
||||
public UnitDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class UnitModelDataList : DataListBase
|
||||
internal class UnitModelDataList : DataListProcessingBase
|
||||
{
|
||||
public UnitModelDataList()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class VendorDataList : DataListBase
|
||||
internal class VendorDataList : DataListProcessingBase
|
||||
{
|
||||
public VendorDataList()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user