@open-mercato/core 0.6.5-develop.5116.1.f0af9e5080 → 0.6.5-develop.5155.1.148d10a46d
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/.turbo/turbo-build.log +1 -1
- package/dist/modules/communication_channels/lib/email-mime.js +18 -1
- package/dist/modules/communication_channels/lib/email-mime.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +4 -1
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/data/validators.js +5 -1
- package/dist/modules/customers/data/validators.js.map +2 -2
- package/dist/modules/sales/commands/configuration.js +2 -2
- package/dist/modules/sales/commands/configuration.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +17 -13
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/commands/payments.js +6 -6
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/commands/shipments.js +6 -6
- package/dist/modules/sales/commands/shipments.js.map +2 -2
- package/dist/modules/sales/lib/dictionaries.js +2 -2
- package/dist/modules/sales/lib/dictionaries.js.map +2 -2
- package/dist/modules/staff/components/TeamMemberForm.js +5 -2
- package/dist/modules/staff/components/TeamMemberForm.js.map +2 -2
- package/package.json +14 -14
- package/src/modules/communication_channels/lib/email-mime.ts +33 -6
- package/src/modules/customers/components/formConfig.tsx +16 -1
- package/src/modules/customers/data/validators.ts +8 -1
- package/src/modules/sales/commands/configuration.ts +2 -2
- package/src/modules/sales/commands/documents.ts +13 -9
- package/src/modules/sales/commands/payments.ts +6 -6
- package/src/modules/sales/commands/shipments.ts +6 -6
- package/src/modules/sales/lib/dictionaries.ts +3 -2
- package/src/modules/staff/components/TeamMemberForm.tsx +6 -1
|
@@ -472,7 +472,8 @@ async function applyDocumentUpdate({
|
|
|
472
472
|
if (input.statusEntryId !== void 0) {
|
|
473
473
|
const statusValue = await resolveDictionaryEntryValue(
|
|
474
474
|
em,
|
|
475
|
-
input.statusEntryId
|
|
475
|
+
input.statusEntryId,
|
|
476
|
+
{ tenantId }
|
|
476
477
|
);
|
|
477
478
|
if (input.statusEntryId && !statusValue) {
|
|
478
479
|
throw new CrudHttpError(400, {
|
|
@@ -1941,7 +1942,7 @@ async function applyOrderLineResults(params) {
|
|
|
1941
1942
|
const resolveStatus = async (entryId) => {
|
|
1942
1943
|
if (!entryId) return null;
|
|
1943
1944
|
if (statusCache.has(entryId)) return statusCache.get(entryId) ?? null;
|
|
1944
|
-
const value = await resolveDictionaryEntryValue(em, entryId);
|
|
1945
|
+
const value = await resolveDictionaryEntryValue(em, entryId, { tenantId: order.tenantId });
|
|
1945
1946
|
statusCache.set(entryId, value);
|
|
1946
1947
|
return value;
|
|
1947
1948
|
};
|
|
@@ -2001,7 +2002,7 @@ async function applyQuoteLineResults(params) {
|
|
|
2001
2002
|
const resolveStatus = async (entryId) => {
|
|
2002
2003
|
if (!entryId) return null;
|
|
2003
2004
|
if (statusCache.has(entryId)) return statusCache.get(entryId) ?? null;
|
|
2004
|
-
const value = await resolveDictionaryEntryValue(em, entryId);
|
|
2005
|
+
const value = await resolveDictionaryEntryValue(em, entryId, { tenantId: quote.tenantId });
|
|
2005
2006
|
statusCache.set(entryId, value);
|
|
2006
2007
|
return value;
|
|
2007
2008
|
};
|
|
@@ -2055,7 +2056,7 @@ async function replaceQuoteLines(em, quote, calculation, lineInputs) {
|
|
|
2055
2056
|
const resolveStatus = async (entryId) => {
|
|
2056
2057
|
if (!entryId) return null;
|
|
2057
2058
|
if (statusCache.has(entryId)) return statusCache.get(entryId) ?? null;
|
|
2058
|
-
const value = await resolveDictionaryEntryValue(em, entryId);
|
|
2059
|
+
const value = await resolveDictionaryEntryValue(em, entryId, { tenantId: quote.tenantId });
|
|
2059
2060
|
statusCache.set(entryId, value);
|
|
2060
2061
|
return value;
|
|
2061
2062
|
};
|
|
@@ -2157,7 +2158,7 @@ async function replaceOrderLines(em, order, calculation, lineInputs) {
|
|
|
2157
2158
|
const resolveStatus = async (entryId) => {
|
|
2158
2159
|
if (!entryId) return null;
|
|
2159
2160
|
if (statusCache.has(entryId)) return statusCache.get(entryId) ?? null;
|
|
2160
|
-
const value = await resolveDictionaryEntryValue(em, entryId);
|
|
2161
|
+
const value = await resolveDictionaryEntryValue(em, entryId, { tenantId: order.tenantId });
|
|
2161
2162
|
statusCache.set(entryId, value);
|
|
2162
2163
|
return value;
|
|
2163
2164
|
};
|
|
@@ -3083,7 +3084,8 @@ const createQuoteCommand = {
|
|
|
3083
3084
|
} = await resolveDocumentReferences(em, parsed);
|
|
3084
3085
|
const quoteStatus = await resolveDictionaryEntryValue(
|
|
3085
3086
|
em,
|
|
3086
|
-
parsed.statusEntryId ?? null
|
|
3087
|
+
parsed.statusEntryId ?? null,
|
|
3088
|
+
{ tenantId: parsed.tenantId }
|
|
3087
3089
|
);
|
|
3088
3090
|
const quoteId = randomUUID();
|
|
3089
3091
|
const quote = em.create(SalesQuote, {
|
|
@@ -3931,9 +3933,9 @@ const createOrderCommand = {
|
|
|
3931
3933
|
ensureOrderScope(ctx, parsed.organizationId, parsed.tenantId);
|
|
3932
3934
|
const em = ctx.container.resolve("em").fork();
|
|
3933
3935
|
const [status, fulfillmentStatus, paymentStatus] = await Promise.all([
|
|
3934
|
-
resolveDictionaryEntryValue(em, parsed.statusEntryId ?? null),
|
|
3935
|
-
resolveDictionaryEntryValue(em, parsed.fulfillmentStatusEntryId ?? null),
|
|
3936
|
-
resolveDictionaryEntryValue(em, parsed.paymentStatusEntryId ?? null)
|
|
3936
|
+
resolveDictionaryEntryValue(em, parsed.statusEntryId ?? null, { tenantId: parsed.tenantId }),
|
|
3937
|
+
resolveDictionaryEntryValue(em, parsed.fulfillmentStatusEntryId ?? null, { tenantId: parsed.tenantId }),
|
|
3938
|
+
resolveDictionaryEntryValue(em, parsed.paymentStatusEntryId ?? null, { tenantId: parsed.tenantId })
|
|
3937
3939
|
]);
|
|
3938
3940
|
const {
|
|
3939
3941
|
customerSnapshot: resolvedCustomerSnapshot,
|
|
@@ -6459,7 +6461,8 @@ const createInvoiceCommand = {
|
|
|
6459
6461
|
const em = ctx.container.resolve("em").fork();
|
|
6460
6462
|
const status = await resolveDictionaryEntryValue(
|
|
6461
6463
|
em,
|
|
6462
|
-
parsed.statusEntryId ?? null
|
|
6464
|
+
parsed.statusEntryId ?? null,
|
|
6465
|
+
{ tenantId: parsed.tenantId }
|
|
6463
6466
|
);
|
|
6464
6467
|
if (parsed.orderId) {
|
|
6465
6468
|
const orderExists = await em.findOne(SalesOrder, {
|
|
@@ -6653,7 +6656,7 @@ const updateInvoiceCommand = {
|
|
|
6653
6656
|
"metadata"
|
|
6654
6657
|
]);
|
|
6655
6658
|
if (parsed.statusEntryId !== void 0) {
|
|
6656
|
-
invoice.status = await resolveDictionaryEntryValue(em, parsed.statusEntryId ?? null);
|
|
6659
|
+
invoice.status = await resolveDictionaryEntryValue(em, parsed.statusEntryId ?? null, { tenantId: invoice.tenantId });
|
|
6657
6660
|
}
|
|
6658
6661
|
Object.assign(invoice, changes);
|
|
6659
6662
|
invoice.updatedAt = /* @__PURE__ */ new Date();
|
|
@@ -6900,7 +6903,8 @@ const createCreditMemoCommand = {
|
|
|
6900
6903
|
const em = ctx.container.resolve("em").fork();
|
|
6901
6904
|
const status = await resolveDictionaryEntryValue(
|
|
6902
6905
|
em,
|
|
6903
|
-
parsed.statusEntryId ?? null
|
|
6906
|
+
parsed.statusEntryId ?? null,
|
|
6907
|
+
{ tenantId: parsed.tenantId }
|
|
6904
6908
|
);
|
|
6905
6909
|
if (parsed.orderId) {
|
|
6906
6910
|
const orderExists = await em.findOne(SalesOrder, {
|
|
@@ -7097,7 +7101,7 @@ const updateCreditMemoCommand = {
|
|
|
7097
7101
|
"metadata"
|
|
7098
7102
|
]);
|
|
7099
7103
|
if (parsed.statusEntryId !== void 0) {
|
|
7100
|
-
creditMemo.status = await resolveDictionaryEntryValue(em, parsed.statusEntryId ?? null);
|
|
7104
|
+
creditMemo.status = await resolveDictionaryEntryValue(em, parsed.statusEntryId ?? null, { tenantId: creditMemo.tenantId });
|
|
7101
7105
|
}
|
|
7102
7106
|
Object.assign(creditMemo, changes);
|
|
7103
7107
|
creditMemo.updatedAt = /* @__PURE__ */ new Date();
|