Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Change TaxRateType to Enum in vat query

fowczarekbe8c2287eb81
diff --git a/saleor/core/__init__.py b/saleor/core/__init__.py
index 9f906c6f35..c308a477b1 100644
--- a/saleor/core/__init__.py
+++ b/saleor/core/__init__.py
@@ -84,4 +84,5 @@ class TaxRateType:
(RESTAURANTS, pgettext_lazy('VAT rate type', 'restaurants')),
(SOCIAL_HOUSING, pgettext_lazy('VAT rate type', 'social housing')),
(STANDARD, pgettext_lazy('VAT rate type', 'standard')),
- (WATER, pgettext_lazy('VAT rate type', 'water')))
+ (WATER, pgettext_lazy('VAT rate type', 'water')),
+ (WINE, pgettext_lazy('VAT rate type', 'wine')))
diff --git a/saleor/graphql/core/types/money.py b/saleor/graphql/core/types/money.py
index 7473d585f9..0e6fafcf9a 100644
--- a/saleor/graphql/core/types/money.py
+++ b/saleor/graphql/core/types/money.py
@@ -3,6 +3,8 @@ from textwrap import dedent
import graphene
from django_prices.templatetags import prices_i18n
+from ..enums import TaxRateType
+
class Money(graphene.ObjectType):
currency = graphene.String(description='Currency code.', required=True)
@@ -77,7 +79,7 @@ class VAT(graphene.ObjectType):
class ReducedRate(graphene.ObjectType):
rate = graphene.Float(
description='Reduced VAT rate in percent.', required=True)
- rate_type = graphene.String(description='A type of goods.', required=True)
+ rate_type = TaxRateType(description='A type of goods.', required=True)
class Meta:
description = dedent('''