public ActionResult <OfficeCheckInResponse> Update(int id, OfficeCheckInRequest movement) { if (!ModelState.IsValid) { return(BadRequest()); } if (movement.Custody) { return(_officeCheckInRepository.UpdateCheckInWithCustody(id, movement)); } if (movement.Failed) { return(_officeCheckInRepository.UpdateCheckInWithFailure(id, movement)); } if (movement.OfficeToOffice) { return(_officeCheckInRepository.UpdateLogisticsOnlyCheckIn(id, movement)); } if (movement.MovementType == MovementType.Deposit) { return(_officeCheckInRepository.UpdateIncomingCheckIn(id, movement)); } if (movement.MovementType == MovementType.Dispatch) { return(_officeCheckInRepository.UpdateOutgoingCheckIn(id, movement)); } return(BadRequest("The request didn't fulfill any of the conditions to be processed")); }
public IActionResult Create(OfficeCheckInRequest movement) { if (!ModelState.IsValid) { return(BadRequest()); } if (movement.Custody) { return(_officeCheckInRepository.CreateCheckInWithCustody(movement)); } if (movement.Failed) { return(_officeCheckInRepository.CreateCheckInWithFailure(movement)); } if (movement.OfficeToOffice) { return(_officeCheckInRepository.CreateLogisticsOnlyCheckIn(movement)); } if (movement.MovementType == MovementType.Deposit) { return(_officeCheckInRepository.CreateIncomingCheckIn(movement)); } return(BadRequest("The request didn't fulfill any of the conditions to be processed")); }