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

Change filed type to choice field of tax rate in product #3478

Conversation

fowczarek
Copy link
Member

@fowczarek fowczarek commented Dec 18, 2018

I want to merge this change because resolve #2829

Screenshots

Pull Request Checklist

  1. Privileged views and APIs are guarded by proper permission checks.
  2. All visible strings are translated with proper context.
  3. All data-formatting is locale-aware (dates, numbers, and so on).
  4. Database queries are optimized and the number of queries is constant.
  5. Database migration files are up to date.
  6. The changes are tested.
  7. The code is documented (docstrings, project documentation).
  8. GraphQL schema and type definitions are up to date.
  9. Changes are mentioned in the changelog.

@fowczarek fowczarek self-assigned this Dec 18, 2018
@codecov
Copy link

codecov bot commented Dec 18, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@7930490). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3478   +/-   ##
=========================================
  Coverage          ?   89.75%           
=========================================
  Files             ?      237           
  Lines             ?    12950           
  Branches          ?     1313           
=========================================
  Hits              ?    11623           
  Misses            ?      922           
  Partials          ?      405
Impacted Files Coverage Δ
saleor/product/models.py 93.02% <ø> (ø)
saleor/graphql/product/types.py 97.01% <100%> (ø)

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 7930490...5e7117f. Read the comment docs.

@@ -1448,6 +1448,33 @@ enum ProductOrderField {
DATE
}

enum ProductTaxRate {
Copy link
Member

Choose a reason for hiding this comment

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

We already have the TaxRateType in the schema. The difference is that TaxRateType is implemented explicitly by us, while this one is generated by Graphene after introducing choices in tax_rate field (I guess). We should only keep one of them in the schema. I think the TaxRateType would be easier to drop but the question is how can we use the ProductTaxRate in other places.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it good now?

Copy link
Member

Choose a reason for hiding this comment

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

Looks good now! We're changing the type here and since we keep the same name of the field, we cannot deprecate it. This means that we have to pass this PR to @dominik-zeglen to fix references to taxRate field in the Dashboard 2.0.

@dominik-zeglen
Copy link
Contributor

Front end reports full okayness.

@maarcingebala maarcingebala merged commit a2285d7 into master Dec 18, 2018
@maarcingebala maarcingebala deleted the 2829/Change_filed_type_to_choice_field_of_tax_rate_in_Product branch December 18, 2018 10:55
@@ -286,6 +286,7 @@ class Product(CountableDjangoObjectType):
Money,
description=dedent("""The product's base price (without any discounts
applied)."""))
tax_rate = TaxRateType(description='A type of tax rate.')
Copy link
Member

Choose a reason for hiding this comment

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

The a type of... is sounding weird to me.
What do you think of: The tax rate type. ?

Copy link
Member

Choose a reason for hiding this comment

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

Welp @maarcingebala just merged it 😆

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.

TaxRate on the Product model should be a choice field
4 participants