@open-mercato/core 0.4.9-develop-721e6b830f → 0.4.9-develop-c7274682b5
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/components/detail/DealForm.js +8 -2
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/package.json +3 -3
- package/src/modules/customers/components/detail/DealForm.tsx +8 -2
- package/src/modules/customers/i18n/de.json +2 -0
- package/src/modules/customers/i18n/en.json +2 -0
- package/src/modules/customers/i18n/es.json +2 -0
- package/src/modules/customers/i18n/pl.json +2 -0
|
@@ -21,8 +21,14 @@ const schema = z.object({
|
|
|
21
21
|
title: z.string().trim().min(1, "customers.people.detail.deals.titleRequired").max(200, "customers.people.detail.deals.titleTooLong"),
|
|
22
22
|
status: z.string().trim().max(50, "customers.people.detail.deals.statusTooLong").optional(),
|
|
23
23
|
pipelineStage: z.string().trim().max(100, "customers.people.detail.deals.pipelineTooLong").optional(),
|
|
24
|
-
pipelineId: z.
|
|
25
|
-
|
|
24
|
+
pipelineId: z.preprocess(
|
|
25
|
+
(v) => typeof v === "string" && !v.trim() ? void 0 : v,
|
|
26
|
+
z.string().uuid("customers.people.detail.deals.pipelineIdInvalid").optional()
|
|
27
|
+
),
|
|
28
|
+
pipelineStageId: z.preprocess(
|
|
29
|
+
(v) => typeof v === "string" && !v.trim() ? void 0 : v,
|
|
30
|
+
z.string().uuid("customers.people.detail.deals.pipelineStageIdInvalid").optional()
|
|
31
|
+
),
|
|
26
32
|
valueAmount: z.preprocess((value) => {
|
|
27
33
|
if (value === "" || value === null || value === void 0) return void 0;
|
|
28
34
|
if (typeof value === "number") return value;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/customers/components/detail/DealForm.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { z } from 'zod'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { CrudForm, type CrudField, type CrudFormGroup } from '@open-mercato/ui/backend/CrudForm'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { createCrudFormError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { DictionarySelectField } from '../formConfig'\nimport { createDictionarySelectLabels } from './utils'\nimport { E } from '#generated/entities.ids.generated'\nimport { collectCustomFieldValues } from '@open-mercato/ui/backend/utils/customFieldValues'\nimport { useCurrencyDictionary } from './hooks/useCurrencyDictionary'\nimport { DictionaryEntrySelect } from '@open-mercato/core/modules/dictionaries/components/DictionaryEntrySelect'\nimport { normalizeCustomFieldSubmitValue } from './customFieldUtils'\n\nexport type DealFormBaseValues = {\n title: string\n status?: string | null\n pipelineStage?: string | null\n pipelineId?: string | null\n pipelineStageId?: string | null\n valueAmount?: number | null\n valueCurrency?: string | null\n probability?: number | null\n expectedCloseAt?: string | null\n description?: string | null\n personIds?: string[]\n companyIds?: string[]\n}\n\nexport type DealFormSubmitPayload = {\n base: DealFormBaseValues\n custom: Record<string, unknown>\n}\n\nexport type DealFormProps = {\n mode: 'create' | 'edit'\n initialValues?: Partial<DealFormBaseValues & Record<string, unknown>>\n onSubmit: (payload: DealFormSubmitPayload) => Promise<void>\n onCancel: () => void\n onDelete?: () => Promise<void> | void\n submitLabel?: string\n cancelLabel?: string\n isSubmitting?: boolean\n embedded?: boolean\n title?: string\n backHref?: string\n}\n\ntype EntityOption = {\n id: string\n label: string\n subtitle?: string | null\n}\n\ntype EntityMultiSelectProps = {\n value: string[]\n onChange: (next: string[]) => void\n placeholder: string\n emptyLabel: string\n loadingLabel: string\n noResultsLabel: string\n removeLabel: string\n errorLabel: string\n search: (query: string) => Promise<EntityOption[]>\n fetchByIds: (ids: string[]) => Promise<EntityOption[]>\n disabled?: boolean\n autoFocus?: boolean\n}\n\nconst DEAL_ENTITY_IDS = [E.customers.customer_deal]\nconst CURRENCY_PRIORITY = ['EUR', 'USD', 'GBP', 'PLN'] as const\n\nconst schema = z.object({\n title: z\n .string()\n .trim()\n .min(1, 'customers.people.detail.deals.titleRequired')\n .max(200, 'customers.people.detail.deals.titleTooLong'),\n status: z\n .string()\n .trim()\n .max(50, 'customers.people.detail.deals.statusTooLong')\n .optional(),\n pipelineStage: z\n .string()\n .trim()\n .max(100, 'customers.people.detail.deals.pipelineTooLong')\n .optional(),\n pipelineId: z.string().uuid().optional(),\n pipelineStageId: z.string().uuid().optional(),\n valueAmount: z\n .preprocess((value) => {\n if (value === '' || value === null || value === undefined) return undefined\n if (typeof value === 'number') return value\n if (typeof value === 'string') {\n const trimmed = value.trim()\n if (!trimmed) return undefined\n const parsed = Number(trimmed)\n if (Number.isNaN(parsed)) return value\n return parsed\n }\n return value\n }, z\n .number()\n .min(0, 'customers.people.detail.deals.valueInvalid')\n .optional())\n .optional(),\n valueCurrency: z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .refine(\n (value) => !value || /^[A-Z]{3}$/.test(value),\n 'customers.people.detail.deals.currencyInvalid',\n )\n .optional(),\n probability: z\n .preprocess((value) => {\n if (value === '' || value === null || value === undefined) return undefined\n if (typeof value === 'number') return value\n if (typeof value === 'string') {\n const trimmed = value.trim()\n if (!trimmed) return undefined\n const parsed = Number(trimmed)\n if (Number.isNaN(parsed)) return value\n return parsed\n }\n return value\n }, z\n .number()\n .min(0, 'customers.people.detail.deals.probabilityInvalid')\n .max(100, 'customers.people.detail.deals.probabilityInvalid')\n .optional())\n .optional(),\n expectedCloseAt: z\n .string()\n .transform((value) => value.trim())\n .refine(\n (value) => {\n if (!value) return true\n const parsed = new Date(value)\n return !Number.isNaN(parsed.getTime())\n },\n 'customers.people.detail.deals.expectedCloseInvalid',\n )\n .optional(),\n description: z.string().max(4000, 'customers.people.detail.deals.descriptionTooLong').optional(),\n personIds: z.array(z.string().trim().min(1)).optional(),\n companyIds: z.array(z.string().trim().min(1)).optional(),\n}).passthrough()\n\nfunction toDateInputValue(value: string | null | undefined): string {\n if (!value) return ''\n const parsed = new Date(value)\n if (Number.isNaN(parsed.getTime())) return ''\n const year = parsed.getUTCFullYear()\n const month = String(parsed.getUTCMonth() + 1).padStart(2, '0')\n const day = String(parsed.getUTCDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\nfunction normalizeCurrency(value: string | null | undefined): string {\n if (!value) return ''\n return value.trim().slice(0, 3).toUpperCase()\n}\n\nfunction sanitizeIdList(input: unknown): string[] {\n if (!Array.isArray(input)) return []\n const set = new Set<string>()\n input.forEach((candidate) => {\n if (typeof candidate !== 'string') return\n const trimmed = candidate.trim()\n if (!trimmed.length) return\n set.add(trimmed)\n })\n return Array.from(set)\n}\n\nfunction extractPersonOption(record: Record<string, unknown>): EntityOption | null {\n const id = typeof record.id === 'string' ? record.id : null\n if (!id) return null\n const displayName =\n typeof record.displayName === 'string' && record.displayName.trim().length\n ? record.displayName.trim()\n : typeof record.display_name === 'string' && record.display_name.trim().length\n ? (record.display_name as string).trim()\n : null\n const email =\n typeof record.primaryEmail === 'string' && record.primaryEmail.trim().length\n ? record.primaryEmail.trim()\n : typeof record.primary_email === 'string' && record.primary_email.trim().length\n ? (record.primary_email as string).trim()\n : null\n const label = displayName ?? email ?? id\n const subtitle = email && email !== label ? email : null\n return { id, label, subtitle }\n}\n\nfunction extractCompanyOption(record: Record<string, unknown>): EntityOption | null {\n const id = typeof record.id === 'string' ? record.id : null\n if (!id) return null\n const displayName =\n typeof record.displayName === 'string' && record.displayName.trim().length\n ? record.displayName.trim()\n : typeof record.display_name === 'string' && record.display_name.trim().length\n ? (record.display_name as string).trim()\n : null\n const domain =\n typeof record.domain === 'string' && record.domain.trim().length\n ? record.domain.trim()\n : typeof record.websiteUrl === 'string' && record.websiteUrl.trim().length\n ? record.websiteUrl.trim()\n : typeof record.website_url === 'string' && record.website_url.trim().length\n ? (record.website_url as string).trim()\n : null\n const label = displayName ?? domain ?? id\n const subtitle = domain && domain !== label ? domain : null\n return { id, label, subtitle }\n}\n\nfunction EntityMultiSelect({\n value,\n onChange,\n placeholder,\n emptyLabel,\n loadingLabel,\n noResultsLabel,\n removeLabel,\n errorLabel,\n search,\n fetchByIds,\n disabled = false,\n autoFocus = false,\n}: EntityMultiSelectProps) {\n const [input, setInput] = React.useState('')\n const [suggestions, setSuggestions] = React.useState<EntityOption[]>([])\n const [cache, setCache] = React.useState<Map<string, EntityOption>>(() => new Map())\n const [loading, setLoading] = React.useState(false)\n const [error, setError] = React.useState<string | null>(null)\n\n const normalizedValue = React.useMemo(() => sanitizeIdList(value), [value])\n\n React.useEffect(() => {\n if (!normalizedValue.length) return\n const missing = normalizedValue.filter((id) => !cache.has(id))\n if (!missing.length) return\n let cancelled = false\n ;(async () => {\n try {\n const entries = await fetchByIds(missing)\n if (cancelled) return\n setCache((prev) => {\n const next = new Map(prev)\n entries.forEach((entry) => {\n if (entry?.id) next.set(entry.id, entry)\n })\n return next\n })\n } catch {\n if (!cancelled) setError(errorLabel)\n }\n })().catch(() => {})\n return () => { cancelled = true }\n }, [cache, errorLabel, fetchByIds, normalizedValue])\n\n React.useEffect(() => {\n if (disabled) {\n setLoading(false)\n return\n }\n let cancelled = false\n const handler = window.setTimeout(async () => {\n setLoading(true)\n try {\n const results = await search(input.trim())\n if (cancelled) return\n setSuggestions(results)\n setCache((prev) => {\n const next = new Map(prev)\n results.forEach((entry) => {\n if (entry?.id) next.set(entry.id, entry)\n })\n return next\n })\n setError(null)\n } catch {\n if (!cancelled) {\n setError(errorLabel)\n setSuggestions([])\n }\n } finally {\n if (!cancelled) setLoading(false)\n }\n }, 200)\n return () => {\n cancelled = true\n window.clearTimeout(handler)\n }\n }, [disabled, errorLabel, input, search])\n\n const filteredSuggestions = React.useMemo(\n () => suggestions.filter((option) => !normalizedValue.includes(option.id)),\n [normalizedValue, suggestions],\n )\n\n const selectedOptions = React.useMemo(\n () => normalizedValue.map((id) => cache.get(id) ?? { id, label: id }),\n [cache, normalizedValue],\n )\n\n const addOption = React.useCallback(\n (option: EntityOption) => {\n if (!option?.id) return\n if (normalizedValue.includes(option.id)) return\n const next = [...normalizedValue, option.id]\n onChange(next)\n setCache((prev) => {\n const nextCache = new Map(prev)\n nextCache.set(option.id, option)\n return nextCache\n })\n setInput('')\n setSuggestions([])\n },\n [normalizedValue, onChange],\n )\n\n const removeOption = React.useCallback(\n (id: string) => {\n const next = normalizedValue.filter((candidate) => candidate !== id)\n onChange(next)\n },\n [normalizedValue, onChange],\n )\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex flex-wrap items-center gap-2 rounded border px-2 py-1\">\n {selectedOptions.map((option) => (\n <span key={option.id} className=\"inline-flex items-center gap-1 rounded bg-muted px-2 py-0.5 text-xs\">\n {option.label}\n <IconButton\n variant=\"ghost\"\n size=\"xs\"\n className=\"opacity-60 hover:opacity-100\"\n onClick={() => removeOption(option.id)}\n aria-label={`${removeLabel} ${option.label}`}\n disabled={disabled}\n >\n \u00D7\n </IconButton>\n </span>\n ))}\n <input\n type=\"text\"\n className=\"flex-1 min-w-[160px] border-0 bg-transparent py-1 text-sm outline-none\"\n value={input}\n placeholder={placeholder}\n onChange={(event) => setInput(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n const nextOption = filteredSuggestions[0]\n if (nextOption) addOption(nextOption)\n } else if (event.key === 'Backspace' && !input.length && normalizedValue.length) {\n removeOption(normalizedValue[normalizedValue.length - 1])\n }\n }}\n disabled={disabled}\n autoFocus={autoFocus}\n data-crud-focus-target=\"\"\n />\n </div>\n {loading ? <div className=\"text-xs text-muted-foreground\">{loadingLabel}</div> : null}\n {!loading && filteredSuggestions.length ? (\n <div className=\"flex flex-wrap gap-2\">\n {filteredSuggestions.slice(0, 10).map((option) => (\n <Button\n key={option.id}\n variant=\"outline\"\n size=\"sm\"\n className=\"h-auto px-2 py-1 text-xs font-normal\"\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => addOption(option)}\n disabled={disabled}\n >\n <span className=\"flex flex-col items-start\">\n <span>{option.label}</span>\n {option.subtitle ? (\n <span className=\"text-[10px] text-muted-foreground\">{option.subtitle}</span>\n ) : null}\n </span>\n </Button>\n ))}\n </div>\n ) : null}\n {!loading && !filteredSuggestions.length && input.trim().length ? (\n <div className=\"text-xs text-muted-foreground\">{noResultsLabel}</div>\n ) : null}\n {error ? <div className=\"text-xs text-red-600\">{error}</div> : null}\n {!normalizedValue.length && !input.trim().length ? (\n <div className=\"text-xs text-muted-foreground\">{emptyLabel}</div>\n ) : null}\n </div>\n )\n}\n\nexport function DealForm({\n mode,\n initialValues,\n onSubmit,\n onCancel,\n onDelete,\n submitLabel,\n cancelLabel,\n isSubmitting = false,\n embedded = true,\n title,\n backHref,\n}: DealFormProps) {\n const t = useT()\n const [pending, setPending] = React.useState(false)\n const {\n data: currencyDictionaryData,\n error: currencyDictionaryErrorRaw,\n isLoading: currencyDictionaryLoading,\n refetch: refetchCurrencyDictionary,\n } = useCurrencyDictionary()\n const currencyDictionaryError = currencyDictionaryErrorRaw\n ? currencyDictionaryErrorRaw instanceof Error\n ? currencyDictionaryErrorRaw.message\n : String(currencyDictionaryErrorRaw)\n : null\n\n const translate = React.useCallback(\n (key: string, fallback: string) => {\n const value = t(key)\n return value === key ? fallback : value\n },\n [t],\n )\n\n const dictionaryLabels = React.useMemo(() => ({\n status: createDictionarySelectLabels('deal-statuses', translate),\n }), [translate])\n\n const resolvedCurrencyError = React.useMemo(() => {\n if (currencyDictionaryError) return currencyDictionaryError\n if (!currencyDictionaryLoading && !currencyDictionaryData) {\n return t('customers.deals.form.currency.missing', 'Currency dictionary is not configured yet.')\n }\n return null\n }, [currencyDictionaryData, currencyDictionaryError, currencyDictionaryLoading, t])\n\n const fetchCurrencyOptions = React.useCallback(async () => {\n let payload = currencyDictionaryData ?? null\n if (!payload) {\n try {\n payload = await refetchCurrencyDictionary()\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err ?? '')\n throw new Error(message || t('customers.deals.form.currency.error', 'Failed to load currency dictionary.'))\n }\n }\n if (!payload) {\n throw new Error(t('customers.deals.form.currency.missing', 'Currency dictionary is not configured yet.'))\n }\n const priorityOrder = new Map<string, number>()\n CURRENCY_PRIORITY.forEach((code, index) => priorityOrder.set(code, index))\n const prioritized: { value: string; label: string; color: string | null; icon: string | null }[] = []\n const remainder: { value: string; label: string; color: string | null; icon: string | null }[] = []\n payload.entries.forEach((entry) => {\n const value = entry.value.toUpperCase()\n const label = entry.label && entry.label.length ? `${value} \u2013 ${entry.label}` : value\n const option = { value, label, color: null, icon: null }\n if (priorityOrder.has(value)) prioritized.push(option)\n else remainder.push(option)\n })\n prioritized.sort((a, b) => (priorityOrder.get(a.value)! - priorityOrder.get(b.value)!))\n remainder.sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }))\n return [...prioritized, ...remainder]\n }, [currencyDictionaryData, refetchCurrencyDictionary, t])\n\n const currencyDictionaryLabels = React.useMemo(() => ({\n placeholder: t('customers.deals.form.currency.placeholder', 'Select currency\u2026'),\n addLabel: t('customers.deals.form.currency.add', 'Add currency'),\n dialogTitle: t('customers.deals.form.currency.dialogTitle', 'Add currency'),\n valueLabel: t('customers.deals.form.currency.valueLabel', 'Currency code'),\n valuePlaceholder: t('customers.deals.form.currency.valuePlaceholder', 'e.g. USD'),\n labelLabel: t('customers.deals.form.currency.labelLabel', 'Label'),\n labelPlaceholder: t('customers.deals.form.currency.labelPlaceholder', 'Display name shown in UI'),\n emptyError: t('customers.deals.form.currency.error.required', 'Currency code is required.'),\n cancelLabel: t('customers.deals.form.currency.cancel', 'Cancel'),\n saveLabel: t('customers.deals.form.currency.save', 'Save'),\n errorLoad: t('customers.deals.form.currency.error', 'Failed to load currency dictionary.'),\n errorSave: t('customers.deals.form.currency.error', 'Failed to load currency dictionary.'),\n loadingLabel: t('customers.deals.form.currency.loading', 'Loading currencies\u2026'),\n manageTitle: t('customers.deals.form.currency.manage', 'Manage currency dictionary'),\n }), [t])\n\n const searchPeople = React.useCallback(async (query: string): Promise<EntityOption[]> => {\n const params = new URLSearchParams({\n pageSize: '20',\n sortField: 'name',\n sortDir: 'asc',\n })\n if (query.trim().length) params.set('search', query.trim())\n const call = await apiCall<Record<string, unknown>>(`/api/customers/people?${params.toString()}`)\n if (!call.ok) {\n throw new Error(typeof call.result?.error === 'string' ? String(call.result?.error) : 'Failed to search people')\n }\n const payload = call.result ?? {}\n const items = Array.isArray(payload.items) ? payload.items : []\n return items\n .map((item: unknown) => (item && typeof item === 'object' ? extractPersonOption(item as Record<string, unknown>) : null))\n .filter((entry: EntityOption | null): entry is EntityOption => entry !== null)\n }, [])\n\n const fetchPeopleByIds = React.useCallback(async (ids: string[]): Promise<EntityOption[]> => {\n const unique = sanitizeIdList(ids)\n if (!unique.length) return []\n const results = await Promise.all(unique.map(async (id) => {\n try {\n const call = await apiCall<Record<string, unknown>>(`/api/customers/people?id=${encodeURIComponent(id)}&pageSize=1`)\n if (!call.ok) throw new Error()\n const payload = call.result ?? {}\n const items = Array.isArray(payload.items) ? payload.items : []\n const option = items\n .map((item: unknown) => (item && typeof item === 'object' ? extractPersonOption(item as Record<string, unknown>) : null))\n .find((candidate: EntityOption | null): candidate is EntityOption => candidate !== null)\n return option ?? { id, label: id }\n } catch {\n return { id, label: id }\n }\n }))\n return results\n }, [])\n\n const searchCompanies = React.useCallback(async (query: string): Promise<EntityOption[]> => {\n const params = new URLSearchParams({\n pageSize: '20',\n sortField: 'name',\n sortDir: 'asc',\n })\n if (query.trim().length) params.set('search', query.trim())\n const call = await apiCall<Record<string, unknown>>(`/api/customers/companies?${params.toString()}`)\n if (!call.ok) {\n throw new Error(typeof call.result?.error === 'string' ? String(call.result?.error) : 'Failed to search companies')\n }\n const payload = call.result ?? {}\n const items = Array.isArray(payload.items) ? payload.items : []\n return items\n .map((item: unknown) => (item && typeof item === 'object' ? extractCompanyOption(item as Record<string, unknown>) : null))\n .filter((entry: EntityOption | null): entry is EntityOption => entry !== null)\n }, [])\n\n const fetchCompaniesByIds = React.useCallback(async (ids: string[]): Promise<EntityOption[]> => {\n const unique = sanitizeIdList(ids)\n if (!unique.length) return []\n const results = await Promise.all(unique.map(async (id) => {\n try {\n const call = await apiCall<Record<string, unknown>>(`/api/customers/companies?id=${encodeURIComponent(id)}&pageSize=1`)\n if (!call.ok) throw new Error()\n const payload = call.result ?? {}\n const items = Array.isArray(payload.items) ? payload.items : []\n const option = items\n .map((item: unknown) => (item && typeof item === 'object' ? extractCompanyOption(item as Record<string, unknown>) : null))\n .find((candidate: EntityOption | null): candidate is EntityOption => candidate !== null)\n return option ?? { id, label: id }\n } catch {\n return { id, label: id }\n }\n }))\n return results\n }, [])\n\n const disabled = pending || isSubmitting\n const canDelete = mode === 'edit' && typeof onDelete === 'function'\n\n type PipelineOption = { id: string; name: string; isDefault: boolean }\n type PipelineStageOption = { id: string; label: string; order: number }\n\n const [pipelines, setPipelines] = React.useState<PipelineOption[]>([])\n const [pipelineStages, setPipelineStages] = React.useState<PipelineStageOption[]>([])\n\n const loadStagesForPipeline = React.useCallback(async (pipelineId: string) => {\n if (!pipelineId) {\n setPipelineStages([])\n return\n }\n try {\n const call = await apiCall<{ items: PipelineStageOption[] }>(`/api/customers/pipeline-stages?pipelineId=${encodeURIComponent(pipelineId)}`)\n if (call.ok && call.result?.items) {\n const sorted = [...call.result.items].sort((a, b) => a.order - b.order)\n setPipelineStages(sorted)\n }\n } catch {\n setPipelineStages([])\n }\n }, [])\n\n React.useEffect(() => {\n let cancelled = false\n ;(async () => {\n try {\n const call = await apiCall<{ items: PipelineOption[] }>('/api/customers/pipelines')\n if (cancelled) return\n if (call.ok && call.result?.items) {\n setPipelines(call.result.items)\n }\n } catch {\n // ignore\n }\n })().catch(() => {})\n return () => { cancelled = true }\n }, [])\n\n React.useEffect(() => {\n const pid = initialValues?.pipelineId\n if (typeof pid === 'string' && pid.length) {\n loadStagesForPipeline(pid).catch(() => {})\n }\n }, [initialValues?.pipelineId, loadStagesForPipeline])\n\n const baseFields = React.useMemo<CrudField[]>(() => [\n {\n id: 'title',\n label: t('customers.people.detail.deals.fields.title', 'Title'),\n type: 'text',\n required: true,\n },\n {\n id: 'status',\n label: t('customers.people.detail.deals.fields.status', 'Status'),\n type: 'custom',\n layout: 'half',\n component: ({ value, setValue }) => (\n <DictionarySelectField\n kind=\"deal-statuses\"\n value={typeof value === 'string' ? value : undefined}\n onChange={(next) => setValue(next ?? '')}\n labels={dictionaryLabels.status}\n selectClassName=\"w-full\"\n />\n ),\n } as CrudField,\n {\n id: 'pipelineId',\n label: t('customers.people.detail.deals.fields.pipeline', 'Pipeline'),\n type: 'custom',\n layout: 'half',\n component: ({ value, setValue }) => (\n <select\n className=\"w-full rounded border px-2 py-1.5 text-sm\"\n value={typeof value === 'string' ? value : ''}\n onChange={(e) => {\n setValue(e.target.value)\n loadStagesForPipeline(e.target.value).catch(() => {})\n }}\n disabled={disabled}\n >\n <option value=\"\">{t('customers.deals.form.pipeline.placeholder', 'Select pipeline\u2026')}</option>\n {pipelines.map((p) => (\n <option key={p.id} value={p.id}>{p.name}</option>\n ))}\n </select>\n ),\n } as CrudField,\n {\n id: 'pipelineStageId',\n label: t('customers.people.detail.deals.fields.pipelineStage', 'Pipeline stage'),\n type: 'custom',\n layout: 'half',\n component: ({ value, setValue }) => (\n <select\n className=\"w-full rounded border px-2 py-1.5 text-sm\"\n value={typeof value === 'string' ? value : ''}\n onChange={(e) => setValue(e.target.value)}\n disabled={disabled || !pipelineStages.length}\n >\n <option value=\"\">{t('customers.deals.form.pipelineStage.placeholder', 'Select stage\u2026')}</option>\n {pipelineStages.map((s) => (\n <option key={s.id} value={s.id}>{s.label}</option>\n ))}\n </select>\n ),\n } as CrudField,\n {\n id: 'valueAmount',\n label: t('customers.people.detail.deals.fields.valueAmount', 'Amount'),\n type: 'number',\n layout: 'half',\n },\n {\n id: 'valueCurrency',\n label: t('customers.people.detail.deals.fields.valueCurrency', 'Currency'),\n type: 'custom',\n layout: 'half',\n component: ({ value, setValue }) => (\n <div className=\"space-y-1\">\n <DictionaryEntrySelect\n value={typeof value === 'string' ? value : undefined}\n onChange={(next) => setValue(next ?? '')}\n fetchOptions={fetchCurrencyOptions}\n labels={currencyDictionaryLabels}\n manageHref=\"/backend/config/dictionaries?key=currency\"\n allowInlineCreate={false}\n allowAppearance={false}\n selectClassName=\"w-full\"\n disabled={disabled}\n showLabelInput={false}\n />\n {resolvedCurrencyError ? (\n <div className=\"text-xs text-muted-foreground\">{resolvedCurrencyError}</div>\n ) : null}\n </div>\n ),\n } as CrudField,\n {\n id: 'probability',\n label: t('customers.people.detail.deals.fields.probability', 'Probability (%)'),\n type: 'number',\n layout: 'half',\n },\n {\n id: 'expectedCloseAt',\n label: t('customers.people.detail.deals.fields.expectedCloseAt', 'Expected close'),\n type: 'date',\n layout: 'half',\n },\n {\n id: 'description',\n label: t('customers.people.detail.deals.fields.description', 'Description'),\n type: 'textarea',\n },\n {\n id: 'personIds',\n label: t('customers.people.detail.deals.fields.people', 'People'),\n type: 'custom',\n component: ({ value, setValue, autoFocus }) => (\n <EntityMultiSelect\n value={Array.isArray(value) ? value : []}\n onChange={(next) => setValue(next)}\n placeholder={t('customers.deals.form.people.searchPlaceholder', 'Search people\u2026')}\n emptyLabel={t('customers.deals.form.people.empty', 'No people linked yet.')}\n loadingLabel={t('customers.deals.form.people.loading', 'Searching people\u2026')}\n noResultsLabel={t('customers.deals.form.people.noResults', 'No people match your search.')}\n removeLabel={t('customers.deals.form.assignees.remove', 'Remove')}\n errorLabel={t('customers.deals.form.people.error', 'Failed to load people.')}\n search={searchPeople}\n fetchByIds={fetchPeopleByIds}\n disabled={disabled}\n autoFocus={autoFocus}\n />\n ),\n } as CrudField,\n {\n id: 'companyIds',\n label: t('customers.people.detail.deals.fields.companies', 'Companies'),\n type: 'custom',\n component: ({ value, setValue }) => (\n <EntityMultiSelect\n value={Array.isArray(value) ? value : []}\n onChange={(next) => setValue(next)}\n placeholder={t('customers.deals.form.companies.searchPlaceholder', 'Search companies\u2026')}\n emptyLabel={t('customers.deals.form.companies.empty', 'No companies linked yet.')}\n loadingLabel={t('customers.deals.form.companies.loading', 'Searching companies\u2026')}\n noResultsLabel={t('customers.deals.form.companies.noResults', 'No companies match your search.')}\n removeLabel={t('customers.deals.form.assignees.remove', 'Remove')}\n errorLabel={t('customers.deals.form.companies.error', 'Failed to load companies.')}\n search={searchCompanies}\n fetchByIds={fetchCompaniesByIds}\n disabled={disabled}\n />\n ),\n } as CrudField,\n ], [currencyDictionaryLabels, fetchCurrencyOptions, resolvedCurrencyError, pipelines, pipelineStages, loadStagesForPipeline, dictionaryLabels.status, disabled, fetchCompaniesByIds, fetchPeopleByIds, searchCompanies, searchPeople, t])\n\n const groups = React.useMemo<CrudFormGroup[]>(() => [\n {\n id: 'details',\n title: t('customers.people.detail.deals.form.details', 'Deal details'),\n column: 1,\n fields: ['title', 'status', 'pipelineId', 'pipelineStageId', 'valueAmount', 'valueCurrency', 'probability', 'expectedCloseAt', 'description'],\n },\n {\n id: 'associations',\n title: t('customers.people.detail.deals.form.associations', 'Associations'),\n column: 1,\n fields: ['personIds', 'companyIds'],\n },\n {\n id: 'custom',\n title: t('customers.people.detail.deals.form.customFields', 'Custom fields'),\n column: 2,\n kind: 'customFields',\n },\n ], [t])\n\n const embeddedInitialValues = React.useMemo(() => {\n const normalizeNumber = (value: unknown): number | null => {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string') {\n const parsed = Number(value)\n return Number.isNaN(parsed) ? null : parsed\n }\n return null\n }\n\n const resolveIdsFromSource = (source: unknown): string[] => {\n if (Array.isArray(source)) {\n return sanitizeIdList(\n source.map((entry) => {\n if (typeof entry === 'string') return entry\n if (entry && typeof entry === 'object' && 'id' in entry && typeof (entry as any).id === 'string') {\n return (entry as any).id\n }\n return null\n }),\n )\n }\n return []\n }\n\n return {\n id: typeof initialValues?.id === 'string' ? initialValues.id : undefined,\n title: initialValues?.title ?? '',\n status: initialValues?.status ?? '',\n pipelineStage: initialValues?.pipelineStage ?? '',\n pipelineId: initialValues?.pipelineId ?? (typeof (initialValues as Record<string, unknown>)?.pipeline_id === 'string' ? (initialValues as Record<string, unknown>).pipeline_id as string : ''),\n pipelineStageId: initialValues?.pipelineStageId ?? (typeof (initialValues as Record<string, unknown>)?.pipeline_stage_id === 'string' ? (initialValues as Record<string, unknown>).pipeline_stage_id as string : ''),\n valueAmount: normalizeNumber(initialValues?.valueAmount ?? null),\n valueCurrency: normalizeCurrency(initialValues?.valueCurrency ?? null),\n probability: normalizeNumber(initialValues?.probability ?? null),\n expectedCloseAt: toDateInputValue(initialValues?.expectedCloseAt ?? null),\n description: initialValues?.description ?? '',\n personIds: sanitizeIdList(initialValues?.personIds ?? resolveIdsFromSource(initialValues?.people)),\n companyIds: sanitizeIdList(initialValues?.companyIds ?? resolveIdsFromSource(initialValues?.companies)),\n ...Object.fromEntries(\n Object.entries(initialValues ?? {})\n .filter(([key]) => key.startsWith('cf_'))\n .map(([key, value]) => [key, value]),\n ),\n }\n }, [initialValues])\n\n const handleSubmit = React.useCallback(\n async (values: Record<string, unknown>) => {\n if (pending || isSubmitting) return\n setPending(true)\n try {\n const parsed = schema.safeParse(values)\n if (!parsed.success) {\n throw buildDealValidationError(parsed.error.issues, t)\n }\n const expectedCloseAt =\n parsed.data.expectedCloseAt && parsed.data.expectedCloseAt.length\n ? new Date(parsed.data.expectedCloseAt).toISOString()\n : undefined\n const personIds = sanitizeIdList(parsed.data.personIds)\n const companyIds = sanitizeIdList(parsed.data.companyIds)\n const base: DealFormBaseValues = {\n title: parsed.data.title,\n status: parsed.data.status || undefined,\n pipelineStage: parsed.data.pipelineStage || undefined,\n pipelineId: parsed.data.pipelineId || undefined,\n pipelineStageId: parsed.data.pipelineStageId || undefined,\n valueAmount:\n typeof parsed.data.valueAmount === 'number' ? parsed.data.valueAmount : undefined,\n valueCurrency: parsed.data.valueCurrency || undefined,\n probability:\n typeof parsed.data.probability === 'number' ? parsed.data.probability : undefined,\n expectedCloseAt,\n description: parsed.data.description && parsed.data.description.length\n ? parsed.data.description\n : undefined,\n personIds,\n companyIds,\n }\n const customEntries = collectCustomFieldValues(values, {\n transform: (value) => normalizeCustomFieldSubmitValue(value),\n })\n await onSubmit({ base, custom: customEntries })\n } finally {\n setPending(false)\n }\n },\n [isSubmitting, onSubmit, pending, t],\n )\n\n return (\n <CrudForm<Record<string, unknown>>\n embedded={embedded}\n title={title}\n backHref={backHref}\n versionHistory={mode === 'edit' && initialValues?.id\n ? { resourceKind: 'customers.deal', resourceId: String(initialValues.id) }\n : undefined}\n schema={schema}\n fields={baseFields}\n groups={groups}\n entityIds={DEAL_ENTITY_IDS}\n initialValues={embeddedInitialValues}\n onSubmit={handleSubmit}\n onDelete={canDelete ? onDelete : undefined}\n deleteVisible={canDelete}\n submitLabel={\n submitLabel ??\n (mode === 'edit'\n ? t('customers.people.detail.deals.update', 'Update deal (\u2318/Ctrl + Enter)')\n : t('customers.people.detail.deals.save', 'Save deal (\u2318/Ctrl + Enter)'))\n }\n extraActions={(\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={onCancel}\n disabled={pending || isSubmitting}\n >\n {cancelLabel ?? t('customers.people.detail.deals.cancel', 'Cancel')}\n </Button>\n )}\n />\n )\n}\n\nexport function buildDealValidationError(issues: z.ZodIssue[], t: (key: string, fallback?: string) => string) {\n const issue = issues[0]\n const message =\n typeof issue?.message === 'string'\n ? issue.message\n : t('customers.people.detail.deals.error', 'Failed to save deal.')\n const firstPath = Array.isArray(issue?.path) ? issue?.path?.[0] : undefined\n const field = typeof firstPath === 'string' ? firstPath : undefined\n throw createCrudFormError(message, field ? { [field]: message } : undefined)\n}\n\nexport default DealForm\n"],
|
|
5
|
-
"mappings": ";AAsVU,SAEE,KAFF;AApVV,YAAY,WAAW;AACvB,SAAS,SAAS;AAClB,SAAS,YAAY;AACrB,SAAS,gBAAoD;AAC7D,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;A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;AAAA,MACpE;AAAA;AAAA,EAEJ;AAEJ;AAEO,SAAS,yBAAyB,QAAsB,GAA+C;AAC5G,QAAM,QAAQ,OAAO,CAAC;AACtB,QAAM,UACJ,OAAO,OAAO,YAAY,WACtB,MAAM,UACN,EAAE,uCAAuC,sBAAsB;AACrE,QAAM,YAAY,MAAM,QAAQ,OAAO,IAAI,IAAI,OAAO,OAAO,CAAC,IAAI;AAClE,QAAM,QAAQ,OAAO,cAAc,WAAW,YAAY;AAC1D,QAAM,oBAAoB,SAAS,QAAQ,EAAE,CAAC,KAAK,GAAG,QAAQ,IAAI,MAAS;AAC7E;AAEA,IAAO,mBAAQ;",
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport { z } from 'zod'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { CrudForm, type CrudField, type CrudFormGroup } from '@open-mercato/ui/backend/CrudForm'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { IconButton } from '@open-mercato/ui/primitives/icon-button'\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { createCrudFormError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { DictionarySelectField } from '../formConfig'\nimport { createDictionarySelectLabels } from './utils'\nimport { E } from '#generated/entities.ids.generated'\nimport { collectCustomFieldValues } from '@open-mercato/ui/backend/utils/customFieldValues'\nimport { useCurrencyDictionary } from './hooks/useCurrencyDictionary'\nimport { DictionaryEntrySelect } from '@open-mercato/core/modules/dictionaries/components/DictionaryEntrySelect'\nimport { normalizeCustomFieldSubmitValue } from './customFieldUtils'\n\nexport type DealFormBaseValues = {\n title: string\n status?: string | null\n pipelineStage?: string | null\n pipelineId?: string | null\n pipelineStageId?: string | null\n valueAmount?: number | null\n valueCurrency?: string | null\n probability?: number | null\n expectedCloseAt?: string | null\n description?: string | null\n personIds?: string[]\n companyIds?: string[]\n}\n\nexport type DealFormSubmitPayload = {\n base: DealFormBaseValues\n custom: Record<string, unknown>\n}\n\nexport type DealFormProps = {\n mode: 'create' | 'edit'\n initialValues?: Partial<DealFormBaseValues & Record<string, unknown>>\n onSubmit: (payload: DealFormSubmitPayload) => Promise<void>\n onCancel: () => void\n onDelete?: () => Promise<void> | void\n submitLabel?: string\n cancelLabel?: string\n isSubmitting?: boolean\n embedded?: boolean\n title?: string\n backHref?: string\n}\n\ntype EntityOption = {\n id: string\n label: string\n subtitle?: string | null\n}\n\ntype EntityMultiSelectProps = {\n value: string[]\n onChange: (next: string[]) => void\n placeholder: string\n emptyLabel: string\n loadingLabel: string\n noResultsLabel: string\n removeLabel: string\n errorLabel: string\n search: (query: string) => Promise<EntityOption[]>\n fetchByIds: (ids: string[]) => Promise<EntityOption[]>\n disabled?: boolean\n autoFocus?: boolean\n}\n\nconst DEAL_ENTITY_IDS = [E.customers.customer_deal]\nconst CURRENCY_PRIORITY = ['EUR', 'USD', 'GBP', 'PLN'] as const\n\nconst schema = z.object({\n title: z\n .string()\n .trim()\n .min(1, 'customers.people.detail.deals.titleRequired')\n .max(200, 'customers.people.detail.deals.titleTooLong'),\n status: z\n .string()\n .trim()\n .max(50, 'customers.people.detail.deals.statusTooLong')\n .optional(),\n pipelineStage: z\n .string()\n .trim()\n .max(100, 'customers.people.detail.deals.pipelineTooLong')\n .optional(),\n pipelineId: z.preprocess(\n (v) => (typeof v === 'string' && !v.trim() ? undefined : v),\n z.string().uuid('customers.people.detail.deals.pipelineIdInvalid').optional(),\n ),\n pipelineStageId: z.preprocess(\n (v) => (typeof v === 'string' && !v.trim() ? undefined : v),\n z.string().uuid('customers.people.detail.deals.pipelineStageIdInvalid').optional(),\n ),\n valueAmount: z\n .preprocess((value) => {\n if (value === '' || value === null || value === undefined) return undefined\n if (typeof value === 'number') return value\n if (typeof value === 'string') {\n const trimmed = value.trim()\n if (!trimmed) return undefined\n const parsed = Number(trimmed)\n if (Number.isNaN(parsed)) return value\n return parsed\n }\n return value\n }, z\n .number()\n .min(0, 'customers.people.detail.deals.valueInvalid')\n .optional())\n .optional(),\n valueCurrency: z\n .string()\n .transform((value) => value.trim().toUpperCase())\n .refine(\n (value) => !value || /^[A-Z]{3}$/.test(value),\n 'customers.people.detail.deals.currencyInvalid',\n )\n .optional(),\n probability: z\n .preprocess((value) => {\n if (value === '' || value === null || value === undefined) return undefined\n if (typeof value === 'number') return value\n if (typeof value === 'string') {\n const trimmed = value.trim()\n if (!trimmed) return undefined\n const parsed = Number(trimmed)\n if (Number.isNaN(parsed)) return value\n return parsed\n }\n return value\n }, z\n .number()\n .min(0, 'customers.people.detail.deals.probabilityInvalid')\n .max(100, 'customers.people.detail.deals.probabilityInvalid')\n .optional())\n .optional(),\n expectedCloseAt: z\n .string()\n .transform((value) => value.trim())\n .refine(\n (value) => {\n if (!value) return true\n const parsed = new Date(value)\n return !Number.isNaN(parsed.getTime())\n },\n 'customers.people.detail.deals.expectedCloseInvalid',\n )\n .optional(),\n description: z.string().max(4000, 'customers.people.detail.deals.descriptionTooLong').optional(),\n personIds: z.array(z.string().trim().min(1)).optional(),\n companyIds: z.array(z.string().trim().min(1)).optional(),\n}).passthrough()\n\nfunction toDateInputValue(value: string | null | undefined): string {\n if (!value) return ''\n const parsed = new Date(value)\n if (Number.isNaN(parsed.getTime())) return ''\n const year = parsed.getUTCFullYear()\n const month = String(parsed.getUTCMonth() + 1).padStart(2, '0')\n const day = String(parsed.getUTCDate()).padStart(2, '0')\n return `${year}-${month}-${day}`\n}\n\nfunction normalizeCurrency(value: string | null | undefined): string {\n if (!value) return ''\n return value.trim().slice(0, 3).toUpperCase()\n}\n\nfunction sanitizeIdList(input: unknown): string[] {\n if (!Array.isArray(input)) return []\n const set = new Set<string>()\n input.forEach((candidate) => {\n if (typeof candidate !== 'string') return\n const trimmed = candidate.trim()\n if (!trimmed.length) return\n set.add(trimmed)\n })\n return Array.from(set)\n}\n\nfunction extractPersonOption(record: Record<string, unknown>): EntityOption | null {\n const id = typeof record.id === 'string' ? record.id : null\n if (!id) return null\n const displayName =\n typeof record.displayName === 'string' && record.displayName.trim().length\n ? record.displayName.trim()\n : typeof record.display_name === 'string' && record.display_name.trim().length\n ? (record.display_name as string).trim()\n : null\n const email =\n typeof record.primaryEmail === 'string' && record.primaryEmail.trim().length\n ? record.primaryEmail.trim()\n : typeof record.primary_email === 'string' && record.primary_email.trim().length\n ? (record.primary_email as string).trim()\n : null\n const label = displayName ?? email ?? id\n const subtitle = email && email !== label ? email : null\n return { id, label, subtitle }\n}\n\nfunction extractCompanyOption(record: Record<string, unknown>): EntityOption | null {\n const id = typeof record.id === 'string' ? record.id : null\n if (!id) return null\n const displayName =\n typeof record.displayName === 'string' && record.displayName.trim().length\n ? record.displayName.trim()\n : typeof record.display_name === 'string' && record.display_name.trim().length\n ? (record.display_name as string).trim()\n : null\n const domain =\n typeof record.domain === 'string' && record.domain.trim().length\n ? record.domain.trim()\n : typeof record.websiteUrl === 'string' && record.websiteUrl.trim().length\n ? record.websiteUrl.trim()\n : typeof record.website_url === 'string' && record.website_url.trim().length\n ? (record.website_url as string).trim()\n : null\n const label = displayName ?? domain ?? id\n const subtitle = domain && domain !== label ? domain : null\n return { id, label, subtitle }\n}\n\nfunction EntityMultiSelect({\n value,\n onChange,\n placeholder,\n emptyLabel,\n loadingLabel,\n noResultsLabel,\n removeLabel,\n errorLabel,\n search,\n fetchByIds,\n disabled = false,\n autoFocus = false,\n}: EntityMultiSelectProps) {\n const [input, setInput] = React.useState('')\n const [suggestions, setSuggestions] = React.useState<EntityOption[]>([])\n const [cache, setCache] = React.useState<Map<string, EntityOption>>(() => new Map())\n const [loading, setLoading] = React.useState(false)\n const [error, setError] = React.useState<string | null>(null)\n\n const normalizedValue = React.useMemo(() => sanitizeIdList(value), [value])\n\n React.useEffect(() => {\n if (!normalizedValue.length) return\n const missing = normalizedValue.filter((id) => !cache.has(id))\n if (!missing.length) return\n let cancelled = false\n ;(async () => {\n try {\n const entries = await fetchByIds(missing)\n if (cancelled) return\n setCache((prev) => {\n const next = new Map(prev)\n entries.forEach((entry) => {\n if (entry?.id) next.set(entry.id, entry)\n })\n return next\n })\n } catch {\n if (!cancelled) setError(errorLabel)\n }\n })().catch(() => {})\n return () => { cancelled = true }\n }, [cache, errorLabel, fetchByIds, normalizedValue])\n\n React.useEffect(() => {\n if (disabled) {\n setLoading(false)\n return\n }\n let cancelled = false\n const handler = window.setTimeout(async () => {\n setLoading(true)\n try {\n const results = await search(input.trim())\n if (cancelled) return\n setSuggestions(results)\n setCache((prev) => {\n const next = new Map(prev)\n results.forEach((entry) => {\n if (entry?.id) next.set(entry.id, entry)\n })\n return next\n })\n setError(null)\n } catch {\n if (!cancelled) {\n setError(errorLabel)\n setSuggestions([])\n }\n } finally {\n if (!cancelled) setLoading(false)\n }\n }, 200)\n return () => {\n cancelled = true\n window.clearTimeout(handler)\n }\n }, [disabled, errorLabel, input, search])\n\n const filteredSuggestions = React.useMemo(\n () => suggestions.filter((option) => !normalizedValue.includes(option.id)),\n [normalizedValue, suggestions],\n )\n\n const selectedOptions = React.useMemo(\n () => normalizedValue.map((id) => cache.get(id) ?? { id, label: id }),\n [cache, normalizedValue],\n )\n\n const addOption = React.useCallback(\n (option: EntityOption) => {\n if (!option?.id) return\n if (normalizedValue.includes(option.id)) return\n const next = [...normalizedValue, option.id]\n onChange(next)\n setCache((prev) => {\n const nextCache = new Map(prev)\n nextCache.set(option.id, option)\n return nextCache\n })\n setInput('')\n setSuggestions([])\n },\n [normalizedValue, onChange],\n )\n\n const removeOption = React.useCallback(\n (id: string) => {\n const next = normalizedValue.filter((candidate) => candidate !== id)\n onChange(next)\n },\n [normalizedValue, onChange],\n )\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex flex-wrap items-center gap-2 rounded border px-2 py-1\">\n {selectedOptions.map((option) => (\n <span key={option.id} className=\"inline-flex items-center gap-1 rounded bg-muted px-2 py-0.5 text-xs\">\n {option.label}\n <IconButton\n variant=\"ghost\"\n size=\"xs\"\n className=\"opacity-60 hover:opacity-100\"\n onClick={() => removeOption(option.id)}\n aria-label={`${removeLabel} ${option.label}`}\n disabled={disabled}\n >\n \u00D7\n </IconButton>\n </span>\n ))}\n <input\n type=\"text\"\n className=\"flex-1 min-w-[160px] border-0 bg-transparent py-1 text-sm outline-none\"\n value={input}\n placeholder={placeholder}\n onChange={(event) => setInput(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n const nextOption = filteredSuggestions[0]\n if (nextOption) addOption(nextOption)\n } else if (event.key === 'Backspace' && !input.length && normalizedValue.length) {\n removeOption(normalizedValue[normalizedValue.length - 1])\n }\n }}\n disabled={disabled}\n autoFocus={autoFocus}\n data-crud-focus-target=\"\"\n />\n </div>\n {loading ? <div className=\"text-xs text-muted-foreground\">{loadingLabel}</div> : null}\n {!loading && filteredSuggestions.length ? (\n <div className=\"flex flex-wrap gap-2\">\n {filteredSuggestions.slice(0, 10).map((option) => (\n <Button\n key={option.id}\n variant=\"outline\"\n size=\"sm\"\n className=\"h-auto px-2 py-1 text-xs font-normal\"\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => addOption(option)}\n disabled={disabled}\n >\n <span className=\"flex flex-col items-start\">\n <span>{option.label}</span>\n {option.subtitle ? (\n <span className=\"text-[10px] text-muted-foreground\">{option.subtitle}</span>\n ) : null}\n </span>\n </Button>\n ))}\n </div>\n ) : null}\n {!loading && !filteredSuggestions.length && input.trim().length ? (\n <div className=\"text-xs text-muted-foreground\">{noResultsLabel}</div>\n ) : null}\n {error ? <div className=\"text-xs text-red-600\">{error}</div> : null}\n {!normalizedValue.length && !input.trim().length ? (\n <div className=\"text-xs text-muted-foreground\">{emptyLabel}</div>\n ) : null}\n </div>\n )\n}\n\nexport function DealForm({\n mode,\n initialValues,\n onSubmit,\n onCancel,\n onDelete,\n submitLabel,\n cancelLabel,\n isSubmitting = false,\n embedded = true,\n title,\n backHref,\n}: DealFormProps) {\n const t = useT()\n const [pending, setPending] = React.useState(false)\n const {\n data: currencyDictionaryData,\n error: currencyDictionaryErrorRaw,\n isLoading: currencyDictionaryLoading,\n refetch: refetchCurrencyDictionary,\n } = useCurrencyDictionary()\n const currencyDictionaryError = currencyDictionaryErrorRaw\n ? currencyDictionaryErrorRaw instanceof Error\n ? currencyDictionaryErrorRaw.message\n : String(currencyDictionaryErrorRaw)\n : null\n\n const translate = React.useCallback(\n (key: string, fallback: string) => {\n const value = t(key)\n return value === key ? fallback : value\n },\n [t],\n )\n\n const dictionaryLabels = React.useMemo(() => ({\n status: createDictionarySelectLabels('deal-statuses', translate),\n }), [translate])\n\n const resolvedCurrencyError = React.useMemo(() => {\n if (currencyDictionaryError) return currencyDictionaryError\n if (!currencyDictionaryLoading && !currencyDictionaryData) {\n return t('customers.deals.form.currency.missing', 'Currency dictionary is not configured yet.')\n }\n return null\n }, [currencyDictionaryData, currencyDictionaryError, currencyDictionaryLoading, t])\n\n const fetchCurrencyOptions = React.useCallback(async () => {\n let payload = currencyDictionaryData ?? null\n if (!payload) {\n try {\n payload = await refetchCurrencyDictionary()\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err ?? '')\n throw new Error(message || t('customers.deals.form.currency.error', 'Failed to load currency dictionary.'))\n }\n }\n if (!payload) {\n throw new Error(t('customers.deals.form.currency.missing', 'Currency dictionary is not configured yet.'))\n }\n const priorityOrder = new Map<string, number>()\n CURRENCY_PRIORITY.forEach((code, index) => priorityOrder.set(code, index))\n const prioritized: { value: string; label: string; color: string | null; icon: string | null }[] = []\n const remainder: { value: string; label: string; color: string | null; icon: string | null }[] = []\n payload.entries.forEach((entry) => {\n const value = entry.value.toUpperCase()\n const label = entry.label && entry.label.length ? `${value} \u2013 ${entry.label}` : value\n const option = { value, label, color: null, icon: null }\n if (priorityOrder.has(value)) prioritized.push(option)\n else remainder.push(option)\n })\n prioritized.sort((a, b) => (priorityOrder.get(a.value)! - priorityOrder.get(b.value)!))\n remainder.sort((a, b) => a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }))\n return [...prioritized, ...remainder]\n }, [currencyDictionaryData, refetchCurrencyDictionary, t])\n\n const currencyDictionaryLabels = React.useMemo(() => ({\n placeholder: t('customers.deals.form.currency.placeholder', 'Select currency\u2026'),\n addLabel: t('customers.deals.form.currency.add', 'Add currency'),\n dialogTitle: t('customers.deals.form.currency.dialogTitle', 'Add currency'),\n valueLabel: t('customers.deals.form.currency.valueLabel', 'Currency code'),\n valuePlaceholder: t('customers.deals.form.currency.valuePlaceholder', 'e.g. USD'),\n labelLabel: t('customers.deals.form.currency.labelLabel', 'Label'),\n labelPlaceholder: t('customers.deals.form.currency.labelPlaceholder', 'Display name shown in UI'),\n emptyError: t('customers.deals.form.currency.error.required', 'Currency code is required.'),\n cancelLabel: t('customers.deals.form.currency.cancel', 'Cancel'),\n saveLabel: t('customers.deals.form.currency.save', 'Save'),\n errorLoad: t('customers.deals.form.currency.error', 'Failed to load currency dictionary.'),\n errorSave: t('customers.deals.form.currency.error', 'Failed to load currency dictionary.'),\n loadingLabel: t('customers.deals.form.currency.loading', 'Loading currencies\u2026'),\n manageTitle: t('customers.deals.form.currency.manage', 'Manage currency dictionary'),\n }), [t])\n\n const searchPeople = React.useCallback(async (query: string): Promise<EntityOption[]> => {\n const params = new URLSearchParams({\n pageSize: '20',\n sortField: 'name',\n sortDir: 'asc',\n })\n if (query.trim().length) params.set('search', query.trim())\n const call = await apiCall<Record<string, unknown>>(`/api/customers/people?${params.toString()}`)\n if (!call.ok) {\n throw new Error(typeof call.result?.error === 'string' ? String(call.result?.error) : 'Failed to search people')\n }\n const payload = call.result ?? {}\n const items = Array.isArray(payload.items) ? payload.items : []\n return items\n .map((item: unknown) => (item && typeof item === 'object' ? extractPersonOption(item as Record<string, unknown>) : null))\n .filter((entry: EntityOption | null): entry is EntityOption => entry !== null)\n }, [])\n\n const fetchPeopleByIds = React.useCallback(async (ids: string[]): Promise<EntityOption[]> => {\n const unique = sanitizeIdList(ids)\n if (!unique.length) return []\n const results = await Promise.all(unique.map(async (id) => {\n try {\n const call = await apiCall<Record<string, unknown>>(`/api/customers/people?id=${encodeURIComponent(id)}&pageSize=1`)\n if (!call.ok) throw new Error()\n const payload = call.result ?? {}\n const items = Array.isArray(payload.items) ? payload.items : []\n const option = items\n .map((item: unknown) => (item && typeof item === 'object' ? extractPersonOption(item as Record<string, unknown>) : null))\n .find((candidate: EntityOption | null): candidate is EntityOption => candidate !== null)\n return option ?? { id, label: id }\n } catch {\n return { id, label: id }\n }\n }))\n return results\n }, [])\n\n const searchCompanies = React.useCallback(async (query: string): Promise<EntityOption[]> => {\n const params = new URLSearchParams({\n pageSize: '20',\n sortField: 'name',\n sortDir: 'asc',\n })\n if (query.trim().length) params.set('search', query.trim())\n const call = await apiCall<Record<string, unknown>>(`/api/customers/companies?${params.toString()}`)\n if (!call.ok) {\n throw new Error(typeof call.result?.error === 'string' ? String(call.result?.error) : 'Failed to search companies')\n }\n const payload = call.result ?? {}\n const items = Array.isArray(payload.items) ? payload.items : []\n return items\n .map((item: unknown) => (item && typeof item === 'object' ? extractCompanyOption(item as Record<string, unknown>) : null))\n .filter((entry: EntityOption | null): entry is EntityOption => entry !== null)\n }, [])\n\n const fetchCompaniesByIds = React.useCallback(async (ids: string[]): Promise<EntityOption[]> => {\n const unique = sanitizeIdList(ids)\n if (!unique.length) return []\n const results = await Promise.all(unique.map(async (id) => {\n try {\n const call = await apiCall<Record<string, unknown>>(`/api/customers/companies?id=${encodeURIComponent(id)}&pageSize=1`)\n if (!call.ok) throw new Error()\n const payload = call.result ?? {}\n const items = Array.isArray(payload.items) ? payload.items : []\n const option = items\n .map((item: unknown) => (item && typeof item === 'object' ? extractCompanyOption(item as Record<string, unknown>) : null))\n .find((candidate: EntityOption | null): candidate is EntityOption => candidate !== null)\n return option ?? { id, label: id }\n } catch {\n return { id, label: id }\n }\n }))\n return results\n }, [])\n\n const disabled = pending || isSubmitting\n const canDelete = mode === 'edit' && typeof onDelete === 'function'\n\n type PipelineOption = { id: string; name: string; isDefault: boolean }\n type PipelineStageOption = { id: string; label: string; order: number }\n\n const [pipelines, setPipelines] = React.useState<PipelineOption[]>([])\n const [pipelineStages, setPipelineStages] = React.useState<PipelineStageOption[]>([])\n\n const loadStagesForPipeline = React.useCallback(async (pipelineId: string) => {\n if (!pipelineId) {\n setPipelineStages([])\n return\n }\n try {\n const call = await apiCall<{ items: PipelineStageOption[] }>(`/api/customers/pipeline-stages?pipelineId=${encodeURIComponent(pipelineId)}`)\n if (call.ok && call.result?.items) {\n const sorted = [...call.result.items].sort((a, b) => a.order - b.order)\n setPipelineStages(sorted)\n }\n } catch {\n setPipelineStages([])\n }\n }, [])\n\n React.useEffect(() => {\n let cancelled = false\n ;(async () => {\n try {\n const call = await apiCall<{ items: PipelineOption[] }>('/api/customers/pipelines')\n if (cancelled) return\n if (call.ok && call.result?.items) {\n setPipelines(call.result.items)\n }\n } catch {\n // ignore\n }\n })().catch(() => {})\n return () => { cancelled = true }\n }, [])\n\n React.useEffect(() => {\n const pid = initialValues?.pipelineId\n if (typeof pid === 'string' && pid.length) {\n loadStagesForPipeline(pid).catch(() => {})\n }\n }, [initialValues?.pipelineId, loadStagesForPipeline])\n\n const baseFields = React.useMemo<CrudField[]>(() => [\n {\n id: 'title',\n label: t('customers.people.detail.deals.fields.title', 'Title'),\n type: 'text',\n required: true,\n },\n {\n id: 'status',\n label: t('customers.people.detail.deals.fields.status', 'Status'),\n type: 'custom',\n layout: 'half',\n component: ({ value, setValue }) => (\n <DictionarySelectField\n kind=\"deal-statuses\"\n value={typeof value === 'string' ? value : undefined}\n onChange={(next) => setValue(next ?? '')}\n labels={dictionaryLabels.status}\n selectClassName=\"w-full\"\n />\n ),\n } as CrudField,\n {\n id: 'pipelineId',\n label: t('customers.people.detail.deals.fields.pipeline', 'Pipeline'),\n type: 'custom',\n layout: 'half',\n component: ({ value, setValue }) => (\n <select\n className=\"w-full rounded border px-2 py-1.5 text-sm\"\n value={typeof value === 'string' ? value : ''}\n onChange={(e) => {\n setValue(e.target.value)\n loadStagesForPipeline(e.target.value).catch(() => {})\n }}\n disabled={disabled}\n >\n <option value=\"\">{t('customers.deals.form.pipeline.placeholder', 'Select pipeline\u2026')}</option>\n {pipelines.map((p) => (\n <option key={p.id} value={p.id}>{p.name}</option>\n ))}\n </select>\n ),\n } as CrudField,\n {\n id: 'pipelineStageId',\n label: t('customers.people.detail.deals.fields.pipelineStage', 'Pipeline stage'),\n type: 'custom',\n layout: 'half',\n component: ({ value, setValue }) => (\n <select\n className=\"w-full rounded border px-2 py-1.5 text-sm\"\n value={typeof value === 'string' ? value : ''}\n onChange={(e) => setValue(e.target.value)}\n disabled={disabled || !pipelineStages.length}\n >\n <option value=\"\">{t('customers.deals.form.pipelineStage.placeholder', 'Select stage\u2026')}</option>\n {pipelineStages.map((s) => (\n <option key={s.id} value={s.id}>{s.label}</option>\n ))}\n </select>\n ),\n } as CrudField,\n {\n id: 'valueAmount',\n label: t('customers.people.detail.deals.fields.valueAmount', 'Amount'),\n type: 'number',\n layout: 'half',\n },\n {\n id: 'valueCurrency',\n label: t('customers.people.detail.deals.fields.valueCurrency', 'Currency'),\n type: 'custom',\n layout: 'half',\n component: ({ value, setValue }) => (\n <div className=\"space-y-1\">\n <DictionaryEntrySelect\n value={typeof value === 'string' ? value : undefined}\n onChange={(next) => setValue(next ?? '')}\n fetchOptions={fetchCurrencyOptions}\n labels={currencyDictionaryLabels}\n manageHref=\"/backend/config/dictionaries?key=currency\"\n allowInlineCreate={false}\n allowAppearance={false}\n selectClassName=\"w-full\"\n disabled={disabled}\n showLabelInput={false}\n />\n {resolvedCurrencyError ? (\n <div className=\"text-xs text-muted-foreground\">{resolvedCurrencyError}</div>\n ) : null}\n </div>\n ),\n } as CrudField,\n {\n id: 'probability',\n label: t('customers.people.detail.deals.fields.probability', 'Probability (%)'),\n type: 'number',\n layout: 'half',\n },\n {\n id: 'expectedCloseAt',\n label: t('customers.people.detail.deals.fields.expectedCloseAt', 'Expected close'),\n type: 'date',\n layout: 'half',\n },\n {\n id: 'description',\n label: t('customers.people.detail.deals.fields.description', 'Description'),\n type: 'textarea',\n },\n {\n id: 'personIds',\n label: t('customers.people.detail.deals.fields.people', 'People'),\n type: 'custom',\n component: ({ value, setValue, autoFocus }) => (\n <EntityMultiSelect\n value={Array.isArray(value) ? value : []}\n onChange={(next) => setValue(next)}\n placeholder={t('customers.deals.form.people.searchPlaceholder', 'Search people\u2026')}\n emptyLabel={t('customers.deals.form.people.empty', 'No people linked yet.')}\n loadingLabel={t('customers.deals.form.people.loading', 'Searching people\u2026')}\n noResultsLabel={t('customers.deals.form.people.noResults', 'No people match your search.')}\n removeLabel={t('customers.deals.form.assignees.remove', 'Remove')}\n errorLabel={t('customers.deals.form.people.error', 'Failed to load people.')}\n search={searchPeople}\n fetchByIds={fetchPeopleByIds}\n disabled={disabled}\n autoFocus={autoFocus}\n />\n ),\n } as CrudField,\n {\n id: 'companyIds',\n label: t('customers.people.detail.deals.fields.companies', 'Companies'),\n type: 'custom',\n component: ({ value, setValue }) => (\n <EntityMultiSelect\n value={Array.isArray(value) ? value : []}\n onChange={(next) => setValue(next)}\n placeholder={t('customers.deals.form.companies.searchPlaceholder', 'Search companies\u2026')}\n emptyLabel={t('customers.deals.form.companies.empty', 'No companies linked yet.')}\n loadingLabel={t('customers.deals.form.companies.loading', 'Searching companies\u2026')}\n noResultsLabel={t('customers.deals.form.companies.noResults', 'No companies match your search.')}\n removeLabel={t('customers.deals.form.assignees.remove', 'Remove')}\n errorLabel={t('customers.deals.form.companies.error', 'Failed to load companies.')}\n search={searchCompanies}\n fetchByIds={fetchCompaniesByIds}\n disabled={disabled}\n />\n ),\n } as CrudField,\n ], [currencyDictionaryLabels, fetchCurrencyOptions, resolvedCurrencyError, pipelines, pipelineStages, loadStagesForPipeline, dictionaryLabels.status, disabled, fetchCompaniesByIds, fetchPeopleByIds, searchCompanies, searchPeople, t])\n\n const groups = React.useMemo<CrudFormGroup[]>(() => [\n {\n id: 'details',\n title: t('customers.people.detail.deals.form.details', 'Deal details'),\n column: 1,\n fields: ['title', 'status', 'pipelineId', 'pipelineStageId', 'valueAmount', 'valueCurrency', 'probability', 'expectedCloseAt', 'description'],\n },\n {\n id: 'associations',\n title: t('customers.people.detail.deals.form.associations', 'Associations'),\n column: 1,\n fields: ['personIds', 'companyIds'],\n },\n {\n id: 'custom',\n title: t('customers.people.detail.deals.form.customFields', 'Custom fields'),\n column: 2,\n kind: 'customFields',\n },\n ], [t])\n\n const embeddedInitialValues = React.useMemo(() => {\n const normalizeNumber = (value: unknown): number | null => {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string') {\n const parsed = Number(value)\n return Number.isNaN(parsed) ? null : parsed\n }\n return null\n }\n\n const resolveIdsFromSource = (source: unknown): string[] => {\n if (Array.isArray(source)) {\n return sanitizeIdList(\n source.map((entry) => {\n if (typeof entry === 'string') return entry\n if (entry && typeof entry === 'object' && 'id' in entry && typeof (entry as any).id === 'string') {\n return (entry as any).id\n }\n return null\n }),\n )\n }\n return []\n }\n\n return {\n id: typeof initialValues?.id === 'string' ? initialValues.id : undefined,\n title: initialValues?.title ?? '',\n status: initialValues?.status ?? '',\n pipelineStage: initialValues?.pipelineStage ?? '',\n pipelineId: initialValues?.pipelineId ?? (typeof (initialValues as Record<string, unknown>)?.pipeline_id === 'string' ? (initialValues as Record<string, unknown>).pipeline_id as string : ''),\n pipelineStageId: initialValues?.pipelineStageId ?? (typeof (initialValues as Record<string, unknown>)?.pipeline_stage_id === 'string' ? (initialValues as Record<string, unknown>).pipeline_stage_id as string : ''),\n valueAmount: normalizeNumber(initialValues?.valueAmount ?? null),\n valueCurrency: normalizeCurrency(initialValues?.valueCurrency ?? null),\n probability: normalizeNumber(initialValues?.probability ?? null),\n expectedCloseAt: toDateInputValue(initialValues?.expectedCloseAt ?? null),\n description: initialValues?.description ?? '',\n personIds: sanitizeIdList(initialValues?.personIds ?? resolveIdsFromSource(initialValues?.people)),\n companyIds: sanitizeIdList(initialValues?.companyIds ?? resolveIdsFromSource(initialValues?.companies)),\n ...Object.fromEntries(\n Object.entries(initialValues ?? {})\n .filter(([key]) => key.startsWith('cf_'))\n .map(([key, value]) => [key, value]),\n ),\n }\n }, [initialValues])\n\n const handleSubmit = React.useCallback(\n async (values: Record<string, unknown>) => {\n if (pending || isSubmitting) return\n setPending(true)\n try {\n const parsed = schema.safeParse(values)\n if (!parsed.success) {\n throw buildDealValidationError(parsed.error.issues, t)\n }\n const expectedCloseAt =\n parsed.data.expectedCloseAt && parsed.data.expectedCloseAt.length\n ? new Date(parsed.data.expectedCloseAt).toISOString()\n : undefined\n const personIds = sanitizeIdList(parsed.data.personIds)\n const companyIds = sanitizeIdList(parsed.data.companyIds)\n const base: DealFormBaseValues = {\n title: parsed.data.title,\n status: parsed.data.status || undefined,\n pipelineStage: parsed.data.pipelineStage || undefined,\n pipelineId: parsed.data.pipelineId || undefined,\n pipelineStageId: parsed.data.pipelineStageId || undefined,\n valueAmount:\n typeof parsed.data.valueAmount === 'number' ? parsed.data.valueAmount : undefined,\n valueCurrency: parsed.data.valueCurrency || undefined,\n probability:\n typeof parsed.data.probability === 'number' ? parsed.data.probability : undefined,\n expectedCloseAt,\n description: parsed.data.description && parsed.data.description.length\n ? parsed.data.description\n : undefined,\n personIds,\n companyIds,\n }\n const customEntries = collectCustomFieldValues(values, {\n transform: (value) => normalizeCustomFieldSubmitValue(value),\n })\n await onSubmit({ base, custom: customEntries })\n } finally {\n setPending(false)\n }\n },\n [isSubmitting, onSubmit, pending, t],\n )\n\n return (\n <CrudForm<Record<string, unknown>>\n embedded={embedded}\n title={title}\n backHref={backHref}\n versionHistory={mode === 'edit' && initialValues?.id\n ? { resourceKind: 'customers.deal', resourceId: String(initialValues.id) }\n : undefined}\n schema={schema}\n fields={baseFields}\n groups={groups}\n entityIds={DEAL_ENTITY_IDS}\n initialValues={embeddedInitialValues}\n onSubmit={handleSubmit}\n onDelete={canDelete ? onDelete : undefined}\n deleteVisible={canDelete}\n submitLabel={\n submitLabel ??\n (mode === 'edit'\n ? t('customers.people.detail.deals.update', 'Update deal (\u2318/Ctrl + Enter)')\n : t('customers.people.detail.deals.save', 'Save deal (\u2318/Ctrl + Enter)'))\n }\n extraActions={(\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={onCancel}\n disabled={pending || isSubmitting}\n >\n {cancelLabel ?? t('customers.people.detail.deals.cancel', 'Cancel')}\n </Button>\n )}\n />\n )\n}\n\nexport function buildDealValidationError(issues: z.ZodIssue[], t: (key: string, fallback?: string) => string) {\n const issue = issues[0]\n const message =\n typeof issue?.message === 'string'\n ? issue.message\n : t('customers.people.detail.deals.error', 'Failed to save deal.')\n const firstPath = Array.isArray(issue?.path) ? issue?.path?.[0] : undefined\n const field = typeof firstPath === 'string' ? firstPath : undefined\n throw createCrudFormError(message, field ? { [field]: message } : undefined)\n}\n\nexport default DealForm\n"],
|
|
5
|
+
"mappings": ";AA4VU,SAEE,KAFF;AA1VV,YAAY,WAAW;AACvB,SAAS,SAAS;AAClB,SAAS,YAAY;AACrB,SAAS,gBAAoD;AAC7D,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC,SAAS,oCAAoC;AAC7C,SAAS,SAAS;AAClB,SAAS,gCAAgC;AACzC,SAAS,6BAA6B;AACtC,SAAS,6BAA6B;AACtC,SAAS,uCAAuC;AAyDhD,MAAM,kBAAkB,CAAC,EAAE,UAAU,aAAa;AAClD,MAAM,oBAAoB,CAAC,OAAO,OAAO,OAAO,KAAK;AAErD,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,OAAO,EACJ,OAAO,EACP,KAAK,EACL,IAAI,GAAG,6CAA6C,EACpD,IAAI,KAAK,4CAA4C;AAAA,EACxD,QAAQ,EACL,OAAO,EACP,KAAK,EACL,IAAI,IAAI,6CAA6C,EACrD,SAAS;AAAA,EACZ,eAAe,EACZ,OAAO,EACP,KAAK,EACL,IAAI,KAAK,+CAA+C,EACxD,SAAS;AAAA,EACZ,YAAY,EAAE;AAAA,IACZ,CAAC,MA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,IAAI,MAAS;AAC7E;AAEA,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/core",
|
|
3
|
-
"version": "0.4.9-develop-
|
|
3
|
+
"version": "0.4.9-develop-c7274682b5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -217,10 +217,10 @@
|
|
|
217
217
|
"semver": "^7.6.3"
|
|
218
218
|
},
|
|
219
219
|
"peerDependencies": {
|
|
220
|
-
"@open-mercato/shared": "0.4.9-develop-
|
|
220
|
+
"@open-mercato/shared": "0.4.9-develop-c7274682b5"
|
|
221
221
|
},
|
|
222
222
|
"devDependencies": {
|
|
223
|
-
"@open-mercato/shared": "0.4.9-develop-
|
|
223
|
+
"@open-mercato/shared": "0.4.9-develop-c7274682b5",
|
|
224
224
|
"@testing-library/dom": "^10.4.1",
|
|
225
225
|
"@testing-library/jest-dom": "^6.9.1",
|
|
226
226
|
"@testing-library/react": "^16.3.1",
|
|
@@ -90,8 +90,14 @@ const schema = z.object({
|
|
|
90
90
|
.trim()
|
|
91
91
|
.max(100, 'customers.people.detail.deals.pipelineTooLong')
|
|
92
92
|
.optional(),
|
|
93
|
-
pipelineId: z.
|
|
94
|
-
|
|
93
|
+
pipelineId: z.preprocess(
|
|
94
|
+
(v) => (typeof v === 'string' && !v.trim() ? undefined : v),
|
|
95
|
+
z.string().uuid('customers.people.detail.deals.pipelineIdInvalid').optional(),
|
|
96
|
+
),
|
|
97
|
+
pipelineStageId: z.preprocess(
|
|
98
|
+
(v) => (typeof v === 'string' && !v.trim() ? undefined : v),
|
|
99
|
+
z.string().uuid('customers.people.detail.deals.pipelineStageIdInvalid').optional(),
|
|
100
|
+
),
|
|
95
101
|
valueAmount: z
|
|
96
102
|
.preprocess((value) => {
|
|
97
103
|
if (value === '' || value === null || value === undefined) return undefined
|
|
@@ -616,6 +616,8 @@
|
|
|
616
616
|
"customers.people.detail.deals.loadMore": "Weitere Deals laden",
|
|
617
617
|
"customers.people.detail.deals.loading": "Deals werden geladen…",
|
|
618
618
|
"customers.people.detail.deals.openDeal": "Deal öffnen",
|
|
619
|
+
"customers.people.detail.deals.pipelineIdInvalid": "Wählen Sie eine gültige Pipeline.",
|
|
620
|
+
"customers.people.detail.deals.pipelineStageIdInvalid": "Wählen Sie eine gültige Pipeline-Phase.",
|
|
619
621
|
"customers.people.detail.deals.pipelineTooLong": "Die Pipeline-Phase ist zu lang",
|
|
620
622
|
"customers.people.detail.deals.probabilityInvalid": "Die Wahrscheinlichkeit muss zwischen 0 und 100 liegen",
|
|
621
623
|
"customers.people.detail.deals.save": "Deal speichern (⌘/Ctrl + Enter)",
|
|
@@ -616,6 +616,8 @@
|
|
|
616
616
|
"customers.people.detail.deals.loadMore": "Load more deals",
|
|
617
617
|
"customers.people.detail.deals.loading": "Loading deals…",
|
|
618
618
|
"customers.people.detail.deals.openDeal": "Open deal",
|
|
619
|
+
"customers.people.detail.deals.pipelineIdInvalid": "Select a valid pipeline.",
|
|
620
|
+
"customers.people.detail.deals.pipelineStageIdInvalid": "Select a valid pipeline stage.",
|
|
619
621
|
"customers.people.detail.deals.pipelineTooLong": "Pipeline stage is too long",
|
|
620
622
|
"customers.people.detail.deals.probabilityInvalid": "Probability must be between 0 and 100",
|
|
621
623
|
"customers.people.detail.deals.save": "Save deal (⌘/Ctrl + Enter)",
|
|
@@ -616,6 +616,8 @@
|
|
|
616
616
|
"customers.people.detail.deals.loadMore": "Cargar más oportunidades",
|
|
617
617
|
"customers.people.detail.deals.loading": "Cargando oportunidades…",
|
|
618
618
|
"customers.people.detail.deals.openDeal": "Abrir oportunidad",
|
|
619
|
+
"customers.people.detail.deals.pipelineIdInvalid": "Seleccione un pipeline válido.",
|
|
620
|
+
"customers.people.detail.deals.pipelineStageIdInvalid": "Seleccione una etapa de pipeline válida.",
|
|
619
621
|
"customers.people.detail.deals.pipelineTooLong": "La etapa del pipeline es demasiado larga",
|
|
620
622
|
"customers.people.detail.deals.probabilityInvalid": "La probabilidad debe estar entre 0 y 100",
|
|
621
623
|
"customers.people.detail.deals.save": "Guardar oportunidad (⌘/Ctrl + Enter)",
|
|
@@ -616,6 +616,8 @@
|
|
|
616
616
|
"customers.people.detail.deals.loadMore": "Załaduj więcej szans",
|
|
617
617
|
"customers.people.detail.deals.loading": "Ładowanie szans…",
|
|
618
618
|
"customers.people.detail.deals.openDeal": "Otwórz szansę",
|
|
619
|
+
"customers.people.detail.deals.pipelineIdInvalid": "Wybierz prawidłowy lejek.",
|
|
620
|
+
"customers.people.detail.deals.pipelineStageIdInvalid": "Wybierz prawidłowy etap lejka.",
|
|
619
621
|
"customers.people.detail.deals.pipelineTooLong": "Etap lejka jest za długi",
|
|
620
622
|
"customers.people.detail.deals.probabilityInvalid": "Prawdopodobieństwo musi mieścić się między 0 a 100",
|
|
621
623
|
"customers.people.detail.deals.save": "Zapisz szansę (⌘/Ctrl + Enter)",
|