feat(core-flows,dashboard): add fixes to allow only outbound or inbound claims (#8590)
what: - allows completing claim with only inbound items - allows completing claim with only outbound items - validates against creating claims when an active change order is present
This commit is contained in:
@@ -252,13 +252,17 @@ export const confirmClaimRequestWorkflow = createWorkflow(
|
||||
}
|
||||
)
|
||||
|
||||
updateReturnsStep([
|
||||
{
|
||||
id: returnId,
|
||||
status: ReturnStatus.REQUESTED,
|
||||
requested_at: new Date(),
|
||||
},
|
||||
])
|
||||
when({ returnId }, ({ returnId }) => {
|
||||
return !!returnId
|
||||
}).then(() => {
|
||||
updateReturnsStep([
|
||||
{
|
||||
id: returnId,
|
||||
status: ReturnStatus.REQUESTED,
|
||||
requested_at: new Date(),
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
const claimId = transform({ createClaimItems }, ({ createClaimItems }) => {
|
||||
return createClaimItems?.[0]?.claim_id
|
||||
@@ -329,9 +333,12 @@ export const confirmClaimRequestWorkflow = createWorkflow(
|
||||
reserveInventoryStep(formatedInventoryItems)
|
||||
})
|
||||
|
||||
when({ returnShippingMethod }, ({ returnShippingMethod }) => {
|
||||
return !!returnShippingMethod
|
||||
}).then(() => {
|
||||
when(
|
||||
{ returnShippingMethod, returnId },
|
||||
({ returnShippingMethod, returnId }) => {
|
||||
return !!returnShippingMethod && !!returnId
|
||||
}
|
||||
).then(() => {
|
||||
const returnShippingOption = useRemoteQueryStep({
|
||||
entry_point: "shipping_options",
|
||||
fields: [
|
||||
|
||||
Reference in New Issue
Block a user