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

Fix for fulfilling an order when product quantity equals allocated quantity #6333

Conversation

GrzegorzDerdak
Copy link
Contributor

@GrzegorzDerdak GrzegorzDerdak commented Oct 26, 2020

Fix for fulfilling an order when product quantity equals allocated quantity

Impact

  • New migrations
  • New/Updated API fields or mutations
  • Deprecated API fields or mutations
  • Removed API types, fields, or mutations
  • Documentation needs to be updated

Pull Request Checklist

  • Privileged queries and mutations are guarded by proper permission checks
  • Database queries are optimized and the number of queries is constant
  • Database migration files are up to date
  • The changes are tested
  • GraphQL schema and type definitions are up to date
  • Changes are mentioned in the changelog

Related frontend Pull Request

saleor/saleor-dashboard#788

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #6333 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6333      +/-   ##
==========================================
+ Coverage   91.90%   91.91%   +0.01%     
==========================================
  Files         391      392       +1     
  Lines       26083    26116      +33     
  Branches     2473     2475       +2     
==========================================
+ Hits        23971    24005      +34     
  Misses       1519     1519              
+ Partials      593      592       -1     
Impacted Files Coverage Δ
saleor/graphql/order/dataloaders.py 100.00% <100.00%> (ø)
saleor/graphql/order/types.py 90.75% <100.00%> (+0.15%) ⬆️
saleor/graphql/warehouse/types.py 100.00% <100.00%> (ø)
saleor/order/utils.py 90.29% <0.00%> (+0.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60dab6a...a5bedd2. Read the comment docs.

@db-queries
Copy link

db-queries bot commented Oct 26, 2020

Here is the report for a5bedd2 (mirumee/saleor @ SALEOR-1403-cannot-fulfill-order-when-product-quantity-equals-allocated-quantity)
Base comparison is 60dab6a.

No differences were found. (click me)

# saleor.graphql.accountbenchmark account
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  delete staff members                                       	         32	         32	              0
  query staff user                                           	         20	         20	              4
  staff create                                               	         22	         22	              4
  staff update groups and permissions                        	         33	         33	              5

# saleor.graphql.accountbenchmark permission group
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  permission group create                                    	         19	         19	              2
  permission group delete                                    	         20	         20	              3
  permission group query                                     	          7	          7	              0
  permission group update                                    	         33	         33	              1
  permission group update remove users with manage staff     	         27	         27	              3

# saleor.graphql.checkoutbenchmark checkout mutations
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  add billing address to checkout                            	         72	         72	             42
  add shipping to checkout                                   	         50	         50	             19
  checkout email update                                      	         41	         41	             21
  checkout payment charge                                    	         38	         38	             10
  checkout shipping address update                           	         58	         58	             18
  checkout voucher code                                      	         85	         85	             53
  complete checkout                                          	        119	        119	             25
  create checkout                                            	        130	        130	             64
  update checkout lines                                      	        114	        114	             54

# saleor.graphql.checkoutbenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  user checkout details                                      	         51	         51	             27

# saleor.graphql.menubenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  retrieve main menu                                         	          5	          5	              0
  retrieve secondary menu                                    	          5	          5	              0

# saleor.graphql.orderbenchmark order
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  user order details                                         	         17	         17	              3

# saleor.graphql.productbenchmark category
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  category view                                              	         18	         18	              1

# saleor.graphql.productbenchmark collection
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  collection view                                            	         17	         17	              0

# saleor.graphql.productbenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  featured products list                                     	         14	         14	              0
  retrieve product list                                      	          5	          5	              0

# saleor.graphql.productbenchmark product
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  product details                                            	         16	         16	              0
  retrieve product attributes                                	          7	          7	              0
  retrive products with product types and attributes         	          5	          5	              0

# saleor.graphql.productbenchmark variant
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  product variant bulk create                                	         48	         48	              2
  retrieve variant list                                      	         18	         18	              2

# saleor.graphql.productbenchmark variant stocks
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  product variants stocks create                             	         22	         22	              5
  product variants stocks delete                             	         19	         19	              5
  product variants stocks update                             	         27	         27	              5

# saleor.graphql.producttest product sorting attributes
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  sort product not having attribute data                     	         20	         20	              0

# saleor.graphql.shopbenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  retrieve shop                                              	          2	          2	              0

@GrzegorzDerdak GrzegorzDerdak force-pushed the SALEOR-1403-cannot-fulfill-order-when-product-quantity-equals-allocated-quantity branch from a328a14 to 4855289 Compare October 27, 2020 10:30
@GrzegorzDerdak GrzegorzDerdak self-assigned this Oct 28, 2020
@GrzegorzDerdak GrzegorzDerdak marked this pull request as ready for review October 28, 2020 11:58
@GrzegorzDerdak GrzegorzDerdak requested a review from a team October 28, 2020 11:58
saleor/graphql/order/types.py Outdated Show resolved Hide resolved
saleor/graphql/order/types.py Outdated Show resolved Hide resolved
saleor/graphql/order/types.py Outdated Show resolved Hide resolved
saleor/graphql/order/types.py Outdated Show resolved Hide resolved
saleor/graphql/order/dataloaders.py Outdated Show resolved Hide resolved
@GrzegorzDerdak GrzegorzDerdak force-pushed the SALEOR-1403-cannot-fulfill-order-when-product-quantity-equals-allocated-quantity branch from 22f4702 to f16931f Compare October 30, 2020 11:09
@GrzegorzDerdak GrzegorzDerdak force-pushed the SALEOR-1403-cannot-fulfill-order-when-product-quantity-equals-allocated-quantity branch from f16931f to a5bedd2 Compare October 30, 2020 11:12
@maarcingebala maarcingebala merged commit c1e0c1c into master Oct 30, 2020
@maarcingebala maarcingebala deleted the SALEOR-1403-cannot-fulfill-order-when-product-quantity-equals-allocated-quantity branch October 30, 2020 12:03
maarcingebala pushed a commit that referenced this pull request Oct 30, 2020
…antity (#6333)

* Fix for fulfilling an order when product quantity equals allocated quantity

* Add tests, update the CHANGELOG.md, modify schema objects

* Style improvements

* Add data loader, add permission decorator, style changes

* Changes after code review
maarcingebala added a commit that referenced this pull request Nov 3, 2020
* Bump requirements (#6332)

* Fix order_updated not triggering on mutation orderupdate (#6336)

* Drop origin from Plugin configuration. Take it from the paymentData (#6341)

* Drop origin from configuration. Take it from the paymentData

* Handle the case when plugin drops configuration field

* Apply changes after review

Co-authored-by: Marcin Gębala <5421321+maarcingebala@users.noreply.github.com>

Co-authored-by: Marcin Gębala <5421321+maarcingebala@users.noreply.github.com>

* Fix uvicorn to use standard dependencies (#6345)

* Fix empty name and description in updatePlugin mutation response (#6346)

* Fix inccorect name and help text for 3D Secure field (#6350)

* Fix adyen notifications handling (#6343)

* Fix invalid payment_id in get_payment handling

* Add merchant account validation in webhooks

* Prevent breaking handle_webhook when request is a GET request

* Update saleor/payment/gateways/adyen/webhooks.py

Co-authored-by: Marcin Gębala <5421321+maarcingebala@users.noreply.github.com>

* Update handle_webhook - add logger warnings

* Add adyen webhooks get_payment method tests

Co-authored-by: Marcin Gębala <5421321+maarcingebala@users.noreply.github.com>

* Add order note that refund has been requested (#6347)

* Add order note that refund has been requested

* Add 'Adyen' at the begginig of the msg

* Fix failing saleor autocapture. Improve the handler for authorization (#6348)

* Fix failing saleor autocapture. Improve the webhook hanlder for authorization

* Handle cases when payment is already voided and when is still active

* Fix failing test after merged branches related to adyen (#6355)

* Fix failing test after merged branches related to adyen

* Fix assert condition

* Improve aproval rate for adyen requests (#6315)

* Improve aproval rate for adyen requests

* Improve the test coverage

* Make sure that gross_net is not 0

* Check if field contians data before we will add them to adyen paylaod

* Include line total to webhook payload (#6354)

* Include line total to webhook payload

* Update changelog

* Add validation for order update related mutations (#6324)

* Run order_updated on order update, secure order update mutations based on order status

* Error message fix on DraftOrderUpdate

* OrderUpdate mutation improvements and optimizations

* Fix for fulfilling an order when product quantity equals allocated quantity (#6333)

* Fix for fulfilling an order when product quantity equals allocated quantity

* Add tests, update the CHANGELOG.md, modify schema objects

* Style improvements

* Add data loader, add permission decorator, style changes

* Changes after code review

* Change aggregation of stock allocations to single allocation (#6362)

* Fix for updating product variant without providing an attributes (#6353)

* Fix for the ability to filter products on collection (#6363)

* Fix filters on collection

* Fix broken tests, update CHANGELOG.md

* Handle custom schemes (#6370)

* Update translations (#6379)

* Bump requirements (#6378)

* Fix product related dataloaders to be accessible by app (#6380)

Co-authored-by: Tomasz Szymański <tomasz.szymanski@stxnext.pl>
Co-authored-by: Maciej Korycinski <korycinski.maciej@gmail.com>
Co-authored-by: Iga Karbowiak <40886528+IKarbowiak@users.noreply.github.com>
Co-authored-by: Grzegorz Derdak <grzegorz.derdak@stxnext.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants