@open-mercato/core 0.8.1-develop.7267.1.2e95af80a6 → 0.8.1-develop.7268.1.033c0546d5
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/backend/customers/companies/create/page.js +5 -0
- package/dist/modules/customers/backend/customers/companies/create/page.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/customer_accounts/AGENTS.md +1 -1
- package/src/modules/customers/backend/customers/companies/create/page.tsx +6 -0
|
@@ -10,12 +10,15 @@ import { E } from "../../../../../../generated/entities.ids.generated.js";
|
|
|
10
10
|
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
11
11
|
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
12
12
|
import { useOrganizationScopeDetail } from "@open-mercato/shared/lib/frontend/useOrganizationScope";
|
|
13
|
+
import { crudFormExtensionSpotId } from "@open-mercato/shared/modules/widgets/extension-points";
|
|
14
|
+
import { extensionPoints } from "@open-mercato/core/modules/customers/extension-points";
|
|
13
15
|
import {
|
|
14
16
|
buildCompanyPayload,
|
|
15
17
|
createCompanyFormFields,
|
|
16
18
|
createCompanyFormGroups,
|
|
17
19
|
createCompanyFormSchema
|
|
18
20
|
} from "../../../../components/formConfig.js";
|
|
21
|
+
const COMPANY_CREATE_LEGACY_INJECTION_SPOT_ID = crudFormExtensionSpotId("customers.customer_entity");
|
|
19
22
|
function CreateCompanyPage() {
|
|
20
23
|
const t = useT();
|
|
21
24
|
const router = useRouter();
|
|
@@ -34,6 +37,8 @@ function CreateCompanyPage() {
|
|
|
34
37
|
fields,
|
|
35
38
|
groups,
|
|
36
39
|
initialValues: { addresses: [] },
|
|
40
|
+
injectionSpotId: extensionPoints.hosts.companyForm.spotId,
|
|
41
|
+
legacyInjectionSpotId: COMPANY_CREATE_LEGACY_INJECTION_SPOT_ID,
|
|
37
42
|
entityIds: [E.customers.customer_entity, E.customers.customer_company_profile],
|
|
38
43
|
submitLabel: t("customers.companies.form.submit"),
|
|
39
44
|
cancelHref: returnTo ?? "/backend/customers/companies",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/modules/customers/backend/customers/companies/create/page.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useRouter, useSearchParams } from 'next/navigation'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { CrudForm } from '@open-mercato/ui/backend/CrudForm'\nimport { createCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { createCrudFormError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { E } from '#generated/entities.ids.generated'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { useOrganizationScopeDetail } from '@open-mercato/shared/lib/frontend/useOrganizationScope'\nimport {\n buildCompanyPayload,\n createCompanyFormFields,\n createCompanyFormGroups,\n createCompanyFormSchema,\n type CompanyFormValues,\n} from '../../../../components/formConfig'\n\nexport default function CreateCompanyPage() {\n const t = useT()\n const router = useRouter()\n const searchParams = useSearchParams()\n const { organizationId } = useOrganizationScopeDetail()\n\n const formSchema = React.useMemo(() => createCompanyFormSchema(), [])\n const fields = React.useMemo(() => createCompanyFormFields(t), [t])\n const groups = React.useMemo(() => createCompanyFormGroups(t), [t])\n const returnTo = searchParams.get('returnTo')\n\n return (\n <Page>\n <PageBody>\n <CrudForm<CompanyFormValues>\n title={t('customers.companies.create.title')}\n titleHeadingLevel={1}\n backHref={returnTo ?? '/backend/customers/companies'}\n fields={fields}\n groups={groups}\n initialValues={{ addresses: [] as CompanyFormValues['addresses'] }}\n entityIds={[E.customers.customer_entity, E.customers.customer_company_profile]}\n submitLabel={t('customers.companies.form.submit')}\n cancelHref={returnTo ?? '/backend/customers/companies'}\n schema={formSchema}\n onSubmit={async (values) => {\n const addresses = Array.isArray(values.addresses) ? values.addresses : []\n let payload: Record<string, unknown>\n try {\n payload = buildCompanyPayload(values, organizationId)\n } catch (err) {\n if (err instanceof Error) {\n if (err.message === 'DISPLAY_NAME_REQUIRED') {\n const message = t('customers.companies.form.displayName.error')\n throw createCrudFormError(message, { displayName: message })\n }\n if (err.message === 'ANNUAL_REVENUE_INVALID') {\n const message = t('customers.companies.form.annualRevenue.error')\n throw createCrudFormError(message, { annualRevenue: message })\n }\n }\n throw err\n }\n\n const { result: created } = await createCrud<{ id?: string; entityId?: string }>(\n 'customers/companies',\n payload,\n )\n const newId =\n created && typeof created.id === 'string'\n ? created.id\n : (typeof created?.entityId === 'string' ? created.entityId : null)\n\n if (newId && addresses.length) {\n const normalize = (value?: string | null) => {\n if (typeof value !== 'string') return undefined\n const trimmed = value.trim()\n return trimmed.length ? trimmed : undefined\n }\n for (const entry of addresses) {\n const normalizedLine1 = normalize(entry.addressLine1)\n if (!normalizedLine1) continue\n const body: Record<string, unknown> = {\n entityId: newId,\n ...(organizationId ? { organizationId } : {}),\n addressLine1: normalizedLine1,\n isPrimary: entry.isPrimary ?? false,\n }\n const name = normalize(entry.name)\n if (name !== undefined) body.name = name\n const purpose = normalize(entry.purpose)\n if (purpose !== undefined) body.purpose = purpose\n const line2 = normalize(entry.addressLine2)\n if (line2 !== undefined) body.addressLine2 = line2\n const buildingNumber = normalize(entry.buildingNumber)\n if (buildingNumber !== undefined) body.buildingNumber = buildingNumber\n const flatNumber = normalize(entry.flatNumber)\n if (flatNumber !== undefined) body.flatNumber = flatNumber\n const city = normalize(entry.city)\n if (city !== undefined) body.city = city\n const region = normalize(entry.region)\n if (region !== undefined) body.region = region\n const postalCode = normalize(entry.postalCode)\n if (postalCode !== undefined) body.postalCode = postalCode\n const country = normalize(entry.country)\n if (country !== undefined) body.country = country.toUpperCase()\n if (typeof entry.latitude === 'number') body.latitude = entry.latitude\n if (typeof entry.longitude === 'number') body.longitude = entry.longitude\n try {\n await createCrud('customers/addresses', body)\n } catch (addressErr) {\n const message =\n addressErr instanceof Error && addressErr.message\n ? addressErr.message\n : t('customers.companies.detail.addresses.error')\n flash(message, 'error')\n }\n }\n }\n\n flash(t('customers.companies.form.success'), 'success')\n if (returnTo) router.push(returnTo)\n else if (newId) router.push(`/backend/customers/companies-v2/${newId}`)\n else router.push('/backend/customers/companies')\n }}\n />\n </PageBody>\n </Page>\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { useRouter, useSearchParams } from 'next/navigation'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { CrudForm } from '@open-mercato/ui/backend/CrudForm'\nimport { createCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { createCrudFormError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { E } from '#generated/entities.ids.generated'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { useOrganizationScopeDetail } from '@open-mercato/shared/lib/frontend/useOrganizationScope'\nimport { crudFormExtensionSpotId } from '@open-mercato/shared/modules/widgets/extension-points'\nimport { extensionPoints } from '@open-mercato/core/modules/customers/extension-points'\nimport {\n buildCompanyPayload,\n createCompanyFormFields,\n createCompanyFormGroups,\n createCompanyFormSchema,\n type CompanyFormValues,\n} from '../../../../components/formConfig'\n\nconst COMPANY_CREATE_LEGACY_INJECTION_SPOT_ID = crudFormExtensionSpotId('customers.customer_entity')\n\nexport default function CreateCompanyPage() {\n const t = useT()\n const router = useRouter()\n const searchParams = useSearchParams()\n const { organizationId } = useOrganizationScopeDetail()\n\n const formSchema = React.useMemo(() => createCompanyFormSchema(), [])\n const fields = React.useMemo(() => createCompanyFormFields(t), [t])\n const groups = React.useMemo(() => createCompanyFormGroups(t), [t])\n const returnTo = searchParams.get('returnTo')\n\n return (\n <Page>\n <PageBody>\n <CrudForm<CompanyFormValues>\n title={t('customers.companies.create.title')}\n titleHeadingLevel={1}\n backHref={returnTo ?? '/backend/customers/companies'}\n fields={fields}\n groups={groups}\n initialValues={{ addresses: [] as CompanyFormValues['addresses'] }}\n injectionSpotId={extensionPoints.hosts.companyForm.spotId}\n legacyInjectionSpotId={COMPANY_CREATE_LEGACY_INJECTION_SPOT_ID}\n entityIds={[E.customers.customer_entity, E.customers.customer_company_profile]}\n submitLabel={t('customers.companies.form.submit')}\n cancelHref={returnTo ?? '/backend/customers/companies'}\n schema={formSchema}\n onSubmit={async (values) => {\n const addresses = Array.isArray(values.addresses) ? values.addresses : []\n let payload: Record<string, unknown>\n try {\n payload = buildCompanyPayload(values, organizationId)\n } catch (err) {\n if (err instanceof Error) {\n if (err.message === 'DISPLAY_NAME_REQUIRED') {\n const message = t('customers.companies.form.displayName.error')\n throw createCrudFormError(message, { displayName: message })\n }\n if (err.message === 'ANNUAL_REVENUE_INVALID') {\n const message = t('customers.companies.form.annualRevenue.error')\n throw createCrudFormError(message, { annualRevenue: message })\n }\n }\n throw err\n }\n\n const { result: created } = await createCrud<{ id?: string; entityId?: string }>(\n 'customers/companies',\n payload,\n )\n const newId =\n created && typeof created.id === 'string'\n ? created.id\n : (typeof created?.entityId === 'string' ? created.entityId : null)\n\n if (newId && addresses.length) {\n const normalize = (value?: string | null) => {\n if (typeof value !== 'string') return undefined\n const trimmed = value.trim()\n return trimmed.length ? trimmed : undefined\n }\n for (const entry of addresses) {\n const normalizedLine1 = normalize(entry.addressLine1)\n if (!normalizedLine1) continue\n const body: Record<string, unknown> = {\n entityId: newId,\n ...(organizationId ? { organizationId } : {}),\n addressLine1: normalizedLine1,\n isPrimary: entry.isPrimary ?? false,\n }\n const name = normalize(entry.name)\n if (name !== undefined) body.name = name\n const purpose = normalize(entry.purpose)\n if (purpose !== undefined) body.purpose = purpose\n const line2 = normalize(entry.addressLine2)\n if (line2 !== undefined) body.addressLine2 = line2\n const buildingNumber = normalize(entry.buildingNumber)\n if (buildingNumber !== undefined) body.buildingNumber = buildingNumber\n const flatNumber = normalize(entry.flatNumber)\n if (flatNumber !== undefined) body.flatNumber = flatNumber\n const city = normalize(entry.city)\n if (city !== undefined) body.city = city\n const region = normalize(entry.region)\n if (region !== undefined) body.region = region\n const postalCode = normalize(entry.postalCode)\n if (postalCode !== undefined) body.postalCode = postalCode\n const country = normalize(entry.country)\n if (country !== undefined) body.country = country.toUpperCase()\n if (typeof entry.latitude === 'number') body.latitude = entry.latitude\n if (typeof entry.longitude === 'number') body.longitude = entry.longitude\n try {\n await createCrud('customers/addresses', body)\n } catch (addressErr) {\n const message =\n addressErr instanceof Error && addressErr.message\n ? addressErr.message\n : t('customers.companies.detail.addresses.error')\n flash(message, 'error')\n }\n }\n }\n\n flash(t('customers.companies.form.success'), 'success')\n if (returnTo) router.push(returnTo)\n else if (newId) router.push(`/backend/customers/companies-v2/${newId}`)\n else router.push('/backend/customers/companies')\n }}\n />\n </PageBody>\n </Page>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAsCQ;AApCR,YAAY,WAAW;AACvB,SAAS,WAAW,uBAAuB;AAC3C,SAAS,MAAM,gBAAgB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,SAAS,SAAS;AAClB,SAAS,aAAa;AACtB,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAC3C,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,MAAM,0CAA0C,wBAAwB,2BAA2B;AAEpF,SAAR,oBAAqC;AAC1C,QAAM,IAAI,KAAK;AACf,QAAM,SAAS,UAAU;AACzB,QAAM,eAAe,gBAAgB;AACrC,QAAM,EAAE,eAAe,IAAI,2BAA2B;AAEtD,QAAM,aAAa,MAAM,QAAQ,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACpE,QAAM,SAAS,MAAM,QAAQ,MAAM,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC;AAClE,QAAM,SAAS,MAAM,QAAQ,MAAM,wBA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BAAM,UACJ,sBAAsB,SAAS,WAAW,UACtC,WAAW,UACX,EAAE,4CAA4C;AACpD,oBAAM,SAAS,OAAO;AAAA,YACxB;AAAA,UACF;AAAA,QACF;AAEA,cAAM,EAAE,kCAAkC,GAAG,SAAS;AACtD,YAAI,SAAU,QAAO,KAAK,QAAQ;AAAA,iBACzB,MAAO,QAAO,KAAK,mCAAmC,KAAK,EAAE;AAAA,YACjE,QAAO,KAAK,8BAA8B;AAAA,MACjD;AAAA;AAAA,EACF,GACF,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/core",
|
|
3
|
-
"version": "0.8.1-develop.
|
|
3
|
+
"version": "0.8.1-develop.7268.1.033c0546d5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -253,16 +253,16 @@
|
|
|
253
253
|
"zod": "^4.4.3"
|
|
254
254
|
},
|
|
255
255
|
"peerDependencies": {
|
|
256
|
-
"@open-mercato/ai-assistant": "0.8.1-develop.
|
|
257
|
-
"@open-mercato/shared": "0.8.1-develop.
|
|
258
|
-
"@open-mercato/ui": "0.8.1-develop.
|
|
256
|
+
"@open-mercato/ai-assistant": "0.8.1-develop.7268.1.033c0546d5",
|
|
257
|
+
"@open-mercato/shared": "0.8.1-develop.7268.1.033c0546d5",
|
|
258
|
+
"@open-mercato/ui": "0.8.1-develop.7268.1.033c0546d5",
|
|
259
259
|
"react": "^19.0.0",
|
|
260
260
|
"react-dom": "^19.0.0"
|
|
261
261
|
},
|
|
262
262
|
"devDependencies": {
|
|
263
|
-
"@open-mercato/ai-assistant": "0.8.1-develop.
|
|
264
|
-
"@open-mercato/shared": "0.8.1-develop.
|
|
265
|
-
"@open-mercato/ui": "0.8.1-develop.
|
|
263
|
+
"@open-mercato/ai-assistant": "0.8.1-develop.7268.1.033c0546d5",
|
|
264
|
+
"@open-mercato/shared": "0.8.1-develop.7268.1.033c0546d5",
|
|
265
|
+
"@open-mercato/ui": "0.8.1-develop.7268.1.033c0546d5",
|
|
266
266
|
"@testing-library/dom": "^10.4.1",
|
|
267
267
|
"@testing-library/jest-dom": "^7.0.1",
|
|
268
268
|
"@testing-library/react": "^16.3.3",
|
|
@@ -320,7 +320,7 @@ Both link to `/backend/customer_accounts/{sourceEntityId}` for staff review.
|
|
|
320
320
|
| `customers.person` | `account-status` | Alias for hosts requesting the bare `customers.person` entity spot |
|
|
321
321
|
| `crud-form:customers.person` | `account-status` | Shows portal account status on the person v2 detail page (`people-v2/[id]`) |
|
|
322
322
|
| `customers.company` | `company-users` | Alias for hosts requesting the bare `customers.company` entity spot |
|
|
323
|
-
| `crud-form:customers.company` | `company-users` | Shows portal users on the company v2 detail page (`companies-v2/[id]`) |
|
|
323
|
+
| `crud-form:customers.company` | `company-users` | Shows portal users on every company surface that publishes the host — the company v2 detail page (`companies-v2/[id]`), the company create page (`companies/create`), and the sales document "Create company" quick dialog — where it has no `recordId` and renders its empty state |
|
|
324
324
|
|
|
325
325
|
Both inject as column 2 groups with priority 200, gated by `customer_accounts.view` feature.
|
|
326
326
|
|
|
@@ -10,6 +10,8 @@ import { E } from '#generated/entities.ids.generated'
|
|
|
10
10
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
11
11
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
12
12
|
import { useOrganizationScopeDetail } from '@open-mercato/shared/lib/frontend/useOrganizationScope'
|
|
13
|
+
import { crudFormExtensionSpotId } from '@open-mercato/shared/modules/widgets/extension-points'
|
|
14
|
+
import { extensionPoints } from '@open-mercato/core/modules/customers/extension-points'
|
|
13
15
|
import {
|
|
14
16
|
buildCompanyPayload,
|
|
15
17
|
createCompanyFormFields,
|
|
@@ -18,6 +20,8 @@ import {
|
|
|
18
20
|
type CompanyFormValues,
|
|
19
21
|
} from '../../../../components/formConfig'
|
|
20
22
|
|
|
23
|
+
const COMPANY_CREATE_LEGACY_INJECTION_SPOT_ID = crudFormExtensionSpotId('customers.customer_entity')
|
|
24
|
+
|
|
21
25
|
export default function CreateCompanyPage() {
|
|
22
26
|
const t = useT()
|
|
23
27
|
const router = useRouter()
|
|
@@ -39,6 +43,8 @@ export default function CreateCompanyPage() {
|
|
|
39
43
|
fields={fields}
|
|
40
44
|
groups={groups}
|
|
41
45
|
initialValues={{ addresses: [] as CompanyFormValues['addresses'] }}
|
|
46
|
+
injectionSpotId={extensionPoints.hosts.companyForm.spotId}
|
|
47
|
+
legacyInjectionSpotId={COMPANY_CREATE_LEGACY_INJECTION_SPOT_ID}
|
|
42
48
|
entityIds={[E.customers.customer_entity, E.customers.customer_company_profile]}
|
|
43
49
|
submitLabel={t('customers.companies.form.submit')}
|
|
44
50
|
cancelHref={returnTo ?? '/backend/customers/companies'}
|