Skip to content
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

[API] Extract user logic rules for orders to separate extension #13984

Merged
merged 2 commits into from
May 18, 2022

Conversation

lchrusciel
Copy link
Member

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Related tickets Continues #13962
License MIT

@lchrusciel lchrusciel requested a review from a team as a code owner May 13, 2022 14:04
@probot-autolabeler probot-autolabeler bot added the API APIs related issues and PRs. label May 13, 2022
@lchrusciel lchrusciel force-pushed the order-extensions-refactor branch from f9c962a to d57c018 Compare May 13, 2022 14:39
@lchrusciel lchrusciel changed the title [WIP][API] Extract user logic rules for orders to separate extension [API] Extract user logic rules for orders to separate extension May 13, 2022
@lchrusciel lchrusciel force-pushed the order-extensions-refactor branch from d57c018 to e83f422 Compare May 13, 2022 14:52
@lchrusciel lchrusciel force-pushed the order-extensions-refactor branch from e83f422 to cd256c7 Compare May 17, 2022 15:04
Comment on lines +44 to +49
$rootAlias = $queryBuilder->getRootAliases()[0];
$user = $this->userContext->getUser();

if (!$user instanceof ShopUserInterface) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$rootAlias = $queryBuilder->getRootAliases()[0];
$user = $this->userContext->getUser();
if (!$user instanceof ShopUserInterface) {
return;
}
$user = $this->userContext->getUser();
if (!$user instanceof ShopUserInterface) {
return;
}
$rootAlias = $queryBuilder->getRootAliases()[0];

Comment on lines +43 to +49
$rootAlias = $queryBuilder->getRootAliases()[0];

$user = $this->userContext->getUser();

if ($user !== null) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$rootAlias = $queryBuilder->getRootAliases()[0];
$user = $this->userContext->getUser();
if ($user !== null) {
return;
}
$user = $this->userContext->getUser();
if ($user !== null) {
return;
}
$rootAlias = $queryBuilder->getRootAliases()[0];

);
}

function it_does_nothing_if_object_passed_is_different_then_order(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function it_does_nothing_if_object_passed_is_different_then_order(
function it_does_nothing_if_object_passed_is_different_than_order(

$this->beConstructedWith($userContext);
}

function it_filters_carts_for_visitors_to_not_authorized_for_methods_other_then_get(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function it_filters_carts_for_visitors_to_not_authorized_for_methods_other_then_get(
function it_filters_carts_for_visitors_to_not_authorized_for_methods_other_than_get(

$this->beConstructedWith($userContext);
}

function it_filters_carts_for_shop_users_to_the_one_owned_by_them_for_methods_other_then_get(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function it_filters_carts_for_shop_users_to_the_one_owned_by_them_for_methods_other_then_get(
function it_filters_carts_for_shop_users_to_the_one_owned_by_them_for_methods_other_than_get(

);
}

function it_does_nothing_if_object_passed_is_different_then_order(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function it_does_nothing_if_object_passed_is_different_then_order(
function it_does_nothing_if_object_passed_is_different_than_order(

@GSadee GSadee merged commit ffe8f6b into Sylius:master May 18, 2022
@GSadee
Copy link
Member

GSadee commented May 18, 2022

Thank you, Łukasz! 🎉

@lchrusciel lchrusciel deleted the order-extensions-refactor branch May 29, 2022 16:28
GSadee added a commit that referenced this pull request Feb 3, 2023
…ciel, jakubtobiasz)

This PR was merged into the 1.12 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | master  |
| Bug fix?        | no                                                       |
| New feature?    | no                                                       |
| BC breaks?      | no                                                       |
| Deprecations?   | no |
| Related tickets | #13984 (review) |
| License         | MIT                                                          |

<!--
 - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

25fd428 [Minor] Typo fixes and small code improvement
ed00a4e Fix wrongly placed changes
GSadee added a commit to Sylius/SyliusApiBundle that referenced this pull request Feb 13, 2023
…ciel, jakubtobiasz)

This PR was merged into the 1.12 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | master  |
| Bug fix?        | no                                                       |
| New feature?    | no                                                       |
| BC breaks?      | no                                                       |
| Deprecations?   | no |
| Related tickets | Sylius/Sylius#13984 (review) |
| License         | MIT                                                          |

<!--
 - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible)
 - Features and deprecations must be submitted against the master branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

25fd428c3f1d7689617148c7eed7cd69583b53d7 [Minor] Typo fixes and small code improvement
ed00a4e474c271c4399b66aaab974ed3541ad7c5 Fix wrongly placed changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API APIs related issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants