create database seeder for the services for testing environment

This commit is contained in:
omair saleh
2021-03-12 13:49:05 +08:00
parent d877681bff
commit 4430d71860
12 changed files with 1100 additions and 9 deletions
@@ -71,6 +71,7 @@ class UpdateSupplierCurrenciesLogic extends AbstractControllerLogic
/**
* @param Request $request
* @return JsonResponse
* @throws ResourceNotFoundException
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
@@ -87,17 +88,18 @@ class UpdateSupplierCurrenciesLogic extends AbstractControllerLogic
);
try {
$constant = $this->fetchesConstant->execute(['supplier_currencies' => $supplierId]);
$this->canUpdateConstant->passes($object);
$this->updatesConstant->execute($constant, $object);
} catch (\Exception $exception) {
} catch (ResourceNotFoundException $exception){
$this->canCreateConstant->passes($object);
$segment = $this->fetchesSegment->execute(['type' => SegmentConstants::STANDARD_SEGMENT]);
$constant = $this->createsConstant->execute($segment, $object);
$this->createsConstant->execute($segment, $object);
}
return $this->resourceResponse(new ConstantResource($constant));
return $this->response([]);
}