@open-mercato/core 0.10.1-develop.7994.1.c9f31972aa → 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.
Files changed (76) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/modules/audit_logs/components/AuditLogsActions.js +80 -50
  3. package/dist/modules/audit_logs/components/AuditLogsActions.js.map +3 -3
  4. package/dist/modules/audit_logs/lib/rowPresentation.js +82 -0
  5. package/dist/modules/audit_logs/lib/rowPresentation.js.map +7 -0
  6. package/dist/modules/catalog/commands/variants.js +89 -16
  7. package/dist/modules/catalog/commands/variants.js.map +2 -2
  8. package/dist/modules/catalog/seed/examples.js +7 -0
  9. package/dist/modules/catalog/seed/examples.js.map +2 -2
  10. package/dist/modules/customers/api/interactions/route.js +2 -2
  11. package/dist/modules/customers/api/interactions/route.js.map +2 -2
  12. package/dist/modules/customers/components/detail/AssignRoleDialog.js +10 -21
  13. package/dist/modules/customers/components/detail/AssignRoleDialog.js.map +2 -2
  14. package/dist/modules/customers/migrations/Migration20260825140000_customers.js +17 -10
  15. package/dist/modules/customers/migrations/Migration20260825140000_customers.js.map +2 -2
  16. package/dist/modules/entities/cli.js +138 -66
  17. package/dist/modules/entities/cli.js.map +3 -3
  18. package/dist/modules/integrations/lib/state-service.js +1 -1
  19. package/dist/modules/integrations/lib/state-service.js.map +2 -2
  20. package/dist/modules/promotions/commands/codes.js +18 -3
  21. package/dist/modules/promotions/commands/codes.js.map +2 -2
  22. package/dist/modules/query_index/cli.js +17 -1
  23. package/dist/modules/query_index/cli.js.map +2 -2
  24. package/dist/modules/query_index/lib/reindexer.js +23 -5
  25. package/dist/modules/query_index/lib/reindexer.js.map +2 -2
  26. package/dist/modules/resources/commands/resource-types.js +42 -15
  27. package/dist/modules/resources/commands/resource-types.js.map +2 -2
  28. package/dist/modules/resources/commands/resources.js +54 -3
  29. package/dist/modules/resources/commands/resources.js.map +2 -2
  30. package/dist/modules/resources/lib/resourceTypeLock.js +15 -0
  31. package/dist/modules/resources/lib/resourceTypeLock.js.map +7 -0
  32. package/dist/modules/sales/commands/configuration.js +30 -16
  33. package/dist/modules/sales/commands/configuration.js.map +2 -2
  34. package/dist/modules/sales/components/documents/AddressesSection.js +36 -15
  35. package/dist/modules/sales/components/documents/AddressesSection.js.map +2 -2
  36. package/dist/modules/sales/seed/examples.js +35 -6
  37. package/dist/modules/sales/seed/examples.js.map +2 -2
  38. package/package.json +7 -7
  39. package/src/modules/audit_logs/components/AuditLogsActions.tsx +85 -48
  40. package/src/modules/audit_logs/i18n/de.json +16 -0
  41. package/src/modules/audit_logs/i18n/en.json +16 -0
  42. package/src/modules/audit_logs/i18n/es.json +16 -0
  43. package/src/modules/audit_logs/i18n/ko.json +16 -0
  44. package/src/modules/audit_logs/i18n/pl.json +16 -0
  45. package/src/modules/audit_logs/lib/rowPresentation.ts +92 -0
  46. package/src/modules/catalog/commands/variants.ts +96 -17
  47. package/src/modules/catalog/seed/examples.ts +7 -0
  48. package/src/modules/customers/api/interactions/route.ts +2 -2
  49. package/src/modules/customers/components/detail/AssignRoleDialog.tsx +9 -12
  50. package/src/modules/customers/i18n/de.json +2 -1
  51. package/src/modules/customers/i18n/en.json +2 -1
  52. package/src/modules/customers/i18n/es.json +2 -1
  53. package/src/modules/customers/i18n/ko.json +2 -1
  54. package/src/modules/customers/i18n/pl.json +2 -1
  55. package/src/modules/customers/migrations/Migration20260825140000_customers.ts +21 -10
  56. package/src/modules/entities/cli.ts +144 -65
  57. package/src/modules/integrations/lib/state-service.ts +1 -1
  58. package/src/modules/promotions/commands/codes.ts +19 -4
  59. package/src/modules/query_index/cli.ts +17 -1
  60. package/src/modules/query_index/lib/reindexer.ts +55 -6
  61. package/src/modules/resources/commands/resource-types.ts +47 -15
  62. package/src/modules/resources/commands/resources.ts +74 -3
  63. package/src/modules/resources/i18n/de.json +3 -0
  64. package/src/modules/resources/i18n/en.json +3 -0
  65. package/src/modules/resources/i18n/es.json +3 -0
  66. package/src/modules/resources/i18n/ko.json +3 -0
  67. package/src/modules/resources/i18n/pl.json +3 -0
  68. package/src/modules/resources/lib/resourceTypeLock.ts +14 -0
  69. package/src/modules/sales/commands/configuration.ts +35 -16
  70. package/src/modules/sales/components/documents/AddressesSection.tsx +51 -20
  71. package/src/modules/sales/i18n/de.json +3 -0
  72. package/src/modules/sales/i18n/en.json +3 -0
  73. package/src/modules/sales/i18n/es.json +3 -0
  74. package/src/modules/sales/i18n/ko.json +3 -0
  75. package/src/modules/sales/i18n/pl.json +4 -1
  76. 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.kind ?? "product") === "product" && !catalogRef.productId) {
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.kind ?? "product") === "product" && !catalogRef.productId) {
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