@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
@@ -519,6 +519,9 @@
519
519
  "sales.documents.detail.addresses.line1Required": "Agrega la línea 1 de dirección para continuar.",
520
520
  "sales.documents.detail.addresses.loadError": "No se pudieron cargar las direcciones.",
521
521
  "sales.documents.detail.addresses.loading": "Cargando direcciones del documento…",
522
+ "sales.documents.detail.addresses.mode.label": "Origen de la dirección",
523
+ "sales.documents.detail.addresses.mode.new": "Nueva dirección",
524
+ "sales.documents.detail.addresses.mode.saved": "Dirección guardada",
522
525
  "sales.documents.detail.addresses.new": "Agregar nueva dirección",
523
526
  "sales.documents.detail.addresses.removed": "Dirección eliminada.",
524
527
  "sales.documents.detail.addresses.save": "Guardar dirección",
@@ -519,6 +519,9 @@
519
519
  "sales.documents.detail.addresses.line1Required": "계속하려면 주소 1을 입력하세요.",
520
520
  "sales.documents.detail.addresses.loadError": "주소를 불러오지 못했습니다.",
521
521
  "sales.documents.detail.addresses.loading": "문서 주소를 불러오는 중…",
522
+ "sales.documents.detail.addresses.mode.label": "주소 출처",
523
+ "sales.documents.detail.addresses.mode.new": "새 주소",
524
+ "sales.documents.detail.addresses.mode.saved": "저장된 주소",
522
525
  "sales.documents.detail.addresses.new": "새 주소 추가",
523
526
  "sales.documents.detail.addresses.removed": "주소 연결이 해제되었습니다.",
524
527
  "sales.documents.detail.addresses.save": "주소 저장",
@@ -4,7 +4,7 @@
4
4
  "audit_logs.resource_kind.sales.payment": "Płatność",
5
5
  "audit_logs.resource_kind.sales.shipment": "Wysyłka",
6
6
  "customers~sales.nav.group": "Sprzedaż",
7
- "notifications.categories.sales": "Sprzeda\u017c",
7
+ "notifications.categories.sales": "Sprzedaż",
8
8
  "sales.adjustments.error.returnExceedsRemainingGrandTotalGross": "Kwota brutto korekty zwrotu przekracza pozostałą wartość zamówienia. Zmniejsz kwotę lub usuń istniejące zwroty.",
9
9
  "sales.adjustments.error.returnExceedsRemainingGrandTotalNet": "Kwota netto korekty zwrotu przekracza pozostałą wartość zamówienia. Zmniejsz kwotę lub usuń istniejące zwroty.",
10
10
  "sales.audit.channels.create": "Utwórz kanał sprzedaży",
@@ -519,6 +519,9 @@
519
519
  "sales.documents.detail.addresses.line1Required": "Dodaj adres (linia 1), aby kontynuować.",
520
520
  "sales.documents.detail.addresses.loadError": "Nie udało się wczytać adresów.",
521
521
  "sales.documents.detail.addresses.loading": "Ładowanie adresów dokumentu…",
522
+ "sales.documents.detail.addresses.mode.label": "Źródło adresu",
523
+ "sales.documents.detail.addresses.mode.new": "Nowy adres",
524
+ "sales.documents.detail.addresses.mode.saved": "Zapisany adres",
522
525
  "sales.documents.detail.addresses.new": "Dodaj nowy adres",
523
526
  "sales.documents.detail.addresses.removed": "Adres usunięty z dokumentu.",
524
527
  "sales.documents.detail.addresses.save": "Zapisz adres",
@@ -68,6 +68,7 @@ type ExampleLine = {
68
68
  comment?: string
69
69
  productHandle?: string
70
70
  variantSku?: string
71
+ custom?: boolean
71
72
  }
72
73
 
