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
|
/// Authorization varies list by list, will return 403 - Not Authorized if user has insufficient role
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </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>
|
/// <returns>Collection with paging data</returns>
|
||||||
// [HttpPost("List", Name = nameof(List))]
|
// [HttpPost("List", Name = nameof(List))]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> List([FromBody] DataListTableOptions listOptions)
|
public async Task<IActionResult> List([FromBody] DataListTableRequest tableRequest)
|
||||||
{
|
{
|
||||||
if (!serverState.IsOpen)
|
if (!serverState.IsOpen)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
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
|
try
|
||||||
{
|
{
|
||||||
DataListReturnData r = await DataListFetcher.GetResponseAsync(ct, listOptions, UserRoles, log, UserId);
|
DataListReturnData r = await DataListFetcher.GetResponseAsync(ct, tableRequest, UserRoles, log, UserId);
|
||||||
return Ok(r);
|
return Ok(r);
|
||||||
}
|
}
|
||||||
catch (System.UnauthorizedAccessException)
|
catch (System.UnauthorizedAccessException)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class AttachmentDataList : DataListBase
|
internal class AttachmentDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public AttachmentDataList()
|
public AttachmentDataList()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class CustomerDataList : DataListBase
|
internal class CustomerDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public CustomerDataList()
|
public CustomerDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using AyaNova.Models;
|
|||||||
|
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class CustomerNoteDataList : DataListBase, IDataListInternalCriteria
|
internal class CustomerNoteDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
public CustomerNoteDataList()
|
public CustomerNoteDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class CustomerServiceRequestDataList : DataListBase
|
internal class CustomerServiceRequestDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public CustomerServiceRequestDataList()
|
public CustomerServiceRequestDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ namespace AyaNova.DataList
|
|||||||
// Get the data list data requested
|
// 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?
|
//was the name not found as a list?
|
||||||
if (DataList == null)
|
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
|
//check rights
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ namespace AyaNova.DataList
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// DataList object base class
|
/// DataList object base class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal abstract class DataListBase : IDataList
|
internal abstract class DataListProcessingBase : IDataList
|
||||||
{
|
{
|
||||||
//CoreBizObject add here
|
//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
|
//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; }
|
public Dictionary<string, string> DefaultSortBy { get; set; }
|
||||||
|
|
||||||
//set defaults if not provided in listOptions
|
//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
|
//columns, filter and sortby could all be null
|
||||||
if (listOptions.Filter == null)
|
if (listOptions.Filter == null)
|
||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class EventDataList : DataListBase
|
internal class EventDataList : DataListProcessingBase
|
||||||
{/*
|
{/*
|
||||||
Select aevent.id, aevent.created, aevent.ayid, aevent.ayatype, aevent.ayevent,
|
Select aevent.id, aevent.created, aevent.ayid, aevent.ayatype, aevent.ayevent,
|
||||||
aevent.textra, auser.name, auser.id
|
aevent.textra, auser.name, auser.id
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class HeadOfficeDataList : DataListBase
|
internal class HeadOfficeDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public HeadOfficeDataList()
|
public HeadOfficeDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using AyaNova.Models;
|
|||||||
|
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class InsideUserDataList : DataListBase, IDataListInternalCriteria
|
internal class InsideUserDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
|
|
||||||
public InsideUserDataList()
|
public InsideUserDataList()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class LoanUnitDataList : DataListBase
|
internal class LoanUnitDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public LoanUnitDataList()
|
public LoanUnitDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using AyaNova.Models;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class MemoDataList : DataListBase, IDataListInternalCriteria
|
internal class MemoDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
public MemoDataList()
|
public MemoDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using AyaNova.Models;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class OutsideUserDataList : DataListBase, IDataListInternalCriteria
|
internal class OutsideUserDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
|
|
||||||
public OutsideUserDataList()
|
public OutsideUserDataList()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class PartAssemblyDataList : DataListBase
|
internal class PartAssemblyDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public PartAssemblyDataList()
|
public PartAssemblyDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class PartDataList : DataListBase
|
internal class PartDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public PartDataList()
|
public PartDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using AyaNova.Models;
|
|||||||
|
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class PartInventoryDataList : DataListBase, IDataListInternalCriteria
|
internal class PartInventoryDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
public PartInventoryDataList()
|
public PartInventoryDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using AyaNova.Models;
|
|||||||
|
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class PartInventoryTransactionsDataList : DataListBase, IDataListInternalCriteria
|
internal class PartInventoryTransactionsDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
public PartInventoryTransactionsDataList()
|
public PartInventoryTransactionsDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class PartWarehouseDataList : DataListBase
|
internal class PartWarehouseDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public PartWarehouseDataList()
|
public PartWarehouseDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class ProjectDataList : DataListBase
|
internal class ProjectDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public ProjectDataList()
|
public ProjectDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using AyaNova.Models;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class ReminderDataList : DataListBase, IDataListInternalCriteria
|
internal class ReminderDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
public ReminderDataList()
|
public ReminderDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class ReportDataList : DataListBase
|
internal class ReportDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public ReportDataList()
|
public ReportDataList()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using AyaNova.Models;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class ReviewDataList : DataListBase, IDataListInternalCriteria
|
internal class ReviewDataList : DataListProcessingBase, IDataListInternalCriteria
|
||||||
{
|
{
|
||||||
public ReviewDataList()
|
public ReviewDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using AyaNova.Models;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class ServiceBankDataList : DataListBase
|
internal class ServiceBankDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public ServiceBankDataList()
|
public ServiceBankDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class ServiceRateDataList : DataListBase
|
internal class ServiceRateDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public ServiceRateDataList()
|
public ServiceRateDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class TaxCodeDataList : DataListBase
|
internal class TaxCodeDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public TaxCodeDataList()
|
public TaxCodeDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class TestWidgetDataList : DataListBase
|
internal class TestWidgetDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public TestWidgetDataList()
|
public TestWidgetDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class TranslationDataList : DataListBase
|
internal class TranslationDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TranslationDataList()
|
public TranslationDataList()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class TravelRateDataList : DataListBase
|
internal class TravelRateDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public TravelRateDataList()
|
public TravelRateDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class UnitDataList : DataListBase
|
internal class UnitDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public UnitDataList()
|
public UnitDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class UnitModelDataList : DataListBase
|
internal class UnitModelDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public UnitModelDataList()
|
public UnitModelDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
namespace AyaNova.DataList
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
internal class VendorDataList : DataListBase
|
internal class VendorDataList : DataListProcessingBase
|
||||||
{
|
{
|
||||||
public VendorDataList()
|
public VendorDataList()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user