This commit is contained in:
2020-01-23 22:56:01 +00:00
parent 866428776f
commit 784ea46fd1
24 changed files with 365 additions and 902 deletions

View File

@@ -89,7 +89,7 @@ namespace AyaNova.Api.Controllers
} }
#region sigtest script #region sigtest script
/* /*
<div style=""text-align: center;""> <div style=""text-align: center;"">
<hr/> <hr/>
@@ -116,23 +116,23 @@ namespace AyaNova.Api.Controllers
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Prevent scrolling when touching the canvas // Prevent scrolling when touching the canvas
//addEventListener('touchstart', FUNCTION, {passive: false}); //addEventListener('touchstart', FUNCTION, {passive: false});
document.body.addEventListener(""touchstart"", function (e) { document.body.addEventListener(""touchstart"", function (e) {
if (e.target == canvas) { if (e.target == canvas) {
e.preventDefault(); e.preventDefault();
} }
}, {passive: false}); }, {passive: false});
document.body.addEventListener(""touchend"", function (e) { document.body.addEventListener(""touchend"", function (e) {
if (e.target == canvas) { if (e.target == canvas) {
e.preventDefault(); e.preventDefault();
} }
}, {passive: false}); }, {passive: false});
document.body.addEventListener(""touchmove"", function (e) { document.body.addEventListener(""touchmove"", function (e) {
if (e.target == canvas) { if (e.target == canvas) {
e.preventDefault(); e.preventDefault();
} }
}, {passive: false}); }, {passive: false});
/////////////////////////////////////////////// ///////////////////////////////////////////////
$('#sigpad').sigpad(); $('#sigpad').sigpad();
}); });
@@ -221,9 +221,9 @@ document.body.addEventListener(""touchmove"", function (e) {
// Adds the clear button / link // Adds the clear button / link
if (options.showClear === true) { if (options.showClear === true) {
// var clear_tag = (options.clearStyle == 'link' ? 'div' : 'button'); // var clear_tag = (options.clearStyle == 'link' ? 'div' : 'button');
// $('#' + id + '-controls').append('<' + clear_tag + ' id=""' + id + '-clear"" style=""float:left"">' + options.clearLabel + '</' + clear_tag + '><br style=""clear:both"" />'); // $('#' + id + '-controls').append('<' + clear_tag + ' id=""' + id + '-clear"" style=""float:left"">' + options.clearLabel + '</' + clear_tag + '><br style=""clear:both"" />');
$('#' + id + '-controls').append('<div ' + ' id=""' + id + '-clear"" >' + $('#' + id + '-controls').append('<div ' + ' id=""' + id + '-clear"" >' +
'<span class=""btn btn-sm btn-danger icon-Delete ay-icon-large""></span></div>'); '<span class=""btn btn-sm btn-danger icon-Delete ay-icon-large""></span></div>');
@@ -424,16 +424,13 @@ document.body.addEventListener(""touchmove"", function (e) {
}); });
})(jQuery); })(jQuery);
</script>"; </script>";
} }
*/ */
#endregion #endregion
/// <summary> /// <summary>
/// Get API server info for general display /// Get API server info for general display
///
/// Required roles: Any
///
/// </summary> /// </summary>
/// <returns>API server info</returns> /// <returns>API server info</returns>
[HttpGet("ServerInfo")] [HttpGet("ServerInfo")]
@@ -455,9 +452,6 @@ document.body.addEventListener(""touchmove"", function (e) {
#if (DEBUG) #if (DEBUG)
/// <summary> /// <summary>
/// Get build mode of server, used for automated testing purposes /// Get build mode of server, used for automated testing purposes
///
/// Required roles: Any
///
/// </summary> /// </summary>
/// <returns>"DEBUG" or "RELEASE"</returns> /// <returns>"DEBUG" or "RELEASE"</returns>
[HttpGet("BuildMode")] [HttpGet("BuildMode")]
@@ -468,9 +462,6 @@ document.body.addEventListener(""touchmove"", function (e) {
#else #else
/// <summary> /// <summary>
/// Get build mode of server, used for automated testing purposes /// Get build mode of server, used for automated testing purposes
///
/// Required roles: Any
///
/// </summary> /// </summary>
/// <returns>"DEBUG" or "RELEASE"</returns> /// <returns>"DEBUG" or "RELEASE"</returns>
[HttpGet("BuildMode")] [HttpGet("BuildMode")]

View File

@@ -115,7 +115,7 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Upload attachment file /// Upload attachment file
/// ///
/// Required roles: Same roles as object that file is being attached to /// Requires same Authorization roles as object that file is being attached to
/// ///
/// </summary> /// </summary>
/// <returns>NameValue list of filenames and attachment id's</returns> /// <returns>NameValue list of filenames and attachment id's</returns>

View File

@@ -43,8 +43,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get name value localized display value list of AyaNova enumerated types for list specified /// Get name value localized display value list of AyaNova enumerated types for list specified
///
/// Required roles: Any
/// </summary> /// </summary>
/// <param name="enumkey">The key name of the enumerated type</param> /// <param name="enumkey">The key name of the enumerated type</param>
/// <returns>List</returns> /// <returns>List</returns>
@@ -157,8 +155,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get all possible enumerated values picklist key names /// Get all possible enumerated values picklist key names
///
/// Required roles: Any
/// </summary> /// </summary>
/// <returns>List of AyaNova enumerated type list key names that can be fetched from the AyaEnumPickList/GetPickListRoute</returns> /// <returns>List of AyaNova enumerated type list key names that can be fetched from the AyaEnumPickList/GetPickListRoute</returns>
[HttpGet("listkeys")] [HttpGet("listkeys")]

View File

@@ -43,8 +43,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get name value list of AyaNova business object types /// Get name value list of AyaNova business object types
///
/// Required roles: Any
/// </summary> /// </summary>
/// <returns>List</returns> /// <returns>List</returns>
[HttpGet] [HttpGet]

View File

@@ -43,7 +43,7 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get list of data for selection / viewing /// Get list of data for selection / viewing
/// ///
/// Required roles: Varies by list, if not allowed will return 403 - Not Authorized /// 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="listOptions">List key, Paging, filtering and sorting options</param>
@@ -78,8 +78,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// List of all DataList keys available /// List of all DataList keys available
///
/// Required roles: Any
/// </summary> /// </summary>
/// <returns>List of strings</returns> /// <returns>List of strings</returns>
[HttpGet("ListKeys")] [HttpGet("ListKeys")]
@@ -96,8 +94,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// List of all fields for data list key specified /// List of all fields for data list key specified
///
/// Required roles: Any
/// </summary> /// </summary>
/// <returns>List of DataListFieldDefinition</returns> /// <returns>List of DataListFieldDefinition</returns>
[HttpGet("ListFields")] [HttpGet("ListFields")]

View File

@@ -47,9 +47,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get full DataFilter object /// Get full DataFilter object
///
/// Required roles:
/// Any (for public filter), owned only for private filter
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>A single DataFilter</returns> /// <returns>A single DataFilter</returns>
@@ -79,9 +76,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get DataFilter pick list /// Get DataFilter pick list
///
/// Required roles: Any
///
/// </summary> /// </summary>
/// <returns>List of public or owned data filters for listKey provided</returns> /// <returns>List of public or owned data filters for listKey provided</returns>
[HttpGet("PickList", Name = nameof(DataFilterPickList))] [HttpGet("PickList", Name = nameof(DataFilterPickList))]
@@ -104,10 +98,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Put (update) DataFilter /// Put (update) DataFilter
///
/// Required roles:
/// Any (public filter) or owned only (private filter)
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <param name="inObj"></param> /// <param name="inObj"></param>
@@ -149,9 +139,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Post DataFilter /// Post DataFilter
///
/// Required roles:
/// BizAdminFull, InventoryFull, TechFull
/// </summary> /// </summary>
/// <param name="inObj"></param> /// <param name="inObj"></param>
/// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param> /// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param>
@@ -185,10 +172,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Delete DataFilter /// Delete DataFilter
///
/// Required roles:
/// Any if public otherwise creator only
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>Ok</returns> /// <returns>Ok</returns>

View File

@@ -43,9 +43,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get full DataListTemplate object /// Get full DataListTemplate object
///
/// Required roles:
/// Any
/// </summary> /// </summary>
/// <param name="DataListKey"></param> /// <param name="DataListKey"></param>
/// <returns>A single DataListTemplate</returns> /// <returns>A single DataListTemplate</returns>
@@ -79,8 +76,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// List of all DataList keys available /// List of all DataList keys available
///
/// Required roles: Any
/// </summary> /// </summary>
/// <returns>List of strings</returns> /// <returns>List of strings</returns>
[HttpGet("ListKeys")] [HttpGet("ListKeys")]
@@ -97,10 +92,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Put (update) DataListTemplate /// Put (update) DataListTemplate
///
/// Required roles:
/// BizAdminFull
///
/// </summary> /// </summary>
/// <param name="DataListKey"></param> /// <param name="DataListKey"></param>
/// <param name="inObj"></param> /// <param name="inObj"></param>
@@ -150,9 +141,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Delete DataListTemplate /// Delete DataListTemplate
/// (Reset DataListTemplate to default) /// (Reset DataListTemplate to default)
/// Required roles:
/// BizAdminFull
///
/// </summary> /// </summary>
/// <param name="DataListKey"></param> /// <param name="DataListKey"></param>
/// <returns>Ok</returns> /// <returns>Ok</returns>

View File

@@ -49,8 +49,7 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get event log for object and date range specified /// Get event log for object and date range specified
/// ///
/// Required roles: /// Required Role: Read full object properties rights to object type specified
/// Read rights to object type specified
/// ///
/// </summary> /// </summary>
/// <returns>Event log entry list for object</returns> /// <returns>Event log entry list for object</returns>
@@ -76,8 +75,7 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get event log entries for a specified user and date range /// Get event log entries for a specified user and date range
/// ///
/// Required roles: /// Required Role: Read rights to User object or User's own data
/// Read rights to User object or UserId specified must be requestor Id
/// ///
/// </summary> /// </summary>
/// <returns>Event log for user</returns> /// <returns>Event log for user</returns>

View File

@@ -49,11 +49,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get form customizations for Client form display /// Get form customizations for Client form display
/// Returns 304 not modified if concurrency token provided and unchanged
///
/// Required roles:
/// Any
///
/// </summary> /// </summary>
/// <param name="formkey">The official form key used by AyaNova</param> /// <param name="formkey">The official form key used by AyaNova</param>
/// <param name="concurrencyToken">A prior concurrency token used to check if there are any changes without using up bandwidth sending unnecessary data</param> /// <param name="concurrencyToken">A prior concurrency token used to check if there are any changes without using up bandwidth sending unnecessary data</param>
@@ -104,10 +99,6 @@ namespace AyaNova.Api.Controllers
/// Used to build UI for customizing a form /// Used to build UI for customizing a form
/// These values are a subset of the AyaDataTypes values /// These values are a subset of the AyaDataTypes values
/// which can be fetched from the EnumPickList route /// which can be fetched from the EnumPickList route
///
/// Required roles:
/// BizAdminFull only has rights to customize forms
///
/// </summary> /// </summary>
/// <returns>A list of valid values for custom field types</returns> /// <returns>A list of valid values for custom field types</returns>
[HttpGet("AvailableCustomTypes")] [HttpGet("AvailableCustomTypes")]
@@ -128,10 +119,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get a list of all customizable form keys /// Get a list of all customizable form keys
/// Used to build UI for customizing a form /// Used to build UI for customizing a form
///
/// Required roles:
/// BizAdminFull only has rights to customize forms
///
/// </summary> /// </summary>
/// <returns>A list of string formKey values valid for customization</returns> /// <returns>A list of string formKey values valid for customization</returns>
[HttpGet("AvailableCustomizableFormKeys")] [HttpGet("AvailableCustomizableFormKeys")]
@@ -153,9 +140,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Put (update) FormCustom /// Put (update) FormCustom
///
/// Required roles: BizAdminFull
///
/// </summary> /// </summary>
/// <param name="formkey"></param> /// <param name="formkey"></param>
/// <param name="inObj"></param> /// <param name="inObj"></param>
@@ -195,38 +179,6 @@ namespace AyaNova.Api.Controllers
} }
// /// <summary>
// /// Post FormCustom
// ///
// /// Required roles: BizAdminFull
// /// </summary>
// /// <param name="inObj"></param>
// /// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param>
// /// <returns></returns>
// [HttpPost]
// public async Task<IActionResult> PostFormCustom([FromBody] FormCustom inObj, ApiVersion apiVersion)
// {
// if (!serverState.IsOpen)
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// //Instantiate the business object handler
// FormCustomBiz biz = FormCustomBiz.GetBiz(ct, HttpContext);
// //check rights
// if (!Authorized.HasCreateRole(HttpContext.Items, biz.BizType))
// return StatusCode(403, new ApiNotAuthorizedResponse());
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
// //Create and validate
// FormCustom o = await biz.CreateAsync(inObj);
// if (o == null)
// return BadRequest(new ApiErrorResponse(biz.Errors));
// else
// return CreatedAtAction(nameof(FormCustomController.GetFormCustom), new { formkey = o.FormKey, version = apiVersion.ToString() }, new ApiCreatedResponse(o));
// }

View File

@@ -38,11 +38,8 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get available fields for object specified /// Get available fields for Form specified
/// Used to build UI for customizing forms, lists etc /// Used at UI for customizing forms
///
/// Required roles: Any
///
/// </summary> /// </summary>
/// <param name="FormFieldDefinitionKey"></param> /// <param name="FormFieldDefinitionKey"></param>
/// <returns>List of form fields and their properties</returns> /// <returns>List of form fields and their properties</returns>

View File

@@ -58,7 +58,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Upload AyaNova 7 import file /// Upload AyaNova 7 import file
/// Required roles: OpsAdminFull
/// </summary> /// </summary>
/// <returns>NameValue list of filenames and id's</returns> /// <returns>NameValue list of filenames and id's</returns>
[HttpPost] [HttpPost]
@@ -145,8 +144,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Delete import file /// Delete import file
///
/// Required roles: OpsAdminFull
/// </summary> /// </summary>
/// <param name="filename"></param> /// <param name="filename"></param>
/// <returns>Ok</returns> /// <returns>Ok</returns>
@@ -180,8 +177,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get AyaNova 7 data dump uploaded files list /// Get AyaNova 7 data dump uploaded files list
///
/// Required roles: OpsAdminFull
/// </summary> /// </summary>
/// <returns>List of uploaded data dump files</returns> /// <returns>List of uploaded data dump files</returns>
[HttpGet] [HttpGet]
@@ -212,14 +207,11 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// *ERASE DATABASE and start import of previously uploaded import file /// *ERASE DATABASE and start import of previously uploaded import file
/// **This will permanently erase all current data in database without further warning as the first step in the import process** /// **This will permanently erase all current data in database without further warning as the first step in the import process**
///
/// Required roles: OpsAdminFull
///
/// </summary> /// </summary>
/// <param name="filename"></param> /// <param name="filename"></param>
/// <returns>Ok</returns> /// <returns>Ok</returns>
[HttpPost("startImport/{filename}")] [HttpPost("EraseDatabaseAndStartImport/{filename}")]
public ActionResult StartImport([FromRoute] string filename) public ActionResult EraseDatabaseAndStartImport([FromRoute] string filename)
{ {
//Open or opsOnly and user is opsadminfull //Open or opsOnly and user is opsadminfull
if (!serverState.IsOpenOrOpsOnly || (serverState.IsOpsOnly && !Authorized.HasAnyRole(HttpContext.Items, AuthorizationRoles.OpsAdminFull))) if (!serverState.IsOpenOrOpsOnly || (serverState.IsOpsOnly && !Authorized.HasAnyRole(HttpContext.Items, AuthorizationRoles.OpsAdminFull)))

View File

@@ -48,11 +48,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get Operations jobs list /// Get Operations jobs list
///
/// Required roles: OpsAdminFull, OpsAdminLimited, BizAdminFull, BizAdminLimited
///
/// This list cannot be filtered or queried as there are typically not many jobs
///
/// </summary> /// </summary>
/// <returns>List of operations jobs</returns> /// <returns>List of operations jobs</returns>
[HttpGet] [HttpGet]
@@ -86,11 +81,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get Operations log for a job /// Get Operations log for a job
///
/// Required roles: OpsAdminFull, OpsAdminLimited, BizAdminFull, BizAdminLimited
///
/// This list cannot be filtered or queried as there are typically not many jobs
///
/// </summary> /// </summary>
/// <param name="gid"></param> /// <param name="gid"></param>
/// <returns>A tag</returns> /// <returns>A tag</returns>

View File

@@ -46,10 +46,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get License info /// Get License info
///
/// Required roles:
/// AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminFull |
/// AuthorizationRoles.BizAdminLimited | AuthorizationRoles.OpsAdminLimited
/// </summary> /// </summary>
/// <returns>Information about the currently installed license in AyaNova</returns> /// <returns>Information about the currently installed license in AyaNova</returns>
[HttpGet()] [HttpGet()]
@@ -79,9 +75,6 @@ namespace AyaNova.Api.Controllers
/// ///
/// Posting to this route causes AyaNova to attempt to refresh it's license /// Posting to this route causes AyaNova to attempt to refresh it's license
/// from the AyaNova license server /// from the AyaNova license server
///
/// Required roles:
/// AuthorizationRoles.BizAdminFull | AuthorizationRoles.OpsAdminFull
/// </summary> /// </summary>
/// <returns>On success returns information about the currently installed license in AyaNova</returns> /// <returns>On success returns information about the currently installed license in AyaNova</returns>
[HttpPost] [HttpPost]
@@ -140,10 +133,6 @@ namespace AyaNova.Api.Controllers
/// ///
/// Posting to this route causes AyaNova to request a trial license key from the AyaNova license server /// Posting to this route causes AyaNova to request a trial license key from the AyaNova license server
/// Database must be empty and unlicensed or trial license /// Database must be empty and unlicensed or trial license
///
/// Required roles:
/// [OpsFull, BizAdminFull]
///
/// </summary> /// </summary>
/// <param name="requestData"></param> /// <param name="requestData"></param>
/// <returns>HTTP 204 No Content result code on success or fail code with explanation</returns> /// <returns>HTTP 204 No Content result code on success or fail code with explanation</returns>

View File

@@ -53,8 +53,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get Locale all values /// Get Locale all values
///
/// Required roles: Any
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>A single Locale and it's values</returns> /// <returns>A single Locale and it's values</returns>
@@ -90,8 +88,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get Locale pick list /// Get Locale pick list
/// Required roles: Any
///
/// </summary> /// </summary>
/// <returns>Picklist in alphabetical order of all locales</returns> /// <returns>Picklist in alphabetical order of all locales</returns>
[HttpGet("PickList")] [HttpGet("PickList")]
@@ -114,8 +110,6 @@ namespace AyaNova.Api.Controllers
#if (DEBUG) #if (DEBUG)
/// <summary> /// <summary>
/// Get a coverage report of locale keys used versus unused /// Get a coverage report of locale keys used versus unused
/// Required roles: Any
///
/// </summary> /// </summary>
/// <returns>Report of all unique locale keys requested since last server reboot</returns> /// <returns>Report of all unique locale keys requested since last server reboot</returns>
[HttpGet("LocaleKeyCoverage")] [HttpGet("LocaleKeyCoverage")]
@@ -138,8 +132,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get subset of locale values /// Get subset of locale values
/// Required roles: Any
///
/// </summary> /// </summary>
/// <param name="inObj">List of locale key strings</param> /// <param name="inObj">List of locale key strings</param>
/// <returns>A key value array of localized text values</returns> /// <returns>A key value array of localized text values</returns>
@@ -164,9 +156,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Duplicates an existing locale with a new name /// Duplicates an existing locale with a new name
///
/// Required roles: OpsAdminFull | BizAdminFull
///
/// </summary> /// </summary>
/// <param name="inObj">NameIdItem object containing source locale Id and new name</param> /// <param name="inObj">NameIdItem object containing source locale Id and new name</param>
/// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param> /// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param>
@@ -200,11 +189,7 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Put (UpdateLocaleItemDisplayText) /// Put (UpdateLocaleItemDisplayText)
///
/// Required roles: OpsAdminFull | BizAdminFull
///
/// Update a single key with new display text /// Update a single key with new display text
///
/// </summary> /// </summary>
/// <param name="inObj">NewText/Id/Concurrency token object. NewText is new display text, Id is LocaleItem Id, concurrency token is required</param> /// <param name="inObj">NewText/Id/Concurrency token object. NewText is new display text, Id is LocaleItem Id, concurrency token is required</param>
/// <returns></returns> /// <returns></returns>
@@ -272,11 +257,7 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Put (UpdateLocaleName) /// Put (UpdateLocaleName)
///
/// Required roles: OpsAdminFull | BizAdminFull
///
/// Update a locale to change the name (non-stock locales only) /// Update a locale to change the name (non-stock locales only)
///
/// </summary> /// </summary>
/// <param name="inObj">NewText/Id/Concurrency token object. NewText is new locale name, Id is Locale Id, concurrency token is required</param> /// <param name="inObj">NewText/Id/Concurrency token object. NewText is new locale name, Id is Locale Id, concurrency token is required</param>
/// <returns></returns> /// <returns></returns>
@@ -339,10 +320,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Delete Locale /// Delete Locale
///
/// Required roles:
/// BizAdminFull, InventoryFull
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>Ok</returns> /// <returns>Ok</returns>
@@ -395,32 +372,6 @@ namespace AyaNova.Api.Controllers
} }
// private bool LocaleExists(long id)
// {
// return ct.Locale.Any(e => e.Id == id);
// }
//------------
// public class LocaleSubsetParam
// {
// [System.ComponentModel.DataAnnotations.Required]
// public long LocaleId { get; set; }
// [System.ComponentModel.DataAnnotations.Required]
// public List<string> Keys { get; set; }
// public LocaleSubsetParam()
// {
// Keys = new List<string>();
// }
// }
#if (DEBUG) #if (DEBUG)
public class LocaleCoverageInfo public class LocaleCoverageInfo
{ {

View File

@@ -46,9 +46,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get server log /// Get server log
///
/// Required roles:
/// OpsAdminFull | OpsAdminLimited
/// </summary> /// </summary>
/// <param name="logname"></param> /// <param name="logname"></param>
/// <returns>A single log file in plain text</returns> /// <returns>A single log file in plain text</returns>
@@ -93,10 +90,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get list of operations logs /// Get list of operations logs
///
/// Required roles:
/// OpsAdminFull | OpsAdminLimited
///
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet()] [HttpGet()]

View File

@@ -47,9 +47,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get metrics as text document /// Get metrics as text document
///
/// Required roles:
/// OpsAdminFull | OpsAdminLimited
/// </summary> /// </summary>
/// <returns>Snapshot of metrics</returns> /// <returns>Snapshot of metrics</returns>
[HttpGet("TextSnapShot")] [HttpGet("TextSnapShot")]
@@ -77,9 +74,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get metrics as json object /// Get metrics as json object
///
/// Required roles:
/// OpsAdminFull | OpsAdminLimited
/// </summary> /// </summary>
/// <returns>Snapshot of metrics</returns> /// <returns>Snapshot of metrics</returns>
[HttpGet("JsonSnapShot")] [HttpGet("JsonSnapShot")]

View File

@@ -47,11 +47,8 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Post search parameters /// Post search parameters
/// Required roles: Any
/// MaxResults defaults to 500 /// MaxResults defaults to 500
/// MaxResults = 0 returns all results /// MaxResults = 0 returns all results
/// There is no paging as this is a dynamic response
///
/// </summary> /// </summary>
/// <param name="searchParams"></param> /// <param name="searchParams"></param>
/// <returns>SearchResult list</returns> /// <returns>SearchResult list</returns>

View File

@@ -41,9 +41,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get server state /// Get server state
///
/// Required roles:
/// [NONE / authentication not required]
/// </summary> /// </summary>
/// <returns>Current server state (Closed, OpsOnly, Open)</returns> /// <returns>Current server state (Closed, OpsOnly, Open)</returns>
[HttpGet] [HttpGet]
@@ -55,13 +52,8 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Set server state /// Set server state
///
/// Required roles:
/// [OpsFull, BizAdminFull]
///
/// Valid parameters: /// Valid parameters:
/// One of "Closed", "OpsOnly" or "Open" /// One of "Closed", "OpsOnly" or "Open"
///
/// </summary> /// </summary>
/// <param name="state">{"NewState":"Closed"}</param> /// <param name="state">{"NewState":"Closed"}</param>
/// <returns>NoContent 204</returns> /// <returns>NoContent 204</returns>

View File

@@ -43,8 +43,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get tag picklist /// Get tag picklist
///
/// Required roles: Any
/// </summary> /// </summary>
/// <param name="query">The query to filter the returned list by</param> /// <param name="query">The query to filter the returned list by</param>
/// <returns>Filtered list (maximum 25 items are returned for any query)</returns> /// <returns>Filtered list (maximum 25 items are returned for any query)</returns>
@@ -63,8 +61,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get tag cloud list /// Get tag cloud list
///
/// Required roles: Any
/// </summary> /// </summary>
/// <param name="query">The query to filter the returned list by</param> /// <param name="query">The query to filter the returned list by</param>
/// <returns>List</returns> /// <returns>List</returns>
@@ -81,30 +77,5 @@ namespace AyaNova.Api.Controllers
// /// <summary>
// /// Get all possible enumerated values picklist key names
// ///
// /// Required roles: Any
// /// </summary>
// /// <returns>List of AyaNova enumerated type list key names that can be fetched from the AyaEnumPickList/GetPickListRoute</returns>
// [HttpGet("listkeys")]
// public ActionResult GetTypesList()
// {
// if (!serverState.IsOpen)
// {
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// }
// List<KeyValuePair<string, string>> ret = new List<KeyValuePair<string, string>>();
// ret.Add(new KeyValuePair<string, string>("usertypes", "AyaNova user account types"));
// ret.Add(new KeyValuePair<string, string>("authorizationroles", "AyaNova user account role types"));
// ret.Add(new KeyValuePair<string, string>("AyaType", "All AyaNova object types, use the AyaTypeController route to fetch these"));
// return Ok(ApiOkResponse.Response(ret));
// }
}//eoc }//eoc
}//ens }//ens

View File

@@ -49,9 +49,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get User /// Get User
///
/// Required roles:
/// BizAdminFull, BizAdminLimited
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>A single User</returns> /// <returns>A single User</returns>
@@ -88,78 +85,9 @@ namespace AyaNova.Api.Controllers
} }
// /// <summary>
// /// Get paged list of Users
// ///
// /// Required roles:
// /// BizAdminFull, BizAdminLimited
// ///
// /// </summary>
// /// <returns>Paged collection of Users with paging data</returns>
// [HttpGet("ListUsers", Name = nameof(ListUsers))]//We MUST have a "Name" defined or we can't get the link for the pagination, non paged urls don't need a name
// public async Task<IActionResult> ListUsers([FromQuery] ListOptions pagingOptions)
// {
// if (serverState.IsClosed)
// {
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// }
// //Instantiate the business object handler
// UserBiz biz = UserBiz.GetBiz(ct, HttpContext);
// if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
// {
// return StatusCode(403, new ApiNotAuthorizedResponse());
// }
// if (!ModelState.IsValid)
// {
// return BadRequest(new ApiErrorResponse(ModelState));
// }
// ApiPagedResponse<System.Object> pr = await biz.GetManyAsync(Url, nameof(ListUsers), pagingOptions);
// return Ok(new ApiOkWithPagingResponse<System.Object>(pr));
// }
// /// <summary>
// /// Get User pick list
// ///
// /// Required roles: Any
// ///
// /// </summary>
// /// <param name="pagingOptions">Paging, filtering and sorting options</param>
// /// <returns>Paged id/name collection with paging data</returns>
// [HttpGet("PickList", Name = nameof(UserPickList))]
// public ActionResult UserPickList([FromQuery] ListOptions pagingOptions)
// {
// if (serverState.IsClosed)
// {
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// }
// if (!ModelState.IsValid)
// {
// return BadRequest(new ApiErrorResponse(ModelState));
// }
// //Instantiate the business object handler
// UserBiz biz = UserBiz.GetBiz(ct, HttpContext);
// ApiPagedResponse<NameIdItem> pr = biz.GetPickList(Url, nameof(UserPickList), pagingOptions);
// return Ok(new ApiOkWithPagingResponse<NameIdItem>(pr));
// }
/// <summary> /// <summary>
/// Put (update) User /// Put (update) User
///
/// Required roles:
/// BizAdminFull
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <param name="inObj"></param> /// <param name="inObj"></param>
@@ -220,10 +148,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Patch (update) User /// Patch (update) User
///
/// Required roles:
/// BizAdminFull
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <param name="concurrencyToken"></param> /// <param name="concurrencyToken"></param>
@@ -282,10 +206,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Post User /// Post User
///
/// Required roles:
/// BizAdminFull
///
/// </summary> /// </summary>
/// <param name="inObj"></param> /// <param name="inObj"></param>
/// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param> /// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param>
@@ -337,10 +257,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Delete User /// Delete User
///
/// Required roles:
/// BizAdminFull
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>Ok</returns> /// <returns>Ok</returns>

View File

@@ -47,9 +47,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get full UserOptions object /// Get full UserOptions object
///
/// Required roles:
/// BizAdminFull, BizAdminLimited or be users own record
/// </summary> /// </summary>
/// <param name="id">UserId</param> /// <param name="id">UserId</param>
/// <returns>A single UserOptions</returns> /// <returns>A single UserOptions</returns>
@@ -92,10 +89,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Put (update) UserOptions /// Put (update) UserOptions
///
/// Required roles:
/// BizAdminFull or be users own record
///
/// </summary> /// </summary>
/// <param name="id">User id</param> /// <param name="id">User id</param>
/// <param name="inObj"></param> /// <param name="inObj"></param>
@@ -156,9 +149,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Patch (update) UserOptions /// Patch (update) UserOptions
///
/// Required roles:
/// BizAdminFull or be users own record
/// </summary> /// </summary>
/// <param name="id">UserId</param> /// <param name="id">UserId</param>
/// <param name="concurrencyToken"></param> /// <param name="concurrencyToken"></param>

View File

@@ -51,9 +51,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get full widget object /// Get full widget object
///
/// Required roles:
/// BizAdminFull, InventoryFull, BizAdminLimited, InventoryLimited
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>A single widget</returns> /// <returns>A single widget</returns>
@@ -85,119 +82,8 @@ namespace AyaNova.Api.Controllers
// /// <summary>
// /// Get list for selection / viewing
// ///
// /// Required roles: Any in-house staff (some roles might have restrictions on exact fields that are returned)
// ///
// /// </summary>
// /// <param name="pagingOptions">Paging, filtering and sorting options</param>
// /// <returns>Collection with paging data</returns>
// [HttpGet("List", Name = nameof(List))]
// public ActionResult List([FromQuery] ListOptions pagingOptions)
// {
// if (serverState.IsClosed)
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
// //Instantiate the business object handler
// WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
// ApiPagedResponse pr = biz.GetList(Url, nameof(List), pagingOptions).Result;
// return Ok(new ApiOkWithPagingResponse(pr));
// }
// /// <summary>
// /// TEST list with relationships
// ///
// /// Required roles: Any in-house staff (some roles might have restrictions on exact fields that are returned)
// ///
// /// </summary>
// /// <param name="pagingOptions">Paging, filtering and sorting options</param>
// /// <returns>Collection with paging data</returns>
// [HttpGet("TestGetWidgetUserEmailList", Name = nameof(TestGetWidgetUserEmailList))]
// public ActionResult TestGetWidgetUserEmailList([FromQuery] ListOptions pagingOptions)
// {
// if (serverState.IsClosed)
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
// //Instantiate the business object handler
// WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
// ApiPagedResponse pr = biz.TestGetWidgetUserEmailList(Url, nameof(TestGetWidgetUserEmailList), pagingOptions).Result;
// return Ok(new ApiOkWithPagingResponse(pr));
// // string ret= biz.GetList(Url, nameof(List), pagingOptions).Result;
// // return Ok(ret);
// }
// /// <summary>
// /// Get paged list of widgets
// ///
// /// Required roles:
// /// BizAdminFull, InventoryFull, BizAdminLimited, InventoryLimited
// /// </summary>
// /// <returns>Paged collection of widgets with paging data</returns>
// [HttpGet("ListWidgets", Name = nameof(ListWidgets))]//We MUST have a "Name" defined or we can't get the link for the pagination, non paged urls don't need a name
// public async Task<IActionResult> ListWidgets([FromQuery] ListOptions pagingOptions)
// {
// if (serverState.IsClosed)
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// //Instantiate the business object handler
// WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
// if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
// return StatusCode(403, new ApiNotAuthorizedResponse());
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
// ApiPagedResponse<Widget> pr = await biz.GetManyAsync(Url, nameof(ListWidgets), pagingOptions);
// return Ok(new ApiOkWithPagingResponse<Widget>(pr));
// }
// /// <summary>
// /// Get pick list
// ///
// /// Required roles: Any
// ///
// /// </summary>
// /// <param name="pagingOptions">Paging, filtering and sorting options</param>
// /// <returns>Paged id/name collection with paging data</returns>
// [HttpGet("PickList", Name = nameof(WidgetPickList))]
// public ActionResult WidgetPickList([FromQuery] ListOptions pagingOptions)
// {
// if (serverState.IsClosed)
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
// if (!ModelState.IsValid)
// return BadRequest(new ApiErrorResponse(ModelState));
// //Instantiate the business object handler
// WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
// ApiPagedResponse<NameIdItem> pr = biz.GetPickList(Url, nameof(WidgetPickList), pagingOptions);
// return Ok(new ApiOkWithPagingResponse<NameIdItem>(pr));
// }
/// <summary> /// <summary>
/// Put (update) widget /// Put (update) widget
///
/// Required roles:
/// BizAdminFull, InventoryFull
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <param name="inObj"></param> /// <param name="inObj"></param>
@@ -214,7 +100,7 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler //Instantiate the business object handler
WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext); WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
var o = await biz.GetNoLogAsync(id); var o = await biz.GetAsync(id, false);
if (o == null) if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND)); return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
@@ -240,10 +126,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Patch (update) widget /// Patch (update) widget
///
/// Required roles:
/// BizAdminFull, InventoryFull
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <param name="concurrencyToken"></param> /// <param name="concurrencyToken"></param>
@@ -263,7 +145,7 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler //Instantiate the business object handler
WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext); WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
var o = await biz.GetNoLogAsync(id); var o = await biz.GetAsync(id, false);
if (o == null) if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND)); return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
@@ -289,9 +171,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Post widget /// Post widget
///
/// Required roles:
/// BizAdminFull, InventoryFull
/// </summary> /// </summary>
/// <param name="inObj"></param> /// <param name="inObj"></param>
/// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param> /// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param>
@@ -324,9 +203,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Duplicate widget /// Duplicate widget
///
/// Required roles:
/// BizAdminFull, InventoryFull
/// </summary> /// </summary>
/// <param name="id">Create a duplicate of this items id</param> /// <param name="id">Create a duplicate of this items id</param>
/// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param> /// <param name="apiVersion">Automatically filled from route path, no need to specify in body</param>
@@ -347,7 +223,7 @@ namespace AyaNova.Api.Controllers
if (!ModelState.IsValid) if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState)); return BadRequest(new ApiErrorResponse(ModelState));
var oSrc = await biz.GetNoLogAsync(id); var oSrc = await biz.GetAsync(id, false);
if (oSrc == null) if (oSrc == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND)); return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
@@ -364,11 +240,6 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Delete widget /// Delete widget
///
/// Required roles:
/// BizAdminFull, InventoryFull
///
///
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>Ok</returns> /// <returns>Ok</returns>
@@ -384,7 +255,7 @@ namespace AyaNova.Api.Controllers
//Instantiate the business object handler //Instantiate the business object handler
WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext); WidgetBiz biz = WidgetBiz.GetBiz(ct, HttpContext);
var o = await biz.GetNoLogAsync(id); var o = await biz.GetAsync(id, false);
if (o == null) if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND)); return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));

View File

@@ -43,13 +43,7 @@ namespace AyaNova.Biz
return await ct.DataListFilter.AnyAsync(e => e.Id == id); return await ct.DataListFilter.AnyAsync(e => e.Id == id);
} }
////////////////////////////////////////////////////////////////////////////////////////////////
/// GET
internal async Task<DataListFilter> GetNoLogAsync(long fetchId)
{
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
return await ct.DataListFilter.SingleOrDefaultAsync(m => m.Id == fetchId);
}
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
//CREATE //CREATE
@@ -127,6 +121,14 @@ namespace AyaNova.Biz
return ret; return ret;
} }
////////////////////////////////////////////////////////////////////////////////////////////////
/// GET
internal async Task<DataListFilter> GetNoLogAsync(long fetchId)
{
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
return await ct.DataListFilter.SingleOrDefaultAsync(m => m.Id == fetchId);
}
//get picklist (NOT PAGED) //get picklist (NOT PAGED)
internal async Task<List<NameIdItem>> GetPickListAsync(string listKey) internal async Task<List<NameIdItem>> GetPickListAsync(string listKey)

View File

@@ -49,19 +49,11 @@ namespace AyaNova.Biz
/// ///
/// ///
//Get without logging internal async Task<Widget> GetAsync(long fetchId, bool log = true)
internal async Task<Widget> GetNoLogAsync(long fetchId)
{
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
return await ct.Widget.SingleOrDefaultAsync(m => m.Id == fetchId);
}
//Get one with logging
internal async Task<Widget> GetAsync(long fetchId)
{ {
//This is simple so nothing more here, but often will be copying to a different output object or some other ops //This is simple so nothing more here, but often will be copying to a different output object or some other ops
var ret = await ct.Widget.SingleOrDefaultAsync(m => m.Id == fetchId); var ret = await ct.Widget.SingleOrDefaultAsync(m => m.Id == fetchId);
if (ret != null) if (log && ret != null)
{ {
//Log //Log
EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct); EventLogProcessor.LogEventToDatabaseAndSaveEntireContext(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
@@ -264,53 +256,6 @@ namespace AyaNova.Biz
////////////////////////////////////////////////////////////////////////////////////////////////
// LISTS
//
//Generic list of widgets
#region GetList
// internal async Task<ApiPagedResponse> GetList(IUrlHelper Url, string routeName, ListOptions listOptions)
// {
// //TODO: Get template (MOCKED FOR NOW UNTIL PROOF OF CONCEPT)
// var MOCK_WIDGET_DISPLAY_TEMPLATE_JSON = @"
// {
// ""full"":[""widgetname"",""widgetserial"",""widgetdollaramount"",""widgetroles"",""widgetstartdate"",""widgetactive"",""username""],
// ""mini"":[""widgetname"",""widgetserial""]
// }
// ";
// return await DataListFetcher.GetResponse(nameof(WidgetDataList), ct, Url, routeName, listOptions, MOCK_WIDGET_DISPLAY_TEMPLATE_JSON, UserId);
// }
#endregion
//TEST WIDGET->USER->EMAILADDRESS multi table list
//once this is working can replicate at will
#region TestGetWidgetUserEmailList
// internal async Task<ApiPagedResponse> TestGetWidgetUserEmailList(IUrlHelper Url, string routeName, ListOptions listOptions)
// {
// //var dlist=AyaNova.DataList.DataListFactory.GetListOfAllDataListKeyNames();
// //TODO: Get template (MOCKED FOR NOW UNTIL PROOF OF CONCEPT)
// var MOCK_WIDGET_USER_EMAIL_DISPLAY_TEMPLATE_JSON = @"
// {
// ""full"":[""widgetname"",""username"",""emailaddress"",""widgetactive""],
// ""mini"":[""widgetname"",""username"",""emailaddress""]
// }
// ";
// return await DataListFetcher.GetResponse(nameof(TestWidgetUserEmailDataList), ct, Url, routeName, listOptions, MOCK_WIDGET_USER_EMAIL_DISPLAY_TEMPLATE_JSON, UserId);
// }
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////
//VALIDATION //VALIDATION
// //
@@ -324,18 +269,6 @@ namespace AyaNova.Biz
//run validation and biz rules //run validation and biz rules
bool isNew = currentObj == null; bool isNew = currentObj == null;
// if (isNew)
// {
// //WARNING: this is not really the "current" object, it's been modified already by caller
// // //NEW widgets must be active
// // if (inObj.Active == null || ((bool)inObj.Active) == false)
// // {
// // AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Active", "New widget must be active");
// // }
// }
//Name required //Name required
if (string.IsNullOrWhiteSpace(proposedObj.Name)) if (string.IsNullOrWhiteSpace(proposedObj.Name))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name"); AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
@@ -387,23 +320,6 @@ namespace AyaNova.Biz
CustomFieldsValidator.Validate(this, FormCustomization, proposedObj.CustomFields); CustomFieldsValidator.Validate(this, FormCustomization, proposedObj.CustomFields);
} }
//for debug purposes
#if (DEBUG)
//TESTING
//make a fake server error for ui testing purposes
// if (proposedObj.Count == 666)
// {
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "Count", "Test field server error");
// }
//removed because seeding huge kept triggering this
// if (proposedObj.DollarAmount == 666.66M)
// {
// AddError(ApiErrorCode.INVALID_OPERATION, null, "This is a test of a general server error");
// }
//TESTING
#endif
return; return;
} }