@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.
- package/dist/modules/customers/api/companies/[id]/people/route.js +12 -7
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js +2 -1
- package/dist/modules/customers/backend/customers/companies-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js +7 -2
- package/dist/modules/customers/backend/customers/people-v2/[id]/page.js.map +2 -2
- package/dist/modules/customers/commands/companies.js +93 -19
- package/dist/modules/customers/commands/companies.js.map +2 -2
- package/dist/modules/customers/commands/people.js +9 -1
- package/dist/modules/customers/commands/people.js.map +2 -2
- package/dist/modules/customers/commands/personCompanyLinks.js +2 -2
- package/dist/modules/customers/commands/personCompanyLinks.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyCard.js +32 -3
- package/dist/modules/customers/components/detail/CompanyCard.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyDetailTabs.js +37 -19
- package/dist/modules/customers/components/detail/CompanyDetailTabs.js.map +2 -2
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js +7 -4
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js.map +2 -2
- package/dist/modules/customers/components/detail/PersonCompaniesSection.js +63 -2
- package/dist/modules/customers/components/detail/PersonCompaniesSection.js.map +2 -2
- package/dist/modules/customers/components/detail/PersonDetailTabs.js +37 -19
- package/dist/modules/customers/components/detail/PersonDetailTabs.js.map +2 -2
- package/dist/modules/customers/components/detail/TasksSection.js +1 -11
- package/dist/modules/customers/components/detail/TasksSection.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +50 -39
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/events.js +3 -3
- package/dist/modules/customers/events.js.map +2 -2
- package/dist/modules/customers/lib/displayName.js +13 -1
- package/dist/modules/customers/lib/displayName.js.map +2 -2
- package/dist/modules/customers/lib/personCompanies.js +12 -7
- package/dist/modules/customers/lib/personCompanies.js.map +2 -2
- package/dist/modules/customers/lib/personCompanyLinkTable.js +5 -0
- package/dist/modules/customers/lib/personCompanyLinkTable.js.map +2 -2
- package/dist/modules/integrations/data/validators.js +1 -1
- package/dist/modules/integrations/data/validators.js.map +2 -2
- package/package.json +3 -3
- package/src/modules/customers/api/companies/[id]/people/route.ts +12 -7
- package/src/modules/customers/backend/customers/companies-v2/[id]/page.tsx +2 -1
- package/src/modules/customers/backend/customers/people-v2/[id]/page.tsx +12 -2
- package/src/modules/customers/commands/companies.ts +107 -19
- package/src/modules/customers/commands/people.ts +16 -1
- package/src/modules/customers/commands/personCompanyLinks.ts +3 -2
- package/src/modules/customers/components/detail/CompanyCard.tsx +28 -4
- package/src/modules/customers/components/detail/CompanyDetailTabs.tsx +18 -2
- package/src/modules/customers/components/detail/CompanyPeopleSection.tsx +8 -4
- package/src/modules/customers/components/detail/PersonCompaniesSection.tsx +66 -0
- package/src/modules/customers/components/detail/PersonDetailTabs.tsx +18 -2
- package/src/modules/customers/components/detail/TasksSection.tsx +1 -8
- package/src/modules/customers/components/formConfig.tsx +59 -40
- package/src/modules/customers/events.ts +3 -3
- package/src/modules/customers/i18n/de.json +10 -0
- package/src/modules/customers/i18n/en.json +10 -0
- package/src/modules/customers/i18n/es.json +10 -0
- package/src/modules/customers/i18n/pl.json +10 -0
- package/src/modules/customers/lib/displayName.ts +19 -0
- package/src/modules/customers/lib/personCompanies.ts +12 -7
- package/src/modules/customers/lib/personCompanyLinkTable.ts +14 -0
- 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 {
|
|
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
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
|