Skip to content

Commit

Permalink
clockwork install and changes for methods names
Browse files Browse the repository at this point in the history
  • Loading branch information
rigonlucas committed Aug 21, 2024
1 parent 2341f44 commit dabf3d6
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 5 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"license": "MIT",
"require": {
"php": "^8.3",
"itsgoingd/clockwork": "^5.2",
"laravel/framework": "^11.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.9",
Expand Down
77 changes: 76 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions core/Application/Account/Create/CreateAccountUseCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
*/
public function execute(AccountInput $input): AccountEntity
{
$accountEntity = $this->processAccount($input);
$accountEntity = $this->processAccountCreation($input);

$userEntity = UserEntity::forIdentify($input->getUserId());
$accountEntity->setUserEntity($userEntity);
Expand All @@ -45,13 +45,13 @@ public function execute(AccountInput $input): AccountEntity
/**
* @throws AccountNotFoundException
*/
private function processAccount(AccountInput $input): ?AccountEntity
private function processAccountCreation(AccountInput $input): ?AccountEntity
{
if (is_null($input->accessCode)) {
return $this->createNewAccount($input);
}

return $this->findAnAccount($input);
return $this->findAnAccountByAccessCode($input);
}

private function createNewAccount(AccountInput $input): AccountEntity
Expand All @@ -65,7 +65,7 @@ private function createNewAccount(AccountInput $input): AccountEntity
/**
* @throws AccountNotFoundException
*/
private function findAnAccount(AccountInput $accountInput): AccountEntity
private function findAnAccountByAccessCode(AccountInput $accountInput): AccountEntity
{
$accountEntity = $this->accountRepository->findByAccessCode($accountInput->accessCode);
if (is_null($accountEntity)) {
Expand Down
3 changes: 3 additions & 0 deletions storage/clockwork/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.json
*.json.gz
index

0 comments on commit dabf3d6

Please sign in to comment.