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

Gift cards CRUD #7681

Merged
merged 23 commits into from
Aug 16, 2021
Merged

Gift cards CRUD #7681

merged 23 commits into from
Aug 16, 2021

Conversation

bmigirl
Copy link

@bmigirl bmigirl commented Jul 23, 2021

This PR adds CRUD API for gift cards.

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

@bmigirl bmigirl added the test deployment Deploy test environment for pull request label Jul 23, 2021
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 26, 2021 12:34 Inactive
@db-queries
Copy link

db-queries bot commented Jul 26, 2021

Here is the report for ef23acf (mirumee:feature/gift-cards)
Base comparison is e2eff9a.

Found 6 differences! (click me)

# saleor.graphql.accountbenchmark account
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  customers query                                            	         48	         48	              0
- delete staff members                                       	         32	         34	              0
  query staff user                                           	         18	         18	              3
  staff create                                               	         23	         23	              3
  staff update groups and permissions                        	         32	         32	              4

# 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.attributebenchmark attribute
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  attribute translation                                      	          5	          5	              0
  attribute value translation                                	         26	         26	              0
  query attribute                                            	          6	          6	              0
  query attributes                                           	          8	          8	              0

# saleor.graphql.checkoutbenchmark checkout mutations
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  add billing address to checkout                            	         53	         53	              5
  add checkout lines                                         	         49	         49	              8
  add shipping to checkout                                   	         66	         66	              8
  checkout email update                                      	         27	         27	              0
  checkout payment charge                                    	         42	         42	             15
  checkout shipping address update                           	         71	         71	             12
  checkout voucher code                                      	         74	         74	             13
  complete checkout                                          	        111	        111	             13
  complete checkout with single line                         	        113	        113	             13
  create checkout                                            	         75	         75	             12
  customer complete checkout                                 	        157	        157	             42
  update checkout lines                                      	         51	         51	              8

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

# saleor.graphql.discountbenchmark sales
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  sales query with channel slug                              	         16	         16	              0
  sales query withot channel slug                            	         15	         15	              0

# saleor.graphql.discountbenchmark vouchers
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  vouchers query with channel slug                           	         16	         16	              0
  vouchers query withot channel slug                         	         15	         15	              0

# saleor.graphql.giftcardbenchmark gift card mutations
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
+ create never expiry gift card                              	          -	         14	              4
+ update gift card                                           	          -	         15	              3

# saleor.graphql.giftcardbenchmark gift card queries
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
+ filter gift cards by tag                                   	          -	         10	              3
+ query gift card details                                    	          -	         11	              3
+ query gift cards                                           	          -	         10	              3

# saleor.graphql.orderbenchmark fulfillment refund and return products
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  fulfillment refund products order lines                    	         53	         53	              2
  fulfillment return products order lines                    	        101	        101	             14

# saleor.graphql.orderbenchmark order
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  staff multiple draft orders                                	        402	        402	            306
  staff multiple orders                                      	        152	        152	             74
  staff order details                                        	         46	         46	              5
  user order details                                         	         42	         42	              5

# saleor.graphql.pagebenchmark page type
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  query page type                                            	         19	         19	              7
  query page types                                           	         25	         25	             12

# saleor.graphql.productbenchmark category
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  categories children                                        	          3	          3	              0
  category delete                                            	        108	        108	             27
  category view                                              	         27	         27	              1

# saleor.graphql.productbenchmark collection
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  collection add products                                    	         44	         44	             10
  collection bulk delete                                     	         51	         51	             10
  collection view                                            	          6	          6	              0
  create collection                                          	         47	         47	             12
  delete collection                                          	         46	         46	             11
  remove products from collection                            	         41	         41	             10
  retrieve collection channel listings                       	          4	          4	              0

# saleor.graphql.productbenchmark homepage
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  report product sales                                       	         10	         10	              3
  retrieve product list                                      	          4	          4	              0

