This commit is contained in:
@@ -58,7 +58,7 @@ namespace AyaNova.Api.Controllers
|
||||
/// <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>
|
||||
/// <returns>A single FormCustom or nothing and a header 304 not modified</returns>
|
||||
[HttpGet("{formkey}")]
|
||||
[HttpGet("{formkey}")]
|
||||
public async Task<IActionResult> GetFormCustom([FromRoute] string formkey, [FromQuery] uint? concurrencyToken)
|
||||
{
|
||||
if (serverState.IsClosed)
|
||||
@@ -127,28 +127,30 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// Get available types allowed for Custom fields
|
||||
// /// Used to build UI for customizing a form
|
||||
// ///
|
||||
// /// Required roles:
|
||||
// /// BizAdminFull only has rights to customize forms
|
||||
// ///
|
||||
// /// </summary>
|
||||
// /// <returns>A list of type string values valid for custom fields</returns>
|
||||
// [HttpGet("AvailableCustomTypes")]
|
||||
// public ActionResult GetAvailableCustomTypes()
|
||||
// {
|
||||
// if (serverState.IsClosed)
|
||||
// return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
|
||||
// if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.FormCustom))
|
||||
// return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
// if (!ModelState.IsValid)
|
||||
// return BadRequest(new ApiErrorResponse(ModelState));
|
||||
// return Ok(ApiOkResponse.Response(CustomFieldType.ValidCustomFieldTypes, true));
|
||||
// }
|
||||
/// <summary>
|
||||
/// Get available types allowed for Custom fields
|
||||
/// Used to build UI for customizing a form
|
||||
///
|
||||
/// Required roles:
|
||||
/// BizAdminFull only has rights to customize forms
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns>A list of type string values valid for custom fields</returns>
|
||||
[HttpGet("AvailableCustomTypes")]
|
||||
public ActionResult GetAvailableCustomTypes()
|
||||
{
|
||||
if (serverState.IsClosed)
|
||||
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
|
||||
|
||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.FormCustom))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
return Ok(ApiOkResponse.Response(CustomFieldType.ValidCustomFieldTypes, true));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -244,7 +246,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
// if (!ModelState.IsValid)
|
||||
// return BadRequest(new ApiErrorResponse(ModelState));
|
||||
|
||||
|
||||
// //Create and validate
|
||||
// FormCustom o = await biz.CreateAsync(inObj);
|
||||
// if (o == null)
|
||||
|
||||
@@ -447,6 +447,7 @@ namespace AyaNova
|
||||
if (TESTING_REFRESH_DB)
|
||||
{
|
||||
AyaNova.Core.License.Fetch(apiServerState, dbContext, _newLog);
|
||||
//NOTE: For unit testing make sure the time zone in util is set to the same figure as here to ensure list filter by date tests will work because server is on same page as user in terms of time
|
||||
Util.Seeder.SeedDatabase(Util.Seeder.SeedLevel.SmallOneManShopTrialDataSet, -7);//#############################################################################################
|
||||
}
|
||||
//TESTING
|
||||
|
||||
@@ -442,6 +442,9 @@ namespace AyaNova.Biz
|
||||
break;
|
||||
|
||||
case FilterSpecialToken.NextMonth:
|
||||
//BUGBUG?
|
||||
//SERVER thinks midnight UTC is 7am our time on January 1st 2020
|
||||
//TEST thinks midnight UTC is 8am our time on January 1st 2020
|
||||
//start with the first day of this month
|
||||
dtAfter = new DateTime(RelativeToday.Year, RelativeToday.Month, 1, RelativeToday.Hour, RelativeToday.Minute, 00);
|
||||
//Add a Month
|
||||
|
||||
Reference in New Issue
Block a user