Skip to content

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

Add new graphql schema, globalTypes and migration

fowczarekac664929c697
diff --git a/saleor/discount/migrations/0014_auto_20190628_0154.py b/saleor/discount/migrations/0014_auto_20190628_0154.py
new file mode 100644
index 0000000000..d83461197e
--- /dev/null
+++ b/saleor/discount/migrations/0014_auto_20190628_0154.py
@@ -0,0 +1,30 @@
+# Generated by Django 2.2.2 on 2019-06-28 06:54
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [("discount", "0013_auto_20190618_0733")]
+
+ operations = [
+ migrations.AlterField(
+ model_name="voucher",
+ name="type",
+ field=models.CharField(
+ choices=[
+ ("entire_order", "Entire order"),
+ ("product", "Specific products"),
+ ("collection", "Specific collections of products"),
+ ("category", "Specific categories of products"),
+ ("shipping", "Shipping"),
+ (
+ "specific_product",
+ "Specific products, collections and categories",
+ ),
+ ],
+ default="entire_order",
+ max_length=20,
+ ),
+ )
+ ]
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 5fae35a9ae..8bd224e4c2 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -3203,11 +3203,12 @@ type VoucherTranslation implements Node {
}
enum VoucherType {
- VALUE
+ ENTIRE_ORDER
PRODUCT
COLLECTION
CATEGORY
SHIPPING
+ SPECIFIC_PRODUCT
}
enum VoucherTypeEnum {
@@ -3215,7 +3216,8 @@ enum VoucherTypeEnum {
COLLECTION
CATEGORY
SHIPPING
- VALUE
+ ENTIRE_ORDER
+ SPECIFIC_PRODUCT
}
type VoucherUpdate {
diff --git a/saleor/static/dashboard-next/types/globalTypes.ts b/saleor/static/dashboard-next/types/globalTypes.ts
index b410be0d84..a70c313c03 100644
--- a/saleor/static/dashboard-next/types/globalTypes.ts
+++ b/saleor/static/dashboard-next/types/globalTypes.ts
@@ -206,17 +206,19 @@ export enum VoucherDiscountValueType {
export enum VoucherType {
CATEGORY = "CATEGORY",
COLLECTION = "COLLECTION",
+ ENTIRE_ORDER = "ENTIRE_ORDER",
PRODUCT = "PRODUCT",
SHIPPING = "SHIPPING",
- VALUE = "VALUE",
+ SPECIFIC_PRODUCT = "SPECIFIC_PRODUCT",
}
export enum VoucherTypeEnum {
CATEGORY = "CATEGORY",
COLLECTION = "COLLECTION",
+ ENTIRE_ORDER = "ENTIRE_ORDER",
PRODUCT = "PRODUCT",
SHIPPING = "SHIPPING",
- VALUE = "VALUE",
+ SPECIFIC_PRODUCT = "SPECIFIC_PRODUCT",
}
export enum WeightUnitsEnum {
@@ -577,6 +579,7 @@ export interface VoucherInput {
categories?: (string | null)[] | null;
minAmountSpent?: any | null;
countries?: (string | null)[] | null;
+ applyOncePerOrder?: boolean | null;
}
//==============================================================