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