This commit is contained in:
2020-05-07 00:07:40 +00:00
parent 6edbbb822a
commit 94c7025865
5 changed files with 27 additions and 8 deletions

View File

@@ -71,6 +71,10 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(o, !Authorized.HasModifyRole(HttpContext.Items, biz.BizType)));
}
//TODO: GET BY RELATIVE
//get by descendent type and id
/// <summary>
@@ -116,7 +120,7 @@ namespace AyaNova.Api.Controllers
//TODO: this should post a workorder instead, no need for Create first like this
/// <summary>
/// Post WorkOrder
@@ -148,10 +152,15 @@ namespace AyaNova.Api.Controllers
return BadRequest(new ApiErrorResponse(biz.Errors));
else
return CreatedAtAction(nameof(WorkOrderController.GetWorkOrder), new { id = o.Id, version = apiVersion.ToString() }, new ApiCreatedResponse(o));
}
//TODO: CreateFromTemplate(templateid)
//TODO: Createfromquote(quoteid)
//todo: createfrompm(pmid)
/// <summary>
/// Duplicate WorkOrder
/// </summary>

View File

@@ -80,9 +80,13 @@ namespace AyaNova.Biz
[CoreBizObject]
WorkOrderItem = 35,
[CoreBizObject]
WorkOrderTemplate = 36,
WorkOrderItemLabor = 36,
[CoreBizObject]
WorkOrderTemplateItem = 37
WorkOrderItemPart = 37,
[CoreBizObject]
WorkOrderTemplate = 38,
[CoreBizObject]
WorkOrderTemplateItem = 39
//NOTE: New objects added here need to also be added to the following classes:

View File

@@ -76,6 +76,9 @@ WARNING: Since version 3.0.0, each Include will cause an additional JOIN to be a
////////////////////////////////////////////////////////////////////////////////////////////////
//CREATE
//TODO: Modify this to expect a workorder object like most POST routes for other objects
//No need for this style of create empty and return
//Called from route and also seeder
internal async Task<WorkOrder> CreateAsync(long? workorderTemplateId, long? customerId, uint? serial)
{

View File

@@ -35,7 +35,7 @@ namespace AyaNova.Models
//NOTE: this could be a common class applied to everything for common biz rule stuff
//i.e. specific rights in situations based on rules, like candelete, canedit etc
[NotMapped]
public bool NonDataBaseExampleColumn { get; set; }//example of how to add a property that is not persisted but is used by both ends dynamically, should come up with a naming scheme so can see them at a glance
public string OP { get; set; }//Patch operation value, e.g. "add", "remove", "replace"
}//eoc

View File

@@ -24,21 +24,24 @@ namespace AyaNova.Models
//Principle
[Required]
public long WorkorderId { get; set; }//fk
[JsonIgnore]//Avoid circular reference when serializing
public WorkOrder WorkOrder { get; set; }
//dependents
public List<WorkOrderItemLabor> WorkorderItemLabors { get; set; }
public WorkOrderItem()
{
Tags = new List<string>();
WorkorderItemLabors = new List<WorkOrderItemLabor>();
}
//Not persisted business properties
//NOTE: this could be a common class applied to everything for common biz rule stuff
//i.e. specific rights in situations based on rules, like candelete, canedit etc
[NotMapped]
public bool NonDataBaseExampleColumn { get; set; }//example of how to add a property that is not persisted but is used by both ends dynamically, should come up with a naming scheme so can see them at a glance
public bool OP { get; set; }//patch operation value
}//eoc