This commit is contained in:
2021-07-23 23:31:43 +00:00
parent b7e06c1b13
commit 2756b2578e
13 changed files with 7631 additions and 373 deletions

View File

@@ -141,8 +141,24 @@ namespace AyaNova.Api.Controllers
case AyaType.WorkOrderItemTravel:
case AyaType.WorkOrderItemOutsideService:
case AyaType.WorkOrderItemUnit:
AyaTypeId TypeId = new AyaTypeId(AyaType.WorkOrder, (await WorkOrderBiz.GetWorkOrderIdFromRelativeAsync(ayaType, id, ct)).WorkOrderId);
return Ok(ApiOkResponse.Response(new { AyaType = TypeId.ATypeAsInt, Id = TypeId.ObjectId }));
{
AyaTypeId TypeId = new AyaTypeId(AyaType.WorkOrder, (await WorkOrderBiz.GetWorkOrderIdFromRelativeAsync(ayaType, id, ct)).ParentId);
return Ok(ApiOkResponse.Response(new { AyaType = TypeId.ATypeAsInt, Id = TypeId.ObjectId }));
}
case AyaType.QuoteItem:
case AyaType.QuoteItemExpense:
case AyaType.QuoteItemLabor:
case AyaType.QuoteItemLoan:
case AyaType.QuoteItemPart:
case AyaType.QuoteItemScheduledUser:
case AyaType.QuoteItemTask:
case AyaType.QuoteItemTravel:
case AyaType.QuoteItemOutsideService:
case AyaType.QuoteItemUnit:
{
AyaTypeId TypeId = new AyaTypeId(AyaType.Quote, (await QuoteBiz.GetQuoteIdFromRelativeAsync(ayaType, id, ct)).ParentId);
return Ok(ApiOkResponse.Response(new { AyaType = TypeId.ATypeAsInt, Id = TypeId.ObjectId }));
}
default:
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_INVALID_VALUE, null, "Only types with ancestors are valid"));