added changes to swap and notification service

This commit is contained in:
--list
2021-06-10 13:05:00 +02:00
parent 65e24e3f0d
commit ea53b79831
10 changed files with 2335 additions and 2235 deletions
@@ -45,6 +45,9 @@ import { defaultFields, defaultRelations } from "./"
* quantity:
* description: The quantity of the Product Variant to ship.
* type: integer
* no_notification:
* description: If set to true no notification will be send.
* type: boolean
* tags:
* - Order
* responses:
@@ -65,7 +68,7 @@ export default async (req, res) => {
.items({
item_id: Validator.string().required(),
quantity: Validator.number().required(),
})
})
.required(),
return_shipping: Validator.object()
.keys({
@@ -79,6 +82,7 @@ export default async (req, res) => {
variant_id: Validator.string().required(),
quantity: Validator.number().required(),
}),
no_notification: Validator.boolean().optional()
})
const { value, error } = schema.validate(req.body)
@@ -134,6 +138,7 @@ export default async (req, res) => {
value.return_items,
value.additional_items,
value.return_shipping,
no_notification,
{ idempotency_key: idempotencyKey.idempotency_key }
)
@@ -31,6 +31,10 @@ import { MedusaError, Validator } from "medusa-core-utils"
* option_id:
* type: string
* description: The id of the Shipping Option to create the Shipping Method from.
* no_notification:
* description: If set to true no notification will be send
* type: boolean
*
* tags:
* - Return
* responses:
@@ -59,6 +63,7 @@ export default async (req, res) => {
option_id: Validator.string().optional(),
})
.optional(),
no_notification: Validator.boolean().optional()
})
const { value, error } = schema.validate(req.body)
@@ -132,6 +137,7 @@ export default async (req, res) => {
.emit("order.return_requested", {
id: value.order_id,
return_id: createdReturn.id,
no_notification: no_notification
})
return {