fix(core-flows, dashboard, types): improve allocation flows on Admin (#12572)

**What**
- handle single inventory items with `required_quantity > 1` correctly in the allocate UI flow
- display correct availability amount in the create fulullment form for inventory kit items
- fix check in the create fulfillment flow that would allow negative reservation because `required_quantity` wasn't included in the check
- show the most recent reservations first in the reservations table
- display an error in the allocation form if a reservation is not created for some inventory items 
- display inventory kit in the order summary if the product has multiple same inventory items

---

CLOSES SUP-1655
This commit is contained in:
Frane Polić
2025-08-19 18:48:24 +00:00
committed by GitHub
parent 67d3660abf
commit 2f594291ad
15 changed files with 295 additions and 55 deletions
@@ -3816,16 +3816,31 @@
"credit": {
"type": "string"
},
"creditDescription": {
"type": "string"
},
"debit": {
"type": "string"
},
"debitDescription": {
"type": "string"
},
"creditDescription": {
"type": "string"
}
}
},
"required": [
"title",
"total",
"creditOrDebit",
"createCreditLine",
"createCreditLineSuccess",
"createCreditLineError",
"createCreditLineDescription",
"operation",
"credit",
"creditDescription",
"debit",
"debitDescription"
],
"additionalProperties": false
},
"balanceSettlement": {
"type": "object",
@@ -3851,9 +3866,18 @@
"creditLineDescription": {
"type": "string"
}
}
},
"required": [
"paymentMethod",
"paymentMethodDescription",
"creditLine",
"creditLineDescription"
],
"additionalProperties": false
}
}
},
"required": ["title", "settlementType", "settlementTypes"],
"additionalProperties": false
},
"domain": {
"type": "string"
@@ -4876,9 +4900,12 @@
"properties": {
"created": {
"type": "string"
},
"error": {
"type": "string"
}
},
"required": ["created"],
"required": ["created", "error"],
"additionalProperties": false
},
"error": {
@@ -5539,6 +5566,9 @@
}
},
"required": [
"giftCardsStoreCreditLines",
"creditLines",
"balanceSettlement",
"domain",
"claim",
"exchange",
@@ -11229,6 +11259,8 @@
},
"required": [
"amount",
"reference",
"reference_id",
"refundAmount",
"name",
"default",
@@ -11315,6 +11347,7 @@
"account",
"total",
"paidTotal",
"creditTotal",
"totalExclTax",
"subtotal",
"shipping",
@@ -11497,6 +11530,7 @@
"invite",
"resetPassword",
"workflowExecutions",
"shippingOptionTypes",
"productTypes",
"productTags",
"notifications",
@@ -1305,7 +1305,8 @@
"consistsOf": "Consists of {{num}}x inventory items",
"requires": "Requires {{num}} per variant",
"toast": {
"created": "Items successfully allocated"
"created": "Items successfully allocated",
"error": "Failed to allocate following items: {{items}}"
},
"error": {
"quantityNotAllocated": "There are unallocated items."