Feat(admin, medusa): add locations to claim and swap creation (#3522)
**What** - Add location selection to claim and swap creation Fixes CORE-1269
This commit is contained in:
@@ -437,6 +437,10 @@ export class AdminPostOrdersOrderClaimsReq {
|
||||
@IsOptional()
|
||||
no_notification?: boolean
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
return_location_id?: string
|
||||
|
||||
@IsObject()
|
||||
@IsOptional()
|
||||
metadata?: Record<string, unknown>
|
||||
|
||||
@@ -164,6 +164,7 @@ export default async (req, res) => {
|
||||
idempotency_key: idempotencyKey.idempotency_key,
|
||||
no_notification: validated.no_notification,
|
||||
allow_backorder: validated.allow_backorder,
|
||||
location_id: validated.return_location_id,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -361,6 +362,10 @@ export class AdminPostOrdersOrderSwapsReq {
|
||||
@IsOptional()
|
||||
no_notification?: boolean
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
return_location_id?: string
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
allow_backorder?: boolean = true
|
||||
|
||||
@@ -346,6 +346,7 @@ export default class ClaimService extends TransactionBaseService {
|
||||
shipping_address,
|
||||
shipping_address_id,
|
||||
no_notification,
|
||||
return_location_id,
|
||||
...rest
|
||||
} = data
|
||||
|
||||
@@ -485,6 +486,7 @@ export default class ClaimService extends TransactionBaseService {
|
||||
),
|
||||
shipping_method: return_shipping,
|
||||
no_notification: evaluatedNoNotification,
|
||||
location_id: return_location_id,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -309,6 +309,7 @@ class SwapService extends TransactionBaseService {
|
||||
no_notification?: boolean
|
||||
idempotency_key?: string
|
||||
allow_backorder?: boolean
|
||||
location_id?: string
|
||||
} = { no_notification: undefined }
|
||||
): Promise<Swap | never> {
|
||||
const { no_notification, ...rest } = custom
|
||||
@@ -379,6 +380,7 @@ class SwapService extends TransactionBaseService {
|
||||
items: returnItems as OrdersReturnItem[],
|
||||
shipping_method: returnShipping,
|
||||
no_notification: evaluatedNoNotification,
|
||||
location_id: custom.location_id,
|
||||
})
|
||||
|
||||
await this.eventBus_
|
||||
|
||||
@@ -18,6 +18,7 @@ export type CreateClaimInput = {
|
||||
order: Order
|
||||
claim_order_id?: string
|
||||
shipping_address_id?: string
|
||||
return_location_id?: string
|
||||
}
|
||||
|
||||
type CreateClaimReturnShippingInput = {
|
||||
|
||||
Reference in New Issue
Block a user