-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HP-1631: added into Customer entity state #73
Open
VadymHrechukha
wants to merge
29
commits into
hiqdev:master
Choose a base branch
from
VadymHrechukha:HP-1631_release_re-implemented_actions_charge
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
96029e2
HP-1631: added into Customer entity state
VadymHrechukha 0b6a488
HP-1631: Implemented state field in Customer model
VadymHrechukha 302f89d
HP-1631: created CustomerState
VadymHrechukha d54f6d9
HP-1631: added all customer states into CustomerState
VadymHrechukha 2b04c3a
HP-1631: fixed Customer
VadymHrechukha 7c1611c
HP-1631: created ActionStateDeterminer class
VadymHrechukha a8886bc
HP-1631: created Unit test for ActionStateDeterminer class
VadymHrechukha ca0fe01
HP-1631: removed Analyzer classes because they don't need anymore
VadymHrechukha 6a368f5
HP-1631: completed RestateActionsService class
VadymHrechukha ebdf697
HP-1631: renamed ActionState::isFinished() into ActionState::isNotAct…
VadymHrechukha 9828d4c
HP-1631: created Behat test for check ActionStateDeterminer class
VadymHrechukha b34a233
HP-1631: added strict types to Factory because it is hard to understa…
VadymHrechukha 1e0f18e
HP-1631: added annotation for Factory::get() method
VadymHrechukha 41cacd7
HP-1631: added BuilderInterface::createSale() and BuilderInterface::b…
VadymHrechukha 22c85c2
HP-1631: Renamed YiiActionRepository into ActionRepository class and …
VadymHrechukha 37c07ba
HP-1631: modernized RestateActionsServiceTest Unit test
VadymHrechukha dfb7231
HP-1631: fixing RestateActionsServiceTest Unit test
VadymHrechukha c9a4c9b
HP-1631: fixed CustomerHydrator and created CustomerStateHydrator
VadymHrechukha 2981ac3
HP-1631: added all possible states into CustomerState
VadymHrechukha 183a7dc
HP-1631: fixed CustomerState::isDeleted() method
VadymHrechukha 04a6a3c
HP-1631: ActionInterface must extend EntityInterface
VadymHrechukha 7006e78
HP-1631: returned failed state to ActionState
VadymHrechukha db98bad
HP-1631: returned failed state to ActionState
VadymHrechukha dd9c18c
HP-1631: created CustomerStateException
VadymHrechukha a172483
HP-1631: tiny
VadymHrechukha 18bd6e5
HP-1631: fixed cancelled action state name
VadymHrechukha 2da650c
Merge branch 'master' into HP-1631_release_re-implemented_actions_charge
VadymHrechukha 11e129f
HP-1631 Fixed "Class SimplePlanRepository contains 1 abstract method …
VadymHrechukha 9b70aed
HP-1631 fixed ActionStateDeterminer Behat test
VadymHrechukha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace hiqdev\php\billing\Exception; | ||
|
||
use hiqdev\php\billing\ExceptionInterface; | ||
|
||
class CustomerStateException extends RuntimeException implements ExceptionInterface | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,8 @@ | |
|
||
namespace hiqdev\php\billing\action; | ||
|
||
use DateInterval; | ||
use DateTimeImmutable; | ||
use hiqdev\php\billing\customer\CustomerInterface; | ||
use hiqdev\php\billing\EntityInterface; | ||
use hiqdev\php\billing\Exception\CannotReassignException; | ||
use hiqdev\php\billing\sale\SaleInterface; | ||
use hiqdev\php\billing\target\TargetInterface; | ||
|
@@ -27,7 +25,7 @@ | |
* | ||
* @author Andrii Vasyliev <[email protected]> | ||
*/ | ||
abstract class AbstractAction implements ActionInterface, EntityInterface | ||
abstract class AbstractAction implements ActionInterface | ||
{ | ||
/** @var int */ | ||
protected $id; | ||
|
@@ -169,9 +167,9 @@ public function setFinished(): void | |
$this->state = ActionState::finished(); | ||
} | ||
|
||
public function isFinished(): ?bool | ||
public function isNotActive(): ?bool | ||
{ | ||
return $this->state === null ? null : $this->state->isFinished(); | ||
return $this->state === null ? null : $this->state->isNotActive(); | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
|
||
use DateTimeImmutable; | ||
use hiqdev\php\billing\customer\CustomerInterface; | ||
use hiqdev\php\billing\EntityInterface; | ||
use hiqdev\php\billing\price\PriceInterface; | ||
use hiqdev\php\billing\sale\SaleInterface; | ||
use hiqdev\php\billing\target\TargetInterface; | ||
|
@@ -30,7 +31,7 @@ | |
* | ||
* @author Andrii Vasyliev <[email protected]> | ||
*/ | ||
interface ActionInterface extends \JsonSerializable | ||
interface ActionInterface extends EntityInterface | ||
{ | ||
/** | ||
* Returns if the given price applicable to this action. | ||
|
@@ -70,7 +71,7 @@ public function getSale(): ?SaleInterface; | |
/** | ||
* Returns null if the action state is not set. | ||
*/ | ||
public function isFinished(): ?bool; | ||
public function isNotActive(): ?bool; | ||
|
||
public function getParent(): ?ActionInterface; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Update Remaining Usages of
isFinished()
toisNotActive()
The method
isFinished()
is still used in the following files:src/bill/Bill.php
src/charge/Charge.php
Please update these method calls to
isNotActive()
to maintain consistency and prevent potential errors.🔗 Analysis chain
Approve renaming
isFinished()
toisNotActive()
with suggestionsThe renaming of
isFinished()
toisNotActive()
improves clarity and aligns better with the method's functionality. The internal logic update is consistent with this change.Consider adding a PHPDoc comment to explain the purpose and behavior of the
isNotActive()
method, especially if it differs from the previousisFinished()
method.Please run the following script to check for any remaining usage of the
isFinished()
method in the codebase:Ensure that all occurrences of
isFinished()
are updated toisNotActive()
if they refer to this class.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 226