Skip to content

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

Remove deprecated code from discount, menu and order

IKarbowiakecaff3060ba4
diff --git a/saleor/graphql/discount/types.py b/saleor/graphql/discount/types.py
index 1f7a905abf..22d76b36d1 100644
--- a/saleor/graphql/discount/types.py
+++ b/saleor/graphql/discount/types.py
@@ -84,13 +84,6 @@ class Voucher(CountableDjangoObjectType):
required=True,
)
type = VoucherTypeEnum(description="Determines a type of voucher.", required=True)
- min_amount_spent = graphene.Field(
- types.Money,
- deprecation_reason=(
- "DEPRECATED: Will be removed in Saleor 2.10, "
- "use the minSpent field instead."
- ),
- )
class Meta:
description = (
@@ -135,7 +128,3 @@ class Voucher(CountableDjangoObjectType):
types.CountryDisplay(code=country.code, country=country.name)
for country in root.countries
]
-
- @staticmethod
- def resolve_min_amount_spent(root: models.Voucher, *_args, **_kwargs):
- return root.min_spent
diff --git a/saleor/graphql/menu/types.py b/saleor/graphql/menu/types.py
index 760e7b4017..4970f8c844 100644
--- a/saleor/graphql/menu/types.py
+++ b/saleor/graphql/menu/types.py
@@ -44,15 +44,6 @@ class MenuItem(CountableDjangoObjectType):
url = graphene.String(description="URL to the menu item.")
translation = TranslationField(MenuItemTranslation, type_name="menu item")
- sort_order = graphene.Field(
- graphene.Int,
- deprecation_reason=(
- "Will be dropped in 2.10 and is deprecated since 2.9: "
- "use the position in list instead and relative "
- "calculus to determine shift position."
- ),
- )
-
class Meta:
description = (
"Represents a single item of the related menu. Can store categories, "
diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.py
index c0b1582af1..20a463629c 100644
--- a/saleor/graphql/order/types.py
+++ b/saleor/graphql/order/types.py
@@ -339,13 +339,6 @@ class Order(MetadataObjectType, CountableDjangoObjectType):
is_shipping_required = graphene.Boolean(
description="Returns True, if order requires shipping.", required=True
)
- discount_amount = graphene.Field(
- Money,
- deprecation_reason=(
- "DEPRECATED: Will be removed in Saleor 2.10, use discount instead."
- ),
- required=True,
- )
class Meta:
description = "Represents an order in the shop."
@@ -500,10 +493,6 @@ class Order(MetadataObjectType, CountableDjangoObjectType):
def resolve_gift_cards(root: models.Order, _info):
return root.gift_cards.all()
- @staticmethod
- def resolve_discount_amount(root: models.Order, _info):
- return root.discount
-
@staticmethod
@permission_required(OrderPermissions.MANAGE_ORDERS)
def resolve_private_meta(root: models.Order, _info):
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 0f6dc6e1a7..2bc6ddc691 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -1896,7 +1896,7 @@ input MenuInput {
type MenuItem implements Node {
id: ID!
name: String!
- sortOrder: Int @deprecated(reason: "Will be dropped in 2.10 and is deprecated since 2.9: use the position in list instead and relative calculus to determine shift position.")
+ sortOrder: Int
menu: Menu!
parent: MenuItem
category: Category
@@ -2361,7 +2361,6 @@ type Order implements Node {
totalBalance: Money!
userEmail: String
isShippingRequired: Boolean!
- discountAmount: Money! @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, use discount instead.")
}
enum OrderAction {
@@ -4401,7 +4400,6 @@ type Voucher implements Node {
products(before: String, after: String, first: Int, last: Int): ProductCountableConnection
countries: [CountryDisplay]
translation(languageCode: LanguageCodeEnum!): VoucherTranslation
- minAmountSpent: Money @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, use the minSpent field instead.")
}
type VoucherAddCatalogues {
diff --git a/tests/api/test_discount.py b/tests/api/test_discount.py
index 7e6b6b1135..e51f360dca 100644
--- a/tests/api/test_discount.py
+++ b/tests/api/test_discount.py
@@ -162,9 +162,6 @@ mutation voucherCreate(
minSpent {
amount
}
- minAmountSpent {
- amount
- }
minCheckoutItemsQuantity
name
code
diff --git a/tests/api/test_order.py b/tests/api/test_order.py
index 61f51e18e9..ba6e3fb151 100644
--- a/tests/api/test_order.py
+++ b/tests/api/test_order.py
@@ -538,9 +538,6 @@ def test_draft_order_create(
message
}
order {
- discountAmount {
- amount
- }
discount {
amount
}