This commit is contained in:
@@ -15,12 +15,12 @@ Remove OwnerId
|
|||||||
- DONE UserOptions remove but also has a bit below
|
- DONE UserOptions remove but also has a bit below
|
||||||
- DONE ValidateJsonPatch
|
- DONE ValidateJsonPatch
|
||||||
- DONE FileAttachment
|
- DONE FileAttachment
|
||||||
|
- DONE FormCustom
|
||||||
|
|
||||||
- Rename OwnerId to UserId for those objects that require it still
|
- Rename OwnerId to UserId for those objects that require it still
|
||||||
- DataFilter
|
- DONE DataFilter
|
||||||
- EventLog
|
- EventLog
|
||||||
- Event object uses it see eventlog above
|
- Event object uses it see eventlog above
|
||||||
- FormCustom uses it much like DataFilter does, could also be renamed to UserId and semantically be better
|
|
||||||
- UserOptions (rename to userID)
|
- UserOptions (rename to userID)
|
||||||
- OpsJob (might be removable, rename it CreatorID? Or, if it's already logged in the event log then maybe no creator ID is required at all.)
|
- OpsJob (might be removable, rename it CreatorID? Or, if it's already logged in the event log then maybe no creator ID is required at all.)
|
||||||
|
|
||||||
|
|||||||
@@ -59,10 +59,8 @@ namespace AyaNova.Biz
|
|||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//do stuff with datafilter
|
//do stuff with object
|
||||||
FormCustom outObj = inObj;
|
FormCustom outObj = inObj;
|
||||||
outObj.OwnerId = UserId;
|
|
||||||
|
|
||||||
|
|
||||||
await ct.FormCustom.AddAsync(outObj);
|
await ct.FormCustom.AddAsync(outObj);
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
@@ -104,9 +102,6 @@ namespace AyaNova.Biz
|
|||||||
//put
|
//put
|
||||||
internal bool Put(FormCustom dbObj, FormCustom inObj)
|
internal bool Put(FormCustom dbObj, FormCustom inObj)
|
||||||
{
|
{
|
||||||
//preserve the owner ID if none was specified
|
|
||||||
if (inObj.OwnerId == 0)
|
|
||||||
inObj.OwnerId = dbObj.OwnerId;
|
|
||||||
|
|
||||||
//Replace the db object with the PUT object
|
//Replace the db object with the PUT object
|
||||||
CopyObject.Copy(inObj, dbObj, "Id");
|
CopyObject.Copy(inObj, dbObj, "Id");
|
||||||
@@ -138,17 +133,6 @@ namespace AyaNova.Biz
|
|||||||
private void Validate(FormCustom inObj, bool isNew)
|
private void Validate(FormCustom inObj, bool isNew)
|
||||||
{
|
{
|
||||||
|
|
||||||
//OwnerId required
|
|
||||||
if (!isNew)
|
|
||||||
{
|
|
||||||
if (inObj.OwnerId == 0)
|
|
||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "OwnerId");
|
|
||||||
}
|
|
||||||
|
|
||||||
// //Owner must be current user, there are no exceptions
|
|
||||||
// if (inObj.OwnerId != UserId)
|
|
||||||
// AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "OwnerId", "OwnerId must be current user Id");
|
|
||||||
|
|
||||||
//FormKey required and must be valid
|
//FormKey required and must be valid
|
||||||
if (string.IsNullOrWhiteSpace(inObj.FormKey))
|
if (string.IsNullOrWhiteSpace(inObj.FormKey))
|
||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "FormKey");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "FormKey");
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ namespace AyaNova.Models
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public uint ConcurrencyToken { get; set; }
|
public uint ConcurrencyToken { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
public long OwnerId { get; set; }
|
|
||||||
|
|
||||||
[Required, MaxLength(255)]
|
[Required, MaxLength(255)]
|
||||||
public string FormKey { get; set; }//max 255 characters ascii set
|
public string FormKey { get; set; }//max 255 characters ascii set
|
||||||
public string Template { get; set; }//JSON fragment of form customization template
|
public string Template { get; set; }//JSON fragment of form customization template
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ namespace AyaNova.Util
|
|||||||
{
|
{
|
||||||
LogUpdateMessage(log);
|
LogUpdateMessage(log);
|
||||||
|
|
||||||
exec("CREATE TABLE aformcustom (id BIGSERIAL PRIMARY KEY, ownerid bigint not null, " +
|
exec("CREATE TABLE aformcustom (id BIGSERIAL PRIMARY KEY, " +
|
||||||
"formkey varchar(255) not null, template text, UNIQUE(formkey))");
|
"formkey varchar(255) not null, template text, UNIQUE(formkey))");
|
||||||
setSchemaLevel(++currentSchema);
|
setSchemaLevel(++currentSchema);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user