73
74
  type ExampleAdjustment = {
@@ -182,6 +183,7 @@ const QUOTE_SEEDS: ExampleQuote[] = [
182
183
  lines: [
183
184
  {
184
185
  name: 'Remote onboarding package',
186
+ custom: true,
185
187
  description: 'Kick-off, workflow design, and training for distributed teams.',
186
188
  quantity: 1,
187
189
  unitPriceNet: 180,
@@ -189,6 +191,7 @@ const QUOTE_SEEDS: ExampleQuote[] = [
189
191
  },
190
192
  {
191
193
  name: 'Implementation workshop (4h)',
194
+ custom: true,
192
195
  description: 'Hands-on configuration session with stakeholders.',
193
196
  quantity: 1,
194
197
  unitPriceNet: 320,
@@ -312,7 +315,7 @@ const QUOTE_SEEDS: ExampleQuote[] = [
312
315
  quantity: 4,
313
316
  unitPriceNet: 95,
314
317
  taxRate: 0,
315
- variantSku: 'SERV-HAIR-60',
318
+ variantSku: 'SERV-HAIR-60-SENIOR',
316
319
  quantityUnit: 'hour',
317
320
  comment: 'Styling sessions during opening week.',
318
321
  },
@@ -354,6 +357,7 @@ const ORDER_SEEDS: ExampleOrder[] = [
354
357
  lines: [
355
358
  {
356
359
  name: 'Modular desk system',
360
+ custom: true,
357
361
  quantity: 1,
358
362
  unitPriceNet: 640,
359
363
  taxRate: 10,
@@ -361,6 +365,7 @@ const ORDER_SEEDS: ExampleOrder[] = [
361
365
  },
362
366
  {
363
367
  name: 'Acoustic panel set',
368
+ custom: true,
364
369
  quantity: 3,
365
370
  unitPriceNet: 85,
366
371
  taxRate: 10,
@@ -487,6 +492,7 @@ const ORDER_SEEDS: ExampleOrder[] = [
487
492
  lines: [
488
493
  {
489
494
  name: 'On-site enablement',
495
+ custom: true,
490
496
  quantity: 1,
491
497
  unitPriceNet: 280,
492
498
  taxRate: 0,
@@ -494,6 +500,7 @@ const ORDER_SEEDS: ExampleOrder[] = [
494
500
  },
495
501
  {
496
502
  name: 'Support retainer (Q3)',
503
+ custom: true,
497
504
  quantity: 1,
498
505
  unitPriceNet: 180,
499
506
  taxRate: 0,
@@ -680,7 +687,7 @@ const ORDER_SEEDS: ExampleOrder[] = [
680
687
  quantity: 6,
681
688
  unitPriceNet: 95,
682
689
  taxRate: 0,
683
- variantSku: 'SERV-HAIR-60',
690
+ variantSku: 'SERV-HAIR-60-SENIOR',
684
691
  quantityUnit: 'hour',
685
692
  comment: 'Block book stylists for staggered sessions.',
686
693
  },
@@ -842,6 +849,32 @@ function buildCatalogSnapshot(
842
849
  }
843
850
  }
844
851
 
852
+ const CUSTOM_LINE_METADATA = { customLine: true, lineMode: 'custom' } as const
853
+
854
+ export function isMissingCatalogMatch(
855
+ line: Pick<ExampleLine, 'kind' | 'custom'>,
856
+ catalogRef: { productId: string | null }
857
+ ): boolean {
858
+ if (line.custom) return false
859
+ if ((line.kind ?? 'product') !== 'product') return false
860
+ return !catalogRef.productId
861
+ }
862
+
863
+ export function listExampleCatalogReferences(): Array<{ document: string; line: string; variantSku?: string; productHandle?: string; custom: boolean }> {
864
+ const collect = (document: string, lines: ExampleLine[]) =>
865
+ lines.map((line) => ({
866
+ document,
867
+ line: line.name,
868
+ variantSku: line.variantSku,
869
+ productHandle: line.productHandle,
870
+ custom: line.custom === true,
871
+ }))
872
+ return [
873
+ ...QUOTE_SEEDS.flatMap((seed) => collect(seed.quoteNumber, seed.lines)),
874
+ ...ORDER_SEEDS.flatMap((seed) => collect(seed.orderNumber, seed.lines)),
875
+ ]
876
+ }
877
+
845
878
  function resolveCatalogLine(
846
879
  line: ExampleLine,
847
880
  catalog: CatalogLookup
@@ -1294,7 +1327,7 @@ export async function seedSalesExamples(
1294
1327
 
1295
1328
  const lineSnapshots = seed.lines.map((line) => {
1296
1329
  const catalogRef = resolveCatalogLine(line, catalogLookups)
1297
- if ((line.kind ?? 'product') === 'product' && !catalogRef.productId) {
1330
+ if (isMissingCatalogMatch(line, catalogRef)) {
1298
1331
  logger.warn('sales.examples missing catalog match for quote line', { line: line.name ?? line.variantSku ?? line.productHandle ?? 'unknown' })
1299
1332
  }
1300
1333
  const unitPriceNet = line.unitPriceNet ?? catalogRef.unitPriceNet ?? 0
@@ -1303,6 +1336,7 @@ export async function seedSalesExamples(
1303
1336
  const metadata: Record<string, unknown> = {}
1304
1337
  if (catalogRef.productThumbnail) metadata.productThumbnail = catalogRef.productThumbnail
1305
1338
  if (catalogRef.variantThumbnail) metadata.variantThumbnail = catalogRef.variantThumbnail
1339
+ if (line.custom) Object.assign(metadata, CUSTOM_LINE_METADATA)
1306
1340
  return {
1307
1341
  id: randomUUID(),
1308
1342
  kind: line.kind ?? 'product',
@@ -1423,7 +1457,7 @@ export async function seedSalesExamples(
1423
1457
  productId: source.productId ?? null,
1424
1458
  productVariantId: source.productVariantId ?? null,
1425
1459
  catalogSnapshot: source.catalogSnapshot ? toSnapshot(source.catalogSnapshot) : null,
1426
- metadata: null,
1460
+ metadata: source.metadata ? toSnapshot(source.metadata) : null,
1427
1461
  createdAt: new Date(),
1428
1462
  updatedAt: new Date(),
1429
1463
  })
@@ -1512,7 +1546,7 @@ export async function seedSalesExamples(
1512
1546
 
1513
1547
  const lineSnapshots = seed.lines.map((line) => {
1514
1548
  const catalogRef = resolveCatalogLine(line, catalogLookups)
1515
- if ((line.kind ?? 'product') === 'product' && !catalogRef.productId) {
1549
+ if (isMissingCatalogMatch(line, catalogRef)) {
1516
1550
  logger.warn('sales.examples missing catalog match for order line', { line: line.name ?? line.variantSku ?? line.productHandle ?? 'unknown' })
1517
1551
  }
1518
1552
  const unitPriceNet = line.unitPriceNet ?? catalogRef.unitPriceNet ?? 0
@@ -1521,6 +1555,7 @@ export async function seedSalesExamples(
1521
1555
  const metadata: Record<string, unknown> = {}
1522
1556
  if (catalogRef.productThumbnail) metadata.productThumbnail = catalogRef.productThumbnail
1523
1557
  if (catalogRef.variantThumbnail) metadata.variantThumbnail = catalogRef.variantThumbnail
1558
+ if (line.custom) Object.assign(metadata, CUSTOM_LINE_METADATA)
1524
1559
  return {
1525
1560
  id: randomUUID(),
1526
1561
  kind: line.kind ?? 'product',
@@ -1654,7 +1689,7 @@ export async function seedSalesExamples(
1654
1689
  productId: source.productId ?? null,
1655
1690
  productVariantId: source.productVariantId ?? null,
1656
1691
  catalogSnapshot: source.catalogSnapshot ? toSnapshot(source.catalogSnapshot) : null,
1657
- metadata: null,
1692
+ metadata: source.metadata ? toSnapshot(source.metadata) : null,
1658
1693
  createdAt: new Date(),
1659
1694
  updatedAt: new Date(),
1660
1695
  })