fix(order,utils): fix outstanding amount stuck on long orders (#8968)
This commit is contained in:
@@ -2,9 +2,9 @@ import {
|
|||||||
BaseFilterable,
|
BaseFilterable,
|
||||||
Context,
|
Context,
|
||||||
FilterQuery,
|
FilterQuery,
|
||||||
FilterQuery as InternalFilterQuery,
|
|
||||||
FindConfig,
|
FindConfig,
|
||||||
InferEntityType,
|
InferEntityType,
|
||||||
|
FilterQuery as InternalFilterQuery,
|
||||||
ModulesSdkTypes,
|
ModulesSdkTypes,
|
||||||
PerformedActions,
|
PerformedActions,
|
||||||
UpsertWithReplaceConfig,
|
UpsertWithReplaceConfig,
|
||||||
@@ -22,13 +22,13 @@ import {
|
|||||||
shouldForceTransaction,
|
shouldForceTransaction,
|
||||||
} from "../common"
|
} from "../common"
|
||||||
import { FreeTextSearchFilterKey } from "../dal"
|
import { FreeTextSearchFilterKey } from "../dal"
|
||||||
|
import { DmlEntity, toMikroORMEntity } from "../dml"
|
||||||
import { buildQuery } from "./build-query"
|
import { buildQuery } from "./build-query"
|
||||||
import {
|
import {
|
||||||
InjectManager,
|
InjectManager,
|
||||||
InjectTransactionManager,
|
InjectTransactionManager,
|
||||||
MedusaContext,
|
MedusaContext,
|
||||||
} from "./decorators"
|
} from "./decorators"
|
||||||
import { DmlEntity, toMikroORMEntity } from "../dml"
|
|
||||||
|
|
||||||
type SelectorAndData = {
|
type SelectorAndData = {
|
||||||
selector: FilterQuery<any> | BaseFilterable<FilterQuery<any>>
|
selector: FilterQuery<any> | BaseFilterable<FilterQuery<any>>
|
||||||
@@ -304,7 +304,7 @@ export function MedusaInternalService<
|
|||||||
if (keySelectorForDataOnly.$or.length) {
|
if (keySelectorForDataOnly.$or.length) {
|
||||||
const entitiesToUpdate = await this.list(
|
const entitiesToUpdate = await this.list(
|
||||||
keySelectorForDataOnly,
|
keySelectorForDataOnly,
|
||||||
{},
|
{ take: null },
|
||||||
sharedContext
|
sharedContext
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2672,6 +2672,7 @@ export default class OrderModuleService<
|
|||||||
: transactionData.order_id,
|
: transactionData.order_id,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
take: null,
|
||||||
select: ["id", "version"],
|
select: ["id", "version"],
|
||||||
},
|
},
|
||||||
sharedContext
|
sharedContext
|
||||||
@@ -2719,6 +2720,7 @@ export default class OrderModuleService<
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
select: ["order_id", "version", "amount"],
|
select: ["order_id", "version", "amount"],
|
||||||
|
take: null,
|
||||||
},
|
},
|
||||||
sharedContext
|
sharedContext
|
||||||
)
|
)
|
||||||
@@ -2744,6 +2746,7 @@ export default class OrderModuleService<
|
|||||||
id: transactionIds,
|
id: transactionIds,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
take: null,
|
||||||
select: ["order_id", "amount"],
|
select: ["order_id", "amount"],
|
||||||
},
|
},
|
||||||
sharedContext
|
sharedContext
|
||||||
@@ -2778,6 +2781,7 @@ export default class OrderModuleService<
|
|||||||
{
|
{
|
||||||
select: ["order_id", "amount"],
|
select: ["order_id", "amount"],
|
||||||
withDeleted: true,
|
withDeleted: true,
|
||||||
|
take: null,
|
||||||
},
|
},
|
||||||
sharedContext
|
sharedContext
|
||||||
)
|
)
|
||||||
@@ -2810,7 +2814,7 @@ export default class OrderModuleService<
|
|||||||
{
|
{
|
||||||
order_id: transactionData.map((trx) => trx.order_id),
|
order_id: transactionData.map((trx) => trx.order_id),
|
||||||
},
|
},
|
||||||
{},
|
{ take: null },
|
||||||
sharedContext
|
sharedContext
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user