This commit is contained in:
@@ -146,7 +146,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(new ApiErrorResponse(ModelState));
|
||||
return Ok(ApiOkResponse.Response(AyDataType.ValidCustomFieldTypes, true));
|
||||
return Ok(ApiOkResponse.Response(CustomFieldType.ValidCustomFieldTypes, true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,19 +12,19 @@ namespace AyaNova.Biz
|
||||
public const string Tags = "tags";
|
||||
public const string Enum = "enum";//enums are just integers in the db so the sql code handles it like an int, but the client needs to know it's an enum
|
||||
|
||||
public static List<string> ValidCustomFieldTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
var ret = new List<string>();
|
||||
ret.Add(AyDataType.Date);
|
||||
ret.Add(AyDataType.Text);
|
||||
ret.Add(AyDataType.Integer);
|
||||
ret.Add(AyDataType.Bool);
|
||||
ret.Add(AyDataType.Decimal);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
// public static List<string> ValidCustomFieldTypes
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// var ret = new List<string>();
|
||||
// ret.Add(AyDataType.Date);
|
||||
// ret.Add(AyDataType.Text);
|
||||
// ret.Add(AyDataType.Integer);
|
||||
// ret.Add(AyDataType.Bool);
|
||||
// ret.Add(AyDataType.Decimal);
|
||||
// return ret;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
43
server/AyaNova/biz/CustomFieldType.cs
Normal file
43
server/AyaNova/biz/CustomFieldType.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
public static class CustomFieldType
|
||||
{
|
||||
//v7 custom field types:
|
||||
// - Currency
|
||||
// - DateAndTime
|
||||
// - TimeOnly
|
||||
// - DateOnly
|
||||
// - Number
|
||||
// - Text
|
||||
// - Bool
|
||||
|
||||
public const string Currency = "currency";
|
||||
public const string Date = "date";
|
||||
public const string Time = "time";
|
||||
public const string DateTime = "datetime";
|
||||
public const string Text = "text";
|
||||
public const string Number = "number"; //decimal regardless
|
||||
public const string Bool = "bool";
|
||||
|
||||
|
||||
|
||||
public static List<string> ValidCustomFieldTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
var ret = new List<string>();
|
||||
ret.Add(CustomFieldType.Currency);
|
||||
ret.Add(CustomFieldType.Date);
|
||||
ret.Add(CustomFieldType.Time);
|
||||
ret.Add(CustomFieldType.DateTime);
|
||||
ret.Add(CustomFieldType.Text);
|
||||
ret.Add(CustomFieldType.Number);
|
||||
ret.Add(CustomFieldType.Bool);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ namespace AyaNova.Biz
|
||||
//Template json must parse
|
||||
if ((!PropertyHasErrors("FormKey") && !string.IsNullOrWhiteSpace(inObj.Template)))
|
||||
{
|
||||
var ValidCustomFieldTypes = AyDataType.ValidCustomFieldTypes;
|
||||
var ValidCustomFieldTypes = CustomFieldType.ValidCustomFieldTypes;
|
||||
var ValidFormFields = FormAvailableFields.FormFields(inObj.FormKey);
|
||||
try
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace AyaNova.Util
|
||||
""fld"": ""WidgetCustom1"",
|
||||
""hide"": ""false"",
|
||||
""required"": ""false"",
|
||||
""type"": ""date""
|
||||
""type"": ""datetime""
|
||||
},
|
||||
{
|
||||
""fld"": ""WidgetCustom2"",
|
||||
@@ -103,7 +103,7 @@ namespace AyaNova.Util
|
||||
""fld"": ""WidgetCustom3"",
|
||||
""hide"": ""false"",
|
||||
""required"": ""false"",
|
||||
""type"": ""int""
|
||||
""type"": ""number""
|
||||
},
|
||||
{
|
||||
""fld"": ""WidgetCustom4"",
|
||||
@@ -115,7 +115,19 @@ namespace AyaNova.Util
|
||||
""fld"": ""WidgetCustom5"",
|
||||
""hide"": ""false"",
|
||||
""required"": ""false"",
|
||||
""type"": ""decimal""
|
||||
""type"": ""currency""
|
||||
},
|
||||
{
|
||||
""fld"": ""WidgetCustom6"",
|
||||
""hide"": ""false"",
|
||||
""required"": ""false"",
|
||||
""type"": ""date""
|
||||
},
|
||||
{
|
||||
""fld"": ""WidgetCustom7"",
|
||||
""hide"": ""false"",
|
||||
""required"": ""false"",
|
||||
""type"": ""time""
|
||||
}
|
||||
]"
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user