Browse Source

fix(core): Added deprecation notices to the old refund input fields (#3119)

+ Added documentation to the new refund amount value
Philipp Sonntag 1 year ago
parent
commit
7324bb3a18
1 changed files with 10 additions and 12 deletions
  1. 10 12
      packages/core/src/api/schema/admin-api/order.api.graphql

+ 10 - 12
packages/core/src/api/schema/admin-api/order.api.graphql

@@ -111,14 +111,12 @@ input CancelOrderInput {
 }
 
 input RefundOrderInput {
-    lines: [OrderLineInput!]!
-    shipping: Money!
-    adjustment: Money!
+    lines: [OrderLineInput!] @deprecated(reason: "Use the `amount` field instead")
+    shipping: Money @deprecated(reason: "Use the `amount` field instead")
+    adjustment: Money @deprecated(reason: "Use the `amount` field instead")
     """
-    If an amount is specified, this value will be used to create a Refund rather than calculating the
-    amount automatically. This was added in v2.2 and will be the preferred way to specify the refund
-    amount in the future. The `lines`, `shipping` and `adjustment` fields will likely be removed in a future
-    version.
+    The amount to be refunded to this particular payment. This was introduced in v2.2.0 as the preferred way to specify the refund amount.
+    Can be as much as the total amount of the payment minus the sum of all previous refunds.
     """
     amount: Money
     paymentId: ID!
@@ -410,13 +408,13 @@ type ManualPaymentStateError implements ErrorResult {
 
 union TransitionOrderToStateResult = Order | OrderStateTransitionError
 union SettlePaymentResult =
-      Payment
+    | Payment
     | SettlePaymentError
     | PaymentStateTransitionError
     | OrderStateTransitionError
 union CancelPaymentResult = Payment | CancelPaymentError | PaymentStateTransitionError
 union AddFulfillmentToOrderResult =
-      Fulfillment
+    | Fulfillment
     | EmptyOrderLineSelectionError
     | ItemsAlreadyFulfilledError
     | InsufficientStockOnHandError
@@ -424,14 +422,14 @@ union AddFulfillmentToOrderResult =
     | FulfillmentStateTransitionError
     | CreateFulfillmentError
 union CancelOrderResult =
-      Order
+    | Order
     | EmptyOrderLineSelectionError
     | QuantityTooGreatError
     | MultipleOrderError
     | CancelActiveOrderError
     | OrderStateTransitionError
 union RefundOrderResult =
-      Refund
+    | Refund
     | QuantityTooGreatError
     | NothingToRefundError
     | OrderStateTransitionError
@@ -445,7 +443,7 @@ union SettleRefundResult = Refund | RefundStateTransitionError
 union TransitionFulfillmentToStateResult = Fulfillment | FulfillmentStateTransitionError
 union TransitionPaymentToStateResult = Payment | PaymentStateTransitionError
 union ModifyOrderResult =
-      Order
+    | Order
     | NoChangesSpecifiedError
     | OrderModificationStateError
     | PaymentMethodMissingError