feat: promotion usage limit (#13760)

* feat: promotion usage limit

* fix: update, refactor tests, parallel case

* fix: batch update, cleanup unused map

* feat: paralel campaign and promotion tests

* chore: changesets, fix i18 schema

* fix: ui tweaks

* chore: refactor

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Frane Polić
2025-11-30 19:43:36 +01:00
committed by GitHub
co-authored by Oli Juhl
parent 5da51064d7
commit 536a3f802c
18 changed files with 1269 additions and 11 deletions
@@ -7683,6 +7683,12 @@
"taxInclusive": {
"type": "string"
},
"usageLimit": {
"type": "string"
},
"usage": {
"type": "string"
},
"amount": {
"type": "object",
"properties": {
@@ -7784,6 +7790,8 @@
"addCondition",
"clearAll",
"taxInclusive",
"usageLimit",
"usage",
"amount",
"conditions"
],
@@ -8230,6 +8238,19 @@
},
"required": ["fixed", "percentage"],
"additionalProperties": false
},
"limit": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": ["title", "description"],
"additionalProperties": false
}
},
"required": [
@@ -8245,7 +8266,8 @@
"allocation",
"code",
"value",
"value_type"
"value_type",
"limit"
],
"additionalProperties": false
},
@@ -2051,6 +2051,8 @@
"addCondition": "Add condition",
"clearAll": "Clear all",
"taxInclusive": "Tax Inclusive",
"usageLimit": "Usage Limit",
"usage": "Usage",
"amount": {
"tooltip": "Select the currency code to enable setting the amount"
},
@@ -2212,6 +2214,10 @@
"title": "Percentage",
"description": "The percentage to discount off the amount. eg. 8%"
}
},
"limit": {
"title": "Usage Limit",
"description": "Maximum number of times this promotion can be used across all orders. Leave empty for unlimited usage."
}
},
"deleteWarning": "You are about to delete the promotion {{code}}. This action cannot be undone.",