@open-mercato/core 0.6.6-develop.6458.1.113a54fb91 → 0.6.6-develop.6465.1.019f0fb26f

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 (53) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/dist/helpers/integration/auth.js +148 -82
  3. package/dist/helpers/integration/auth.js.map +2 -2
  4. package/dist/modules/query_index/api/status.js +21 -1
  5. package/dist/modules/query_index/api/status.js.map +2 -2
  6. package/dist/modules/sales/api/document-addresses/route.js +96 -6
  7. package/dist/modules/sales/api/document-addresses/route.js.map +2 -2
  8. package/dist/modules/sales/commands/documentAddresses.js +7 -0
  9. package/dist/modules/sales/commands/documentAddresses.js.map +2 -2
  10. package/dist/modules/staff/commands/activities.js +23 -12
  11. package/dist/modules/staff/commands/activities.js.map +2 -2
  12. package/dist/modules/staff/commands/addresses.js +20 -12
  13. package/dist/modules/staff/commands/addresses.js.map +2 -2
  14. package/dist/modules/staff/commands/comments.js +18 -11
  15. package/dist/modules/staff/commands/comments.js.map +2 -2
  16. package/dist/modules/staff/commands/job-histories.js +23 -12
  17. package/dist/modules/staff/commands/job-histories.js.map +2 -2
  18. package/dist/modules/staff/commands/leave-requests.js +37 -19
  19. package/dist/modules/staff/commands/leave-requests.js.map +2 -2
  20. package/dist/modules/staff/commands/shared.js +28 -1
  21. package/dist/modules/staff/commands/shared.js.map +2 -2
  22. package/dist/modules/staff/commands/tag-assignments.js +20 -3
  23. package/dist/modules/staff/commands/tag-assignments.js.map +2 -2
  24. package/dist/modules/staff/commands/team-members.js +21 -11
  25. package/dist/modules/staff/commands/team-members.js.map +2 -2
  26. package/dist/modules/staff/commands/team-roles.js +21 -11
  27. package/dist/modules/staff/commands/team-roles.js.map +2 -2
  28. package/dist/modules/staff/commands/teams.js +21 -11
  29. package/dist/modules/staff/commands/teams.js.map +2 -2
  30. package/dist/modules/staff/commands/timesheets-entries.js +24 -14
  31. package/dist/modules/staff/commands/timesheets-entries.js.map +2 -2
  32. package/dist/modules/staff/commands/timesheets-projects.js +34 -18
  33. package/dist/modules/staff/commands/timesheets-projects.js.map +2 -2
  34. package/dist/modules/workflows/api/instances/route.js +1 -1
  35. package/dist/modules/workflows/api/instances/route.js.map +2 -2
  36. package/package.json +7 -7
  37. package/src/helpers/integration/auth.ts +178 -86
  38. package/src/modules/query_index/api/status.ts +32 -4
  39. package/src/modules/sales/api/document-addresses/route.ts +140 -7
  40. package/src/modules/sales/commands/documentAddresses.ts +8 -0
  41. package/src/modules/staff/commands/activities.ts +23 -11
  42. package/src/modules/staff/commands/addresses.ts +20 -11
  43. package/src/modules/staff/commands/comments.ts +18 -10
  44. package/src/modules/staff/commands/job-histories.ts +27 -11
  45. package/src/modules/staff/commands/leave-requests.ts +38 -19
  46. package/src/modules/staff/commands/shared.ts +38 -0
  47. package/src/modules/staff/commands/tag-assignments.ts +19 -2
  48. package/src/modules/staff/commands/team-members.ts +21 -10
  49. package/src/modules/staff/commands/team-roles.ts +21 -10
  50. package/src/modules/staff/commands/teams.ts +21 -10
  51. package/src/modules/staff/commands/timesheets-entries.ts +24 -13
  52. package/src/modules/staff/commands/timesheets-projects.ts +34 -17
  53. package/src/modules/workflows/api/instances/route.ts +2 -2
@@ -193,10 +193,10 @@ export async function POST(request: NextRequest) {
193
193
 
194
194
  const input: StartWorkflowApiInput = validation.data
195
195
 
196
- // Inject metadata.initiatedBy if not provided
196
+ // User-started instances must always record the authenticated caller.
197
197
  const metadata = {
198
198
  ...input.metadata,
199
- initiatedBy: input.metadata?.initiatedBy || auth.sub,
199
+ initiatedBy: auth.sub,
200
200
  }
201
201
 
202
202
  // Start workflow