# saleor.graphql.productbenchmark product
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  filter products by attributes                              	          9	          9	              0
  filter products by boolean attributes                      	         19	         19	              0
  filter products by numeric attributes                      	         18	         18	              0
  product create                                             	         70	         70	              3
  product details                                            	         31	         31	              0
  product translations                                       	          5	          5	              0
  retrieve channel listings                                  	         21	         21	              0
  retrieve product attributes                                	          9	          9	              0
  retrieve product images                                    	          4	          4	              0
  retrieve product media                                     	          4	          4	              0
  retrive products with product types and attributes         	          7	          7	              0
  update product                                             	         46	         46	              4

# saleor.graphql.productbenchmark product variant channel listing update
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  variant channel listing update                             	         50	         50	              5

# saleor.graphql.productbenchmark variant
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  product variant bulk create                                	         63	         63	              2
  product variant create                                     	         75	         75	              6
  retrieve variant list                                      	         25	         25	              0
  update product variant                                     	         79	         79	             12

# 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
  query product variants stocks                              	         14	         14	              4

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

# saleor.graphql.shippingbenchmark shipping methods
  test name                                                  	left count 	right count	duplicate count
  -----------------------------------------------------------	-----------	-----------	---------------
  vouchers query with channel slug                           	         10	         10	              0
  vouchers query without channel slug                        	          9	          9	              0

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

@codecov
Copy link

codecov bot commented Jul 26, 2021

Codecov Report

Merging #7681 (ef23acf) into master (e2eff9a) will increase coverage by 0.02%.
The diff coverage is 95.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7681      +/-   ##
==========================================
+ Coverage   93.18%   93.21%   +0.02%     
==========================================
  Files         470      475       +5     
  Lines       35738    36146     +408     
  Branches     3762     3801      +39     
==========================================
+ Hits        33302    33693     +391     
- Misses       1670     1678       +8     
- Partials      766      775       +9     
Impacted Files Coverage Δ
saleor/graphql/account/tests/benchmark/fixtures.py 100.00% <ø> (ø)
saleor/graphql/giftcard/filters.py 81.81% <81.81%> (ø)
saleor/core/utils/promo_code.py 87.50% <83.33%> (+2.31%) ⬆️
saleor/graphql/giftcard/types.py 92.17% <91.38%> (-7.83%) ⬇️
saleor/graphql/giftcard/mutations.py 98.28% <97.32%> (-0.75%) ⬇️
saleor/core/__init__.py 100.00% <100.00%> (ø)
saleor/core/utils/validators.py 100.00% <100.00%> (ø)
saleor/discount/models.py 93.04% <100.00%> (ø)
saleor/giftcard/__init__.py 100.00% <100.00%> (ø)
saleor/giftcard/events.py 100.00% <100.00%> (ø)
... and 17 more

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 e2eff9a...ef23acf. Read the comment docs.

@github-actions github-actions bot temporarily deployed to feature-gift-cards July 26, 2021 12:50 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 27, 2021 12:00 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 27, 2021 12:09 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 28, 2021 06:31 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 28, 2021 06:32 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 28, 2021 06:46 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 28, 2021 06:49 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 28, 2021 08:24 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 28, 2021 13:37 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards July 30, 2021 09:30 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards August 2, 2021 08:32 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards August 4, 2021 07:43 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards August 13, 2021 10:21 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards August 13, 2021 12:15 Inactive
@github-actions github-actions bot temporarily deployed to feature-gift-cards August 13, 2021 12:40 Inactive
@maarcingebala maarcingebala marked this pull request as ready for review August 16, 2021 12:16
@maarcingebala maarcingebala changed the title Feature/gift cards Gift cards CRUD Aug 16, 2021
@maarcingebala maarcingebala added the approved-breaking-change PRs with this label have approved breaking changes in the GraphQL schema label Aug 16, 2021
@maarcingebala maarcingebala merged commit 1f93312 into master Aug 16, 2021
@maarcingebala maarcingebala deleted the feature/gift-cards branch August 16, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved-breaking-change PRs with this label have approved breaking changes in the GraphQL schema test deployment Deploy test environment for pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants