@open-mercato/core 0.10.1-develop.8004.1.a8a79ee43f → 0.10.1-develop.8022.1.b6753de892
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/audit_logs/components/AuditLogsActions.js +80 -50
- package/dist/modules/audit_logs/components/AuditLogsActions.js.map +3 -3
- package/dist/modules/audit_logs/lib/rowPresentation.js +82 -0
- package/dist/modules/audit_logs/lib/rowPresentation.js.map +7 -0
- package/dist/modules/catalog/commands/variants.js +89 -16
- package/dist/modules/catalog/commands/variants.js.map +2 -2
- package/dist/modules/catalog/seed/examples.js +7 -0
- package/dist/modules/catalog/seed/examples.js.map +2 -2
- package/dist/modules/customers/api/interactions/route.js +2 -2
- package/dist/modules/customers/api/interactions/route.js.map +2 -2
- package/dist/modules/customers/components/detail/AssignRoleDialog.js +10 -21
- package/dist/modules/customers/components/detail/AssignRoleDialog.js.map +2 -2
- package/dist/modules/customers/migrations/Migration20260825140000_customers.js +17 -10
- package/dist/modules/customers/migrations/Migration20260825140000_customers.js.map +2 -2
- package/dist/modules/entities/cli.js +138 -66
- package/dist/modules/entities/cli.js.map +3 -3
- package/dist/modules/promotions/commands/codes.js +18 -3
- package/dist/modules/promotions/commands/codes.js.map +2 -2
- package/dist/modules/query_index/cli.js +17 -1
- package/dist/modules/query_index/cli.js.map +2 -2
- package/dist/modules/query_index/lib/reindexer.js +23 -5
- package/dist/modules/query_index/lib/reindexer.js.map +2 -2
- package/dist/modules/sales/commands/configuration.js +30 -16
- package/dist/modules/sales/commands/configuration.js.map +2 -2
- package/dist/modules/sales/components/documents/AddressesSection.js +36 -15
- package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
- package/dist/modules/sales/seed/examples.js +35 -6
- package/dist/modules/sales/seed/examples.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/audit_logs/components/AuditLogsActions.tsx +85 -48
- package/src/modules/audit_logs/i18n/de.json +16 -0
- package/src/modules/audit_logs/i18n/en.json +16 -0
- package/src/modules/audit_logs/i18n/es.json +16 -0
- package/src/modules/audit_logs/i18n/ko.json +16 -0
- package/src/modules/audit_logs/i18n/pl.json +16 -0
- package/src/modules/audit_logs/lib/rowPresentation.ts +92 -0
- package/src/modules/catalog/commands/variants.ts +96 -17
- package/src/modules/catalog/seed/examples.ts +7 -0
- package/src/modules/customers/api/interactions/route.ts +2 -2
- package/src/modules/customers/components/detail/AssignRoleDialog.tsx +9 -12
- package/src/modules/customers/i18n/de.json +2 -1
- package/src/modules/customers/i18n/en.json +2 -1
- package/src/modules/customers/i18n/es.json +2 -1
- package/src/modules/customers/i18n/ko.json +2 -1
- package/src/modules/customers/i18n/pl.json +2 -1
- package/src/modules/customers/migrations/Migration20260825140000_customers.ts +21 -10
- package/src/modules/entities/cli.ts +144 -65
- package/src/modules/promotions/commands/codes.ts +19 -4
- package/src/modules/query_index/cli.ts +17 -1
- package/src/modules/query_index/lib/reindexer.ts +55 -6
- package/src/modules/sales/commands/configuration.ts +35 -16
- package/src/modules/sales/components/documents/AddressesSection.tsx +51 -20
- package/src/modules/sales/i18n/de.json +3 -0
- package/src/modules/sales/i18n/en.json +3 -0
- package/src/modules/sales/i18n/es.json +3 -0
- package/src/modules/sales/i18n/ko.json +3 -0
- package/src/modules/sales/i18n/pl.json +4 -1
- package/src/modules/sales/seed/examples.ts +41 -6
|
@@ -58,6 +58,7 @@ const QUOTE_SEEDS = [
|
|
|
58
58
|
lines: [
|
|
59
59
|
{
|
|
60
60
|
name: "Remote onboarding package",
|
|
61
|
+
custom: true,
|
|
61
62
|
description: "Kick-off, workflow design, and training for distributed teams.",
|
|
62
63
|
quantity: 1,
|
|
63
64
|
unitPriceNet: 180,
|
|
@@ -65,6 +66,7 @@ const QUOTE_SEEDS = [
|
|
|
65
66
|
},
|
|
66
67
|
{
|
|
67
68
|
name: "Implementation workshop (4h)",
|
|
69
|
+
custom: true,
|
|
68
70
|
description: "Hands-on configuration session with stakeholders.",
|
|
69
71
|
quantity: 1,
|
|
70
72
|
unitPriceNet: 320,
|
|
@@ -188,7 +190,7 @@ const QUOTE_SEEDS = [
|
|
|
188
190
|
quantity: 4,
|
|
189
191
|
unitPriceNet: 95,
|
|
190
192
|
taxRate: 0,
|
|
191
|
-
variantSku: "SERV-HAIR-60",
|
|
193
|
+
variantSku: "SERV-HAIR-60-SENIOR",
|
|
192
194
|
quantityUnit: "hour",
|
|
193
195
|
comment: "Styling sessions during opening week."
|
|
194
196
|
}
|
|
@@ -229,6 +231,7 @@ const ORDER_SEEDS = [
|
|
|
229
231
|
lines: [
|
|
230
232
|
{
|
|
231
233
|
name: "Modular desk system",
|
|
234
|
+
custom: true,
|
|
232
235
|
quantity: 1,
|
|
233
236
|
unitPriceNet: 640,
|
|
234
237
|
taxRate: 10,
|
|
@@ -236,6 +239,7 @@ const ORDER_SEEDS = [
|
|
|
236
239
|
},
|
|
237
240
|
{
|
|
238
241
|
name: "Acoustic panel set",
|
|
242
|
+
custom: true,
|
|
239
243
|
quantity: 3,
|
|
240
244
|
unitPriceNet: 85,
|
|
241
245
|
taxRate: 10,
|
|
@@ -362,6 +366,7 @@ const ORDER_SEEDS = [
|
|
|
362
366
|
lines: [
|
|
363
367
|
{
|
|
364
368
|
name: "On-site enablement",
|
|
369
|
+
custom: true,
|
|
365
370
|
quantity: 1,
|
|
366
371
|
unitPriceNet: 280,
|
|
367
372
|
taxRate: 0,
|
|
@@ -369,6 +374,7 @@ const ORDER_SEEDS = [
|
|
|
369
374
|
},
|
|
370
375
|
{
|
|
371
376
|
name: "Support retainer (Q3)",
|
|
377
|
+
custom: true,
|
|
372
378
|
quantity: 1,
|
|
373
379
|
unitPriceNet: 180,
|
|
374
380
|
taxRate: 0,
|
|
@@ -555,7 +561,7 @@ const ORDER_SEEDS = [
|
|
|
555
561
|
quantity: 6,
|
|
556
562
|
unitPriceNet: 95,
|
|
557
563
|
taxRate: 0,
|
|
558
|
-
variantSku: "SERV-HAIR-60",
|
|
564
|
+
variantSku: "SERV-HAIR-60-SENIOR",
|
|
559
565
|
quantityUnit: "hour",
|
|
560
566
|
comment: "Block book stylists for staggered sessions."
|
|
561
567
|
}
|
|
@@ -681,6 +687,25 @@ function buildCatalogSnapshot(product, variant, price) {
|
|
|
681
687
|
} : null
|
|
682
688
|
};
|
|
683
689
|
}
|
|
690
|
+
const CUSTOM_LINE_METADATA = { customLine: true, lineMode: "custom" };
|
|
691
|
+
function isMissingCatalogMatch(line, catalogRef) {
|
|
692
|
+
if (line.custom) return false;
|
|
693
|
+
if ((line.kind ?? "product") !== "product") return false;
|
|
694
|
+
return !catalogRef.productId;
|
|
695
|
+
}
|
|
696
|
+
function listExampleCatalogReferences() {
|
|
697
|
+
const collect = (document, lines) => lines.map((line) => ({
|
|
698
|
+
document,
|
|
699
|
+
line: line.name,
|
|
700
|
+
variantSku: line.variantSku,
|
|
701
|
+
productHandle: line.productHandle,
|
|
702
|
+
custom: line.custom === true
|
|
703
|
+
}));
|
|
704
|
+
return [
|
|
705
|
+
...QUOTE_SEEDS.flatMap((seed) => collect(seed.quoteNumber, seed.lines)),
|
|
706
|
+
...ORDER_SEEDS.flatMap((seed) => collect(seed.orderNumber, seed.lines))
|
|
707
|
+
];
|
|
708
|
+
}
|
|
684
709
|
function resolveCatalogLine(line, catalog) {
|
|
685
710
|
const variant = line.variantSku && catalog.variantsBySku.size ? catalog.variantsBySku.get(normalizeKey(line.variantSku)) : null;
|
|
686
711
|
const product = variant?.product ?? (line.productHandle ? catalog.productsByHandle.get(normalizeKey(line.productHandle)) ?? null : null);
|
|
@@ -1010,7 +1035,7 @@ async function seedSalesExamples(em, container, scope) {
|
|
|
1010
1035
|
const channel = seed.channelCode ? channels.get(seed.channelCode.toLowerCase()) ?? null : null;
|
|
1011
1036
|
const lineSnapshots = seed.lines.map((line) => {
|
|
1012
1037
|
const catalogRef = resolveCatalogLine(line, catalogLookups);
|
|
1013
|
-
if ((line
|
|
1038
|
+
if (isMissingCatalogMatch(line, catalogRef)) {
|
|
1014
1039
|
logger.warn("sales.examples missing catalog match for quote line", { line: line.name ?? line.variantSku ?? line.productHandle ?? "unknown" });
|
|
1015
1040
|
}
|
|
1016
1041
|
const unitPriceNet = line.unitPriceNet ?? catalogRef.unitPriceNet ?? 0;
|
|
@@ -1019,6 +1044,7 @@ async function seedSalesExamples(em, container, scope) {
|
|
|
1019
1044
|
const metadata = {};
|
|
1020
1045
|
if (catalogRef.productThumbnail) metadata.productThumbnail = catalogRef.productThumbnail;
|
|
1021
1046
|
if (catalogRef.variantThumbnail) metadata.variantThumbnail = catalogRef.variantThumbnail;
|
|
1047
|
+
if (line.custom) Object.assign(metadata, CUSTOM_LINE_METADATA);
|
|
1022
1048
|
return {
|
|
1023
1049
|
id: randomUUID(),
|
|
1024
1050
|
kind: line.kind ?? "product",
|
|
@@ -1128,7 +1154,7 @@ async function seedSalesExamples(em, container, scope) {
|
|
|
1128
1154
|
productId: source.productId ?? null,
|
|
1129
1155
|
productVariantId: source.productVariantId ?? null,
|
|
1130
1156
|
catalogSnapshot: source.catalogSnapshot ? toSnapshot(source.catalogSnapshot) : null,
|
|
1131
|
-
metadata: null,
|
|
1157
|
+
metadata: source.metadata ? toSnapshot(source.metadata) : null,
|
|
1132
1158
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1133
1159
|
updatedAt: /* @__PURE__ */ new Date()
|
|
1134
1160
|
});
|
|
@@ -1205,7 +1231,7 @@ async function seedSalesExamples(em, container, scope) {
|
|
|
1205
1231
|
const channel = seed.channelCode ? channels.get(seed.channelCode.toLowerCase()) ?? null : null;
|
|
1206
1232
|
const lineSnapshots = seed.lines.map((line) => {
|
|
1207
1233
|
const catalogRef = resolveCatalogLine(line, catalogLookups);
|
|
1208
|
-
if ((line
|
|
1234
|
+
if (isMissingCatalogMatch(line, catalogRef)) {
|
|
1209
1235
|
logger.warn("sales.examples missing catalog match for order line", { line: line.name ?? line.variantSku ?? line.productHandle ?? "unknown" });
|
|
1210
1236
|
}
|
|
1211
1237
|
const unitPriceNet = line.unitPriceNet ?? catalogRef.unitPriceNet ?? 0;
|
|
@@ -1214,6 +1240,7 @@ async function seedSalesExamples(em, container, scope) {
|
|
|
1214
1240
|
const metadata = {};
|
|
1215
1241
|
if (catalogRef.productThumbnail) metadata.productThumbnail = catalogRef.productThumbnail;
|
|
1216
1242
|
if (catalogRef.variantThumbnail) metadata.variantThumbnail = catalogRef.variantThumbnail;
|
|
1243
|
+
if (line.custom) Object.assign(metadata, CUSTOM_LINE_METADATA);
|
|
1217
1244
|
return {
|
|
1218
1245
|
id: randomUUID(),
|
|
1219
1246
|
kind: line.kind ?? "product",
|
|
@@ -1336,7 +1363,7 @@ async function seedSalesExamples(em, container, scope) {
|
|
|
1336
1363
|
productId: source.productId ?? null,
|
|
1337
1364
|
productVariantId: source.productVariantId ?? null,
|
|
1338
1365
|
catalogSnapshot: source.catalogSnapshot ? toSnapshot(source.catalogSnapshot) : null,
|
|
1339
|
-
metadata: null,
|
|
1366
|
+
metadata: source.metadata ? toSnapshot(source.metadata) : null,
|
|
1340
1367
|
createdAt: /* @__PURE__ */ new Date(),
|
|
1341
1368
|
updatedAt: /* @__PURE__ */ new Date()
|
|
1342
1369
|
});
|
|
@@ -1506,6 +1533,8 @@ async function seedSalesExamples(em, container, scope) {
|
|
|
1506
1533
|
return true;
|
|
1507
1534
|
}
|
|
1508
1535
|
export {
|
|
1536
|
+
isMissingCatalogMatch,
|
|
1537
|
+
listExampleCatalogReferences,
|
|
1509
1538
|
seedSalesExamples
|
|
1510
1539
|
};
|
|
1511
1540
|
//# sourceMappingURL=examples.js.map
|