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

File diff suppressed because it is too large Load Diff

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"));

View File

@@ -38,11 +38,7 @@ namespace AyaNova.Api.Controllers
serverState = apiServerState;
}
//todo: finish this off, it's missing some shit, and also check it's modernized
//will also likely need a seperate fetch route for just the header and just an item
//prefer named routes for each rather than some kind of parameter for existing routes, i.e. get{id} for whole graph and get headeronly/{id}
//STATES OUTSIDE SERVICE
/*
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