@open-mercato/core 0.9.1-develop.7499.1.fcec456e4e → 0.9.1-develop.7515.1.e2712c8b00

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 (89) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/modules/audit_logs/components/AuditLogsActions.js +1 -1
  3. package/dist/modules/audit_logs/components/AuditLogsActions.js.map +2 -2
  4. package/dist/modules/auth/frontend/reset.js +7 -3
  5. package/dist/modules/auth/frontend/reset.js.map +2 -2
  6. package/dist/modules/business_rules/api/rules/route.js +12 -1
  7. package/dist/modules/business_rules/api/rules/route.js.map +2 -2
  8. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +17 -2
  9. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
  10. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js +3 -2
  11. package/dist/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.js.map +2 -2
  12. package/dist/modules/catalog/backend/catalog/products/create/page.js +1 -0
  13. package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
  14. package/dist/modules/catalog/components/products/productFormUtils.js +9 -0
  15. package/dist/modules/catalog/components/products/productFormUtils.js.map +2 -2
  16. package/dist/modules/customers/backend/customers/companies/page.js +32 -32
  17. package/dist/modules/customers/backend/customers/companies/page.js.map +2 -2
  18. package/dist/modules/customers/backend/customers/deals/page.js +22 -22
  19. package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
  20. package/dist/modules/customers/backend/customers/people/page.js +34 -34
  21. package/dist/modules/customers/backend/customers/people/page.js.map +2 -2
  22. package/dist/modules/ecommerce/search.js +1 -2
  23. package/dist/modules/ecommerce/search.js.map +2 -2
  24. package/dist/modules/shipping_carriers/api/webhook/[provider]/route.js +4 -7
  25. package/dist/modules/shipping_carriers/api/webhook/[provider]/route.js.map +2 -2
  26. package/dist/modules/shipping_carriers/lib/shipping-service.js +29 -11
  27. package/dist/modules/shipping_carriers/lib/shipping-service.js.map +2 -2
  28. package/dist/modules/shipping_carriers/lib/status-sync.js +2 -2
  29. package/dist/modules/shipping_carriers/lib/status-sync.js.map +2 -2
  30. package/dist/modules/shipping_carriers/workers/webhook-processor.js +60 -33
  31. package/dist/modules/shipping_carriers/workers/webhook-processor.js.map +3 -3
  32. package/dist/modules/staff/backend/staff/time-tracking/entries/page.js +10 -7
  33. package/dist/modules/staff/backend/staff/time-tracking/entries/page.js.map +2 -2
  34. package/dist/modules/warranty_claims/commands/claim-lines.js +89 -68
  35. package/dist/modules/warranty_claims/commands/claim-lines.js.map +2 -2
  36. package/dist/modules/warranty_claims/commands/claims.js +14 -13
  37. package/dist/modules/warranty_claims/commands/claims.js.map +2 -2
  38. package/dist/modules/warranty_claims/commands/shared.js +8 -2
  39. package/dist/modules/warranty_claims/commands/shared.js.map +2 -2
  40. package/dist/modules/wms/api/interceptors.js +3 -0
  41. package/dist/modules/wms/api/interceptors.js.map +2 -2
  42. package/dist/modules/wms/commands/configuration.js +16 -16
  43. package/dist/modules/wms/commands/configuration.js.map +2 -2
  44. package/dist/modules/wms/events.js +1 -0
  45. package/dist/modules/wms/events.js.map +2 -2
  46. package/dist/modules/wms/lib/catalogInventoryProfileIntent.js +9 -0
  47. package/dist/modules/wms/lib/catalogInventoryProfileIntent.js.map +2 -2
  48. package/dist/modules/wms/widgets/injection/catalog-inventory-profile/widget.js +11 -3
  49. package/dist/modules/wms/widgets/injection/catalog-inventory-profile/widget.js.map +2 -2
  50. package/package.json +7 -7
  51. package/src/modules/audit_logs/components/AuditLogsActions.tsx +1 -1
  52. package/src/modules/auth/frontend/reset.tsx +8 -3
  53. package/src/modules/business_rules/api/rules/route.ts +11 -0
  54. package/src/modules/business_rules/i18n/de.json +1 -0
  55. package/src/modules/business_rules/i18n/en.json +1 -0
  56. package/src/modules/business_rules/i18n/es.json +1 -0
  57. package/src/modules/business_rules/i18n/ko.json +1 -0
  58. package/src/modules/business_rules/i18n/pl.json +1 -0
  59. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +20 -1
  60. package/src/modules/catalog/backend/catalog/products/[productId]/variants/[variantId]/page.tsx +2 -1
  61. package/src/modules/catalog/backend/catalog/products/create/page.tsx +1 -0
  62. package/src/modules/catalog/components/products/productFormUtils.ts +9 -0
  63. package/src/modules/customers/backend/customers/companies/page.tsx +32 -32
  64. package/src/modules/customers/backend/customers/deals/page.tsx +22 -22
  65. package/src/modules/customers/backend/customers/people/page.tsx +34 -34
  66. package/src/modules/customers/i18n/de.json +12 -0
  67. package/src/modules/customers/i18n/en.json +12 -0
  68. package/src/modules/customers/i18n/es.json +12 -0
  69. package/src/modules/customers/i18n/ko.json +12 -0
  70. package/src/modules/customers/i18n/pl.json +12 -0
  71. package/src/modules/ecommerce/i18n/de.json +2 -1
  72. package/src/modules/ecommerce/i18n/en.json +2 -1
  73. package/src/modules/ecommerce/i18n/es.json +2 -1
  74. package/src/modules/ecommerce/i18n/ko.json +2 -1
  75. package/src/modules/ecommerce/i18n/pl.json +2 -1
  76. package/src/modules/ecommerce/search.ts +0 -1
  77. package/src/modules/shipping_carriers/api/webhook/[provider]/route.ts +4 -7
  78. package/src/modules/shipping_carriers/lib/shipping-service.ts +29 -11
  79. package/src/modules/shipping_carriers/lib/status-sync.ts +2 -2
  80. package/src/modules/shipping_carriers/workers/webhook-processor.ts +71 -39
  81. package/src/modules/staff/backend/staff/time-tracking/entries/page.tsx +20 -14
  82. package/src/modules/warranty_claims/commands/claim-lines.ts +107 -66
  83. package/src/modules/warranty_claims/commands/claims.ts +14 -13
  84. package/src/modules/warranty_claims/commands/shared.ts +7 -1
  85. package/src/modules/wms/api/interceptors.ts +9 -0
  86. package/src/modules/wms/commands/configuration.ts +28 -16
  87. package/src/modules/wms/events.ts +1 -0
  88. package/src/modules/wms/lib/catalogInventoryProfileIntent.ts +9 -0
  89. package/src/modules/wms/widgets/injection/catalog-inventory-profile/widget.ts +13 -4
@@ -43,7 +43,8 @@ import {
43
43
  ensureOrganizationScope,
44
44
  ensureTenantScope,
45
45
  extractUndoPayload,
46
- requireScopedClaim
46
+ requireScopedClaim,
47
+ throwUndoRefusal
47
48
  } from "./shared.js";
48
49
  const claimCrudEvents = {
49
50
  module: "warranty_claims",
@@ -404,7 +405,7 @@ function restoreLineDelta(line, before, after) {
404
405
  line.updatedAt = /* @__PURE__ */ new Date();
405
406
  }
406
407
  function throwClaimUndoConflict() {
407
- throw new CrudHttpError(409, { error: "warranty_claims.errors.conflict" });
408
+ return throwUndoRefusal("warranty_claims.errors.conflict", "This claim changed while you were editing it.");
408
409
  }
409
410
  async function requireCurrentUndoSnapshot(em, after) {
410
411
  const scope = { tenantId: after.tenantId, organizationId: after.organizationId };
@@ -416,7 +417,7 @@ async function requireCurrentUndoSnapshot(em, after) {
416
417
  scope
417
418
  );
418
419
  const expectedClaimUpdatedAt = toIso(after.updatedAt);
419
- if (!claim || !expectedClaimUpdatedAt || toIso(claim.updatedAt) !== expectedClaimUpdatedAt) throwClaimUndoConflict();
420
+ if (!claim || !expectedClaimUpdatedAt || toIso(claim.updatedAt) !== expectedClaimUpdatedAt) return throwClaimUndoConflict();
420
421
  const lines = await findWithDecryption(
421
422
  em,
422
423
  WarrantyClaimLine,
@@ -425,12 +426,12 @@ async function requireCurrentUndoSnapshot(em, after) {
425
426
  scope
426
427
  );
427
428
  const afterLines = Array.isArray(after.lines) ? after.lines : [];
428
- if (lines.length !== afterLines.length) throwClaimUndoConflict();
429
+ if (lines.length !== afterLines.length) return throwClaimUndoConflict();
429
430
  const afterLinesById = new Map(afterLines.map((line) => [line.id, line]));
430
431
  for (const line of lines) {
431
432
  const expected = afterLinesById.get(line.id);
432
433
  const expectedLineUpdatedAt = toIso(expected?.updatedAt);
433
- if (!expectedLineUpdatedAt || toIso(line.updatedAt) !== expectedLineUpdatedAt) throwClaimUndoConflict();
434
+ if (!expectedLineUpdatedAt || toIso(line.updatedAt) !== expectedLineUpdatedAt) return throwClaimUndoConflict();
434
435
  }
435
436
  return { claim, lines };
436
437
  }
@@ -448,7 +449,7 @@ async function restoreSnapshot(em, before, after) {
448
449
  for (const line of lines) {
449
450
  const beforeLine = beforeLinesById.get(line.id);
450
451
  const afterLine = afterLinesById.get(line.id);
451
- if (!beforeLine || !afterLine) throwClaimUndoConflict();
452
+ if (!beforeLine || !afterLine) return throwClaimUndoConflict();
452
453
  if (snapshotValueChanged(beforeLine, afterLine)) restoreLineDelta(line, beforeLine, afterLine);
453
454
  }
454
455
  return claim;
@@ -1121,7 +1122,7 @@ const updateClaimCommand = {
1121
1122
  const before = payload?.before;
1122
1123
  if (!before) return;
1123
1124
  const after = payload?.after;
1124
- if (!after) throwClaimUndoConflict();
1125
+ if (!after) return throwClaimUndoConflict();
1125
1126
  const em = ctx.container.resolve("em").fork();
1126
1127
  let claim;
1127
1128
  await withAtomicFlush(em, [
@@ -1184,7 +1185,7 @@ const deleteClaimCommand = {
1184
1185
  const before = payload?.before;
1185
1186
  if (!before) return;
1186
1187
  const after = payload?.after;
1187
- if (!after) throwClaimUndoConflict();
1188
+ if (!after) return throwClaimUndoConflict();
1188
1189
  const em = ctx.container.resolve("em").fork();
1189
1190
  let claim;
1190
1191
  await withAtomicFlush(em, [
@@ -1365,7 +1366,7 @@ const transitionClaimCommand = {
1365
1366
  const before = payload?.before;
1366
1367
  if (!before) return;
1367
1368
  const after = payload?.after;
1368
- if (!after) throwClaimUndoConflict();
1369
+ if (!after) return throwClaimUndoConflict();
1369
1370
  const em = ctx.container.resolve("em").fork();
1370
1371
  let claim;
1371
1372
  await withAtomicFlush(em, [
@@ -1464,7 +1465,7 @@ const setReturnLabelCommand = {
1464
1465
  const before = payload?.before;
1465
1466
  if (!before) return;
1466
1467
  const after = payload?.after;
1467
- if (!after) throwClaimUndoConflict();
1468
+ if (!after) return throwClaimUndoConflict();
1468
1469
  const em = ctx.container.resolve("em").fork();
1469
1470
  let claim;
1470
1471
  await withAtomicFlush(em, [
@@ -1901,7 +1902,7 @@ const createSalesReturnCommand = {
1901
1902
  const before = payload?.before;
1902
1903
  if (!before) return;
1903
1904
  const after = payload?.after;
1904
- if (!after) throwClaimUndoConflict();
1905
+ if (!after) return throwClaimUndoConflict();
1905
1906
  await assertUndoSnapshotCurrent(ctx, after);
1906
1907
  const scope = { tenantId: before.tenantId, organizationId: before.organizationId };
1907
1908
  const salesReturn = payload?.salesReturn ?? null;
@@ -2199,7 +2200,7 @@ const createCreditMemoCommand = {
2199
2200
  const before = payload?.before;
2200
2201
  if (!before) return;
2201
2202
  const after = payload?.after;
2202
- if (!after) throwClaimUndoConflict();
2203
+ if (!after) return throwClaimUndoConflict();
2203
2204
  await assertUndoSnapshotCurrent(ctx, after);
2204
2205
  const scope = { tenantId: before.tenantId, organizationId: before.organizationId };
2205
2206
  const creditMemo = payload?.creditMemo ?? null;
@@ -2489,7 +2490,7 @@ const createReplacementOrderCommand = {
2489
2490
  const before = payload?.before;
2490
2491
  if (!before) return;
2491
2492
  const after = payload?.after;
2492
- if (!after) throwClaimUndoConflict();
2493
+ if (!after) return throwClaimUndoConflict();
2493
2494
  await assertUndoSnapshotCurrent(ctx, after);
2494
2495
  const scope = { tenantId: before.tenantId, organizationId: before.organizationId };
2495
2496
  const replacementOrder = payload?.replacementOrder ?? null;