@open-mercato/core 0.6.7-develop.6580.1.39ab1d9e62 → 0.6.7-develop.6582.1.04cac61287

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 (29) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/modules/sales/commands/documents.js +8 -4
  3. package/dist/modules/sales/commands/documents.js.map +2 -2
  4. package/dist/modules/sales/workflows.js +4 -0
  5. package/dist/modules/sales/workflows.js.map +2 -2
  6. package/dist/modules/workflows/api/instances/route.js +3 -1
  7. package/dist/modules/workflows/api/instances/route.js.map +2 -2
  8. package/dist/modules/workflows/lib/activity-executor.js +30 -2
  9. package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
  10. package/dist/modules/workflows/lib/code-registry.js +10 -17
  11. package/dist/modules/workflows/lib/code-registry.js.map +2 -2
  12. package/dist/modules/workflows/lib/event-trigger-service.js +14 -2
  13. package/dist/modules/workflows/lib/event-trigger-service.js.map +2 -2
  14. package/dist/modules/workflows/lib/parallel-handler.js +10 -1
  15. package/dist/modules/workflows/lib/parallel-handler.js.map +2 -2
  16. package/dist/modules/workflows/lib/workflow-executor.js +13 -3
  17. package/dist/modules/workflows/lib/workflow-executor.js.map +2 -2
  18. package/dist/modules/workflows/lib/workflow-safe-commands.js +42 -0
  19. package/dist/modules/workflows/lib/workflow-safe-commands.js.map +7 -0
  20. package/package.json +7 -7
  21. package/src/modules/sales/commands/documents.ts +4 -0
  22. package/src/modules/sales/workflows.ts +5 -0
  23. package/src/modules/workflows/api/instances/route.ts +4 -2
  24. package/src/modules/workflows/lib/activity-executor.ts +47 -3
  25. package/src/modules/workflows/lib/code-registry.ts +16 -39
  26. package/src/modules/workflows/lib/event-trigger-service.ts +15 -2
  27. package/src/modules/workflows/lib/parallel-handler.ts +11 -1
  28. package/src/modules/workflows/lib/workflow-executor.ts +22 -3
  29. package/src/modules/workflows/lib/workflow-safe-commands.ts +48 -0
@@ -1,4 +1,4 @@
1
- [build:core] found 3493 entry points
1
+ [build:core] found 3494 entry points
2
2
  [build:core] built successfully
3
3
  [build:core:generated] found 188 entry points
4
4
  [build:core:generated] built successfully
@@ -111,7 +111,8 @@ const orderCrudEvents = {
111
111
  buildPayload: (ctx) => ({
112
112
  id: ctx.identifiers.id,
113
113
  organizationId: ctx.identifiers.organizationId,
114
- tenantId: ctx.identifiers.tenantId
114
+ tenantId: ctx.identifiers.tenantId,
115
+ userId: ctx.actorUserId ?? null
115
116
  })
116
117
  };
117
118
  const quoteCrudEvents = {
@@ -121,7 +122,8 @@ const quoteCrudEvents = {
121
122
  buildPayload: (ctx) => ({
122
123
  id: ctx.identifiers.id,
123
124
  organizationId: ctx.identifiers.organizationId,
124
- tenantId: ctx.identifiers.tenantId
125
+ tenantId: ctx.identifiers.tenantId,
126
+ userId: ctx.actorUserId ?? null
125
127
  })
126
128
  };
127
129
  const currencyCodeSchema = z.string().trim().toUpperCase().regex(/^[A-Z]{3}$/, { message: "currency_code_invalid" });
@@ -3340,7 +3342,8 @@ const createQuoteCommand = {
3340
3342
  tenantId: quote.tenantId
3341
3343
  },
3342
3344
  events: quoteCrudEvents,
3343
- indexer: { entityType: E.sales.sales_quote }
3345
+ indexer: { entityType: E.sales.sales_quote },
3346
+ actorUserId: ctx.auth?.sub ?? null
3344
3347
  });
3345
3348
  const resourceKind = deriveResourceFromCommandId(createQuoteCommand.id) ?? "sales.quote";
3346
3349
  await invalidateCrudCache(
@@ -4225,7 +4228,8 @@ const createOrderCommand = {
4225
4228
  tenantId: order.tenantId
4226
4229
  },
4227
4230
  events: orderCrudEvents,
4228
- indexer: { entityType: E.sales.sales_order }
4231
+ indexer: { entityType: E.sales.sales_order },
4232
+ actorUserId: ctx.auth?.sub ?? null
4229
4233
  });
4230
4234
  const resourceKind = deriveResourceFromCommandId(createOrderCommand.id) ?? "sales.order";
4231
4235
  await invalidateCrudCache(