@open-mercato/core 0.6.7-develop.6649.1.e507f22d71 → 0.6.7-develop.6650.1.df84bf47a1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/sales/commands/documents.js +5 -4
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/lib/dictionaries.js +27 -2
- package/dist/modules/sales/lib/dictionaries.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/sales/commands/documents.ts +10 -4
- package/src/modules/sales/lib/dictionaries.ts +41 -2
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
restorePaymentSnapshot
|
|
94
94
|
} from "./payments.js";
|
|
95
95
|
import { loadShippedQuantityByLine } from "../lib/shipments/snapshots.js";
|
|
96
|
-
import { resolveDictionaryEntryValue } from "../lib/dictionaries.js";
|
|
96
|
+
import { resolveDictionaryEntryValue, resolveCachedDictionaryEntryValue } from "../lib/dictionaries.js";
|
|
97
97
|
import { resolveStatusEntryIdByValue } from "../lib/statusHelpers.js";
|
|
98
98
|
import { loadSalesSettings } from "./settings.js";
|
|
99
99
|
import { notificationTypes } from "../notifications.js";
|
|
@@ -3979,10 +3979,11 @@ const createOrderCommand = {
|
|
|
3979
3979
|
}
|
|
3980
3980
|
ensureOrderScope(ctx, parsed.organizationId, parsed.tenantId);
|
|
3981
3981
|
const em = ctx.container.resolve("em").fork();
|
|
3982
|
+
const dictionaryCache = ctx.container.resolve("cache", { allowUnregistered: true });
|
|
3982
3983
|
const [status, fulfillmentStatus, paymentStatus] = await Promise.all([
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3984
|
+
resolveCachedDictionaryEntryValue(em, parsed.statusEntryId ?? null, { tenantId: parsed.tenantId }, dictionaryCache),
|
|
3985
|
+
resolveCachedDictionaryEntryValue(em, parsed.fulfillmentStatusEntryId ?? null, { tenantId: parsed.tenantId }, dictionaryCache),
|
|
3986
|
+
resolveCachedDictionaryEntryValue(em, parsed.paymentStatusEntryId ?? null, { tenantId: parsed.tenantId }, dictionaryCache)
|
|
3986
3987
|
]);
|
|
3987
3988
|
const {
|
|
3988
3989
|
customerSnapshot: resolvedCustomerSnapshot,
|