Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Api] Unnecessary addresses should not be saved to the database while addressing an order#12719

Merged
GSadee merged 3 commits into
Sylius:masterfrom
Tomanhez:denying-usage-of-unexisting-promotion-coupon
Jun 30, 2021
Merged

[Api] Unnecessary addresses should not be saved to the database while addressing an order#12719
GSadee merged 3 commits into
Sylius:masterfrom
Tomanhez:denying-usage-of-unexisting-promotion-coupon

Conversation

@Tomanhez
Copy link
Copy Markdown
Contributor

Q A
Branch? master
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
License MIT

@Tomanhez Tomanhez added API APIs related issues and PRs. Bug Confirmed bugs or bugfixes. labels Jun 18, 2021
@Tomanhez Tomanhez requested a review from a team as a code owner June 18, 2021 07:30
Comment thread features/checkout/addressing_order/changing_address.feature Outdated
Comment thread features/checkout/addressing_order/changing_address.feature Outdated
Comment thread src/Sylius/Behat/Context/Api/AddressContext.php Outdated
Comment thread features/checkout/addressing_order/changing_address.feature Outdated
Comment thread features/checkout/addressing_order/changing_address.feature Outdated
Comment thread src/Sylius/Behat/Context/Api/Shop/CheckoutContext.php Outdated
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch 3 times, most recently from d3663ca to 2d4e640 Compare June 21, 2021 06:18
@Tomanhez Tomanhez changed the title [Api] Denying usage of unexisting promotion coupon [Api] Unnecessary addresses should not be saved to the database while addressing an order Jun 21, 2021
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch from 2d4e640 to 4e17555 Compare June 21, 2021 07:47
Comment thread src/Sylius/Behat/Context/Api/AddressContext.php Outdated
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch 6 times, most recently from 1162a76 to ac6517b Compare June 23, 2021 07:48
Comment thread src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/AddressOrderHandler.php Outdated
Comment thread src/Sylius/Bundle/ApiBundle/Mapper/AddressMapperInterface.php Outdated
Comment thread src/Sylius/Bundle/ApiBundle/spec/Mapper/AddressMapperSpec.php
Comment thread src/Sylius/Bundle/ApiBundle/Mapper/AddressMapper.php Outdated
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch 3 times, most recently from c7fa511 to 35125d7 Compare June 24, 2021 07:28
/** @var AddressInterface $newBillingAddress */
$newBillingAddress = $addressOrder->billingAddress;
/** @var AddressInterface|null $newShippingAddress */
$newShippingAddress = $addressOrder->shippingAddress ?? clone $newBillingAddress;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both assigns are pointless to be done here, and should be done in if's below not before them IMHO.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe the reason is that we need to type-hint them with Core/AddressInterface... Why these properties are type-hinted with Addressing/AddressInterface in the command?

Comment thread src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/AddressOrderHandler.php Outdated
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch 2 times, most recently from d844c41 to 8c0bca1 Compare June 24, 2021 09:36
Comment thread src/Sylius/Bundle/ApiBundle/Tests/config/fixtures/channel.yaml Outdated
/** @var AddressInterface $newBillingAddress */
$newBillingAddress = $addressOrder->billingAddress;
/** @var AddressInterface|null $newShippingAddress */
$newShippingAddress = $addressOrder->shippingAddress ?? clone $newBillingAddress;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe the reason is that we need to type-hint them with Core/AddressInterface... Why these properties are type-hinted with Addressing/AddressInterface in the command?

@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch from 8c0bca1 to 3ed4829 Compare June 24, 2021 11:13
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch 2 times, most recently from c484bdb to 34a5809 Compare June 24, 2021 11:29
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch from 34a5809 to d497968 Compare June 24, 2021 13:07
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch 4 times, most recently from b1f8239 to f4091f3 Compare June 28, 2021 09:22
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch from f4091f3 to 7c596c0 Compare June 30, 2021 06:43
@Tomanhez Tomanhez force-pushed the denying-usage-of-unexisting-promotion-coupon branch from 7c596c0 to a2d5c78 Compare June 30, 2021 10:22
When the visitor changes the billing address to "Los Angeles", "Avenue", "90210", "United States" for "Jon Snow"
And the visitor completes the addressing step
Then the visitor should has "Los Angeles", "Avenue", "90210", "United States", "Jon Snow" specified as billing address
Then the visitor should has "Los Angeles", "Avenue", "90210", "United States", "Jon Snow" specified as shipping address
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Then the visitor should has "Los Angeles", "Avenue", "90210", "United States", "Jon Snow" specified as shipping address
And the visitor should has "Los Angeles", "Avenue", "90210", "United States", "Jon Snow" specified as shipping address

@GSadee GSadee dismissed Zales0123’s stale review June 30, 2021 12:09

I guess that your suggestions have been applied

@GSadee GSadee merged commit f0c5fdb into Sylius:master Jun 30, 2021
@GSadee
Copy link
Copy Markdown
Member

GSadee commented Jun 30, 2021

Thanks, Tomasz! 🥇

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. Bug Confirmed bugs or bugfixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants