@open-mercato/core 0.5.1-develop.2917.31ee9898e3 → 0.5.1-develop.2935.357c9db339

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 (59) hide show
  1. package/dist/modules/customers/api/companies/[id]/people/route.js +12 -7
  2. package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
  3. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +2 -1
  4. package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
  5. package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +7 -2
  6. package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
  7. package/dist/modules/customers/commands/companies.js +93 -19
  8. package/dist/modules/customers/commands/companies.js.map +2 -2
  9. package/dist/modules/customers/commands/people.js +9 -1
  10. package/dist/modules/customers/commands/people.js.map +2 -2
  11. package/dist/modules/customers/commands/personCompanyLinks.js +2 -2
  12. package/dist/modules/customers/commands/personCompanyLinks.js.map +2 -2
  13. package/dist/modules/customers/components/detail/CompanyCard.js +32 -3
  14. package/dist/modules/customers/components/detail/CompanyCard.js.map +2 -2
  15. package/dist/modules/customers/components/detail/CompanyDetailTabs.js +37 -19
  16. package/dist/modules/customers/components/detail/CompanyDetailTabs.js.map +2 -2
  17. package/dist/modules/customers/components/detail/CompanyPeopleSection.js +7 -4
  18. package/dist/modules/customers/components/detail/CompanyPeopleSection.js.map +2 -2
  19. package/dist/modules/customers/components/detail/PersonCompaniesSection.js +63 -2
  20. package/dist/modules/customers/components/detail/PersonCompaniesSection.js.map +2 -2
  21. package/dist/modules/customers/components/detail/PersonDetailTabs.js +37 -19
  22. package/dist/modules/customers/components/detail/PersonDetailTabs.js.map +2 -2
  23. package/dist/modules/customers/components/detail/TasksSection.js +1 -11
  24. package/dist/modules/customers/components/detail/TasksSection.js.map +2 -2
  25. package/dist/modules/customers/components/formConfig.js +50 -39
  26. package/dist/modules/customers/components/formConfig.js.map +2 -2
  27. package/dist/modules/customers/events.js +3 -3
  28. package/dist/modules/customers/events.js.map +2 -2
  29. package/dist/modules/customers/lib/displayName.js +13 -1
  30. package/dist/modules/customers/lib/displayName.js.map +2 -2
  31. package/dist/modules/customers/lib/personCompanies.js +12 -7
  32. package/dist/modules/customers/lib/personCompanies.js.map +2 -2
  33. package/dist/modules/customers/lib/personCompanyLinkTable.js +5 -0
  34. package/dist/modules/customers/lib/personCompanyLinkTable.js.map +2 -2
  35. package/dist/modules/integrations/data/validators.js +1 -1
  36. package/dist/modules/integrations/data/validators.js.map +2 -2
  37. package/package.json +3 -3
  38. package/src/modules/customers/api/companies/[id]/people/route.ts +12 -7
  39. package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +2 -1
  40. package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +12 -2
  41. package/src/modules/customers/commands/companies.ts +107 -19
  42. package/src/modules/customers/commands/people.ts +16 -1
  43. package/src/modules/customers/commands/personCompanyLinks.ts +3 -2
  44. package/src/modules/customers/components/detail/CompanyCard.tsx +28 -4
  45. package/src/modules/customers/components/detail/CompanyDetailTabs.tsx +18 -2
  46. package/src/modules/customers/components/detail/CompanyPeopleSection.tsx +8 -4
  47. package/src/modules/customers/components/detail/PersonCompaniesSection.tsx +66 -0
  48. package/src/modules/customers/components/detail/PersonDetailTabs.tsx +18 -2
  49. package/src/modules/customers/components/detail/TasksSection.tsx +1 -8
  50. package/src/modules/customers/components/formConfig.tsx +59 -40
  51. package/src/modules/customers/events.ts +3 -3
  52. package/src/modules/customers/i18n/de.json +10 -0
  53. package/src/modules/customers/i18n/en.json +10 -0
  54. package/src/modules/customers/i18n/es.json +10 -0
  55. package/src/modules/customers/i18n/pl.json +10 -0
  56. package/src/modules/customers/lib/displayName.ts +19 -0
  57. package/src/modules/customers/lib/personCompanies.ts +12 -7
  58. package/src/modules/customers/lib/personCompanyLinkTable.ts +14 -0
  59. package/src/modules/integrations/data/validators.ts +1 -1
@@ -6,7 +6,10 @@ import {
6
6
  CustomerPersonCompanyLink,
7
7
  CustomerPersonProfile,
8
8
  } from '../data/entities'
9
- import { withActiveCustomerPersonCompanyLinkFilter } from './personCompanyLinkTable'
9
+ import {
10
+ filterActivePersonCompanyLinks,
11
+ withActiveCustomerPersonCompanyLinkFilter,
12
+ } from './personCompanyLinkTable'
10
13
 
11
14
  export type PersonCompanySummary = {
12
15
  linkId: string | null
@@ -62,12 +65,14 @@ export async function loadPersonCompanyLinks(
62
65
  { person, organizationId: person.organizationId, tenantId: person.tenantId },
63
66
  'customers.personCompanies.loadPersonCompanyLinks',
64
67
  )
65
- return findWithDecryption(
66
- em,
67
- CustomerPersonCompanyLink,
68
- where,
69
- { populate: ['company'], orderBy: { isPrimary: 'desc', createdAt: 'asc' } },
70
- { tenantId: person.tenantId, organizationId: person.organizationId },
68
+ return filterActivePersonCompanyLinks(
69
+ await findWithDecryption(
70
+ em,
71
+ CustomerPersonCompanyLink,
72
+ where,
73
+ { populate: ['company'], orderBy: { isPrimary: 'desc', createdAt: 'asc' } },
74
+ { tenantId: person.tenantId, organizationId: person.organizationId },
75
+ ),
71
76
  )
72
77
  }
73
78
 
@@ -51,3 +51,17 @@ export async function withActiveCustomerPersonCompanyLinkFilter<T extends Record
51
51
  }
52
52
  return { ...where, deletedAt: null }
53
53
  }
54
+
55
+ /**
56
+ * Drop soft-deleted link rows from a result set as a defense-in-depth fallback.
57
+ * MikroORM has historically dropped `deletedAt: null` from the WHERE clause for
58
+ * nullable date columns under certain configurations, so callers SHOULD apply this
59
+ * after `findWithDecryption(...)` until the upstream query filter is verified to
60
+ * fully cover all callers.
61
+ */
62
+ export function filterActivePersonCompanyLinks<T extends { deletedAt?: Date | string | null | undefined }>(
63
+ links: T[] | null | undefined,
64
+ ): T[] {
65
+ if (!Array.isArray(links)) return []
66
+ return links.filter((entry) => entry?.deletedAt == null)
67
+ }
@@ -45,7 +45,7 @@ const optionalBooleanQuery = z.preprocess((value) => {
45
45
  if (value === true || value === 'true' || value === '1') return true
46
46
  if (value === false || value === 'false' || value === '0') return false
47
47
  return value
48
- }, z.boolean().optional())
48
+ }, z.boolean().optional()).optional()
49
49
 
50
50
  export const integrationMarketplaceHealthStatusSchema = z.enum(['healthy', 'degraded', 'unhealthy', 'unconfigured'])
51
51