@open-mercato/core 0.6.8-develop.7038.1.ea954afd80 → 0.6.8-develop.7040.1.0baee9dad1
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/sales/components/documents/PaymentsSection.js +14 -1
- package/dist/modules/sales/components/documents/PaymentsSection.js.map +2 -2
- package/dist/modules/sales/extension-points.js +1 -0
- package/dist/modules/sales/extension-points.js.map +2 -2
- package/dist/modules/sales/widgets/injection/payment-gateway-status-column/widget.js +10 -2
- package/dist/modules/sales/widgets/injection/payment-gateway-status-column/widget.js.map +2 -2
- package/dist/modules/sales/widgets/injection-table.js +4 -7
- package/dist/modules/sales/widgets/injection-table.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/sales/components/documents/PaymentsSection.tsx +11 -1
- package/src/modules/sales/extension-points.ts +1 -0
- package/src/modules/sales/widgets/injection/payment-gateway-status-column/widget.ts +9 -1
- package/src/modules/sales/widgets/injection-table.ts +4 -7
|
@@ -13,6 +13,7 @@ import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
|
13
13
|
import { useOrganizationScopeDetail } from "@open-mercato/shared/lib/frontend/useOrganizationScope";
|
|
14
14
|
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
15
15
|
import { emitSalesDocumentTotalsRefresh } from "@open-mercato/core/modules/sales/lib/frontend/documentTotalsEvents";
|
|
16
|
+
import { extensionPoints } from "@open-mercato/core/modules/sales/extension-points";
|
|
16
17
|
import { PaymentDialog } from "./PaymentDialog.js";
|
|
17
18
|
import { extractCustomFieldValues } from "./customFieldHelpers.js";
|
|
18
19
|
import { Plus } from "lucide-react";
|
|
@@ -201,6 +202,10 @@ function SalesDocumentPaymentsSection({
|
|
|
201
202
|
cell: ({ row }) => row.original.paymentMethodName ?? "\u2014"
|
|
202
203
|
},
|
|
203
204
|
{
|
|
205
|
+
// Injected columns are placed against `ColumnDef.id` before the table is
|
|
206
|
+
// built, so an accessor-derived id is not yet available: the gateway
|
|
207
|
+
// status widget anchors on this explicit id.
|
|
208
|
+
id: "status",
|
|
204
209
|
accessorKey: "status",
|
|
205
210
|
header: t("sales.documents.payments.status", "Status"),
|
|
206
211
|
cell: ({ row }) => row.original.statusLabel ?? row.original.status ?? "\u2014"
|
|
@@ -265,7 +270,15 @@ function SalesDocumentPaymentsSection({
|
|
|
265
270
|
);
|
|
266
271
|
}
|
|
267
272
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
268
|
-
payments.length ? /* @__PURE__ */ jsx(
|
|
273
|
+
payments.length ? /* @__PURE__ */ jsx(
|
|
274
|
+
DataTable,
|
|
275
|
+
{
|
|
276
|
+
columns,
|
|
277
|
+
data: payments,
|
|
278
|
+
onRowClick: openEditPayment,
|
|
279
|
+
extensionTableId: extensionPoints.hosts.paymentsTable.tableId
|
|
280
|
+
}
|
|
281
|
+
) : /* @__PURE__ */ jsx(
|
|
269
282
|
TabEmptyState,
|
|
270
283
|
{
|
|
271
284
|
title: t("sales.documents.payments.emptyTitle", "No payments yet."),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/modules/sales/components/documents/PaymentsSection.tsx"],
|
|
4
|
-
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport type { LegacyColumnDef as ColumnDef } from '@tanstack/react-table/legacy'\nimport { DataTable } from '@open-mercato/ui/backend/DataTable'\nimport { LoadingMessage, ErrorMessage, TabEmptyState } from '@open-mercato/ui/backend/detail'\nimport { apiCall, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'\nimport { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'\nimport { deleteCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { handleSectionMutationError, readRowUpdatedAt } from './optimisticLock'\nimport type { SectionAction } from '@open-mercato/ui/backend/detail'\nimport { RowActions } from '@open-mercato/ui/backend/RowActions'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useOrganizationScopeDetail } from '@open-mercato/shared/lib/frontend/useOrganizationScope'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { emitSalesDocumentTotalsRefresh } from '@open-mercato/core/modules/sales/lib/frontend/documentTotalsEvents'\nimport { PaymentDialog, type PaymentFormData, type PaymentTotals } from './PaymentDialog'\nimport { extractCustomFieldValues } from './customFieldHelpers'\nimport { Plus } from 'lucide-react'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('sales')\n\ntype PaymentRow = {\n id: string\n updatedAt: string | null\n paymentReference: string | null\n paymentMethodId: string | null\n paymentMethodName: string | null\n status: string | null\n statusEntryId: string | null\n statusLabel: string | null\n amount: number\n currencyCode: string | null\n receivedAt: string | null\n createdAt: string | null\n customValues?: Record<string, unknown> | null\n customFieldSetId?: string | null\n}\n\ntype SalesDocumentPaymentsSectionProps = {\n orderId: string\n currencyCode: string | null | undefined\n organizationId?: string | null\n tenantId?: string | null\n documentUpdatedAt?: string | null\n onActionChange?: (action: SectionAction | null) => void\n onTotalsChange?: () => void\n onPaymentsChange?: (payments: PaymentRow[]) => void\n}\n\nfunction normalizeNumber(value: unknown): number {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string' && value.trim().length) {\n const parsed = Number(value)\n if (!Number.isNaN(parsed)) return parsed\n }\n return 0\n}\n\nfunction formatMoney(value: number, currency: string | null | undefined): string {\n if (!currency || currency.trim().length !== 3) return value.toFixed(2)\n try {\n return new Intl.NumberFormat(undefined, { style: 'currency', currency }).format(value)\n } catch {\n return `${currency.toUpperCase()} ${value.toFixed(2)}`\n }\n}\n\nexport function SalesDocumentPaymentsSection({\n orderId,\n currencyCode,\n organizationId: orgFromProps,\n tenantId: tenantFromProps,\n documentUpdatedAt,\n onActionChange,\n onTotalsChange,\n onPaymentsChange,\n}: SalesDocumentPaymentsSectionProps) {\n const t = useT()\n const { organizationId, tenantId } = useOrganizationScopeDetail()\n const resolvedOrganizationId = orgFromProps ?? organizationId ?? null\n const resolvedTenantId = tenantFromProps ?? tenantId ?? null\n const [payments, setPayments] = React.useState<PaymentRow[]>([])\n const [loading, setLoading] = React.useState(false)\n const [error, setError] = React.useState<string | null>(null)\n const [dialogOpen, setDialogOpen] = React.useState(false)\n const [editingPayment, setEditingPayment] = React.useState<PaymentFormData | null>(null)\n const onPaymentsChangeRef = React.useRef<typeof onPaymentsChange>(onPaymentsChange)\n\n React.useEffect(() => {\n onPaymentsChangeRef.current = onPaymentsChange\n }, [onPaymentsChange])\n\n const addActionLabel = t('sales.documents.payments.add', 'Add payment')\n const editActionLabel = t('sales.documents.payments.edit', 'Edit payment')\n const deleteActionLabel = t('sales.documents.payments.delete', 'Delete payment')\n\n const loadPayments = React.useCallback(async () => {\n setLoading(true)\n setError(null)\n try {\n const params = new URLSearchParams({ page: '1', pageSize: '100', orderId })\n const response = await apiCall<{ items?: Array<Record<string, unknown>> }>(\n `/api/sales/payments?${params.toString()}`,\n undefined,\n { fallback: { items: [] } }\n )\n if (response.ok && Array.isArray(response.result?.items)) {\n const mapped = response.result.items.flatMap<PaymentRow>((item) => {\n if (typeof item.id !== 'string') return []\n const customValues =\n item && typeof item === 'object'\n ? extractCustomFieldValues(item as Record<string, unknown>)\n : {}\n const record: PaymentRow = {\n id: item.id,\n updatedAt: readRowUpdatedAt(item),\n paymentReference: typeof item.payment_reference === 'string' ? item.payment_reference : null,\n paymentMethodId: typeof item.payment_method_id === 'string' ? item.payment_method_id : null,\n paymentMethodName:\n typeof item.payment_method_name === 'string'\n ? item.payment_method_name\n : typeof item.payment_method_code === 'string'\n ? item.payment_method_code\n : null,\n status: typeof item.status === 'string' ? item.status : null,\n statusEntryId:\n typeof (item as any).status_entry_id === 'string'\n ? (item as any).status_entry_id\n : typeof (item as any).statusEntryId === 'string'\n ? (item as any).statusEntryId\n : null,\n statusLabel:\n typeof (item as any).status_label === 'string'\n ? (item as any).status_label\n : typeof (item as any).statusLabel === 'string'\n ? (item as any).statusLabel\n : null,\n amount: normalizeNumber(item.amount),\n currencyCode:\n typeof item.currency_code === 'string'\n ? item.currency_code\n : typeof currencyCode === 'string'\n ? currencyCode\n : null,\n receivedAt: typeof item.received_at === 'string' ? item.received_at : null,\n createdAt: typeof item.created_at === 'string' ? item.created_at : null,\n customValues: Object.keys(customValues).length ? customValues : null,\n customFieldSetId:\n typeof (item as any)?.custom_field_set_id === 'string'\n ? (item as any).custom_field_set_id\n : typeof (item as any)?.customFieldSetId === 'string'\n ? (item as any).customFieldSetId\n : null,\n }\n return [record]\n })\n setPayments(mapped)\n onPaymentsChangeRef.current?.(mapped)\n } else {\n setPayments([])\n onPaymentsChangeRef.current?.([])\n }\n } catch (err) {\n logger.error('sales.payments.list', { err })\n setError(t('sales.documents.payments.errorLoad', 'Failed to load payments.'))\n onPaymentsChangeRef.current?.([])\n } finally {\n setLoading(false)\n }\n }, [currencyCode, orderId, t])\n\n React.useEffect(() => {\n void loadPayments()\n }, [loadPayments])\n\n const openCreate = React.useCallback(() => {\n setEditingPayment(null)\n setDialogOpen(true)\n }, [])\n\n const handleDialogChange = React.useCallback((nextOpen: boolean) => {\n setDialogOpen(nextOpen)\n if (!nextOpen) {\n setEditingPayment(null)\n }\n }, [])\n\n const openEditPayment = React.useCallback(\n (record: PaymentRow) => {\n setEditingPayment({\n id: record.id,\n updatedAt: record.updatedAt ?? null,\n amount: record.amount ?? '',\n paymentMethodId: record.paymentMethodId ?? '',\n paymentReference: record.paymentReference ?? '',\n receivedAt: record.receivedAt ? record.receivedAt.slice(0, 10) : '',\n currencyCode: record.currencyCode ?? currencyCode ?? null,\n statusEntryId: record.statusEntryId ?? null,\n customValues: record.customValues ?? null,\n customFieldSetId: record.customFieldSetId ?? null,\n })\n setDialogOpen(true)\n },\n [currencyCode]\n )\n\n const handlePaymentSaved = React.useCallback(\n async (_totals?: PaymentTotals | null) => {\n onTotalsChange?.()\n await loadPayments()\n emitSalesDocumentTotalsRefresh({ documentId: orderId, kind: 'order' })\n handleDialogChange(false)\n },\n [handleDialogChange, loadPayments, onTotalsChange, orderId]\n )\n\n const handleDelete = React.useCallback(\n async (row: PaymentRow) => {\n try {\n const result = await withScopedApiRequestHeaders(\n // The server guards the PARENT order's aggregate version (Gap A), so\n // send the order's `updated_at`, not the payment row's.\n buildOptimisticLockHeader(documentUpdatedAt ?? undefined),\n () =>\n deleteCrud<{ orderTotals?: PaymentTotals | null }>('sales/payments', {\n body: {\n id: row.id,\n orderId,\n organizationId: resolvedOrganizationId ?? undefined,\n tenantId: resolvedTenantId ?? undefined,\n },\n errorMessage: t('sales.documents.payments.errorDelete', 'Failed to delete payment.'),\n })\n )\n if (result.ok) {\n onTotalsChange?.()\n flash(t('sales.documents.payments.deleted', 'Payment deleted.'), 'success')\n await loadPayments()\n emitSalesDocumentTotalsRefresh({ documentId: orderId, kind: 'order' })\n }\n } catch (err) {\n if (handleSectionMutationError(err, t, () => void loadPayments())) {\n return\n }\n logger.error('sales.payments.delete', { err })\n flash(t('sales.documents.payments.errorDelete', 'Failed to delete payment.'), 'error')\n }\n },\n [documentUpdatedAt, loadPayments, onTotalsChange, orderId, resolvedOrganizationId, resolvedTenantId, t]\n )\n\n React.useEffect(() => {\n if (!onActionChange) return\n onActionChange({\n label: addActionLabel,\n onClick: openCreate,\n disabled: false,\n })\n return () => onActionChange(null)\n }, [addActionLabel, onActionChange, openCreate])\n\n const columns = React.useMemo<ColumnDef<PaymentRow>[]>(\n () => [\n {\n accessorKey: 'paymentReference',\n header: t('sales.documents.payments.reference', 'Reference'),\n cell: ({ row }) => row.original.paymentReference || '\u2014',\n },\n {\n accessorKey: 'paymentMethodName',\n header: t('sales.documents.payments.method', 'Method'),\n cell: ({ row }) => row.original.paymentMethodName ?? '\u2014',\n },\n {\n accessorKey: 'status',\n header: t('sales.documents.payments.status', 'Status'),\n cell: ({ row }) => row.original.statusLabel ?? row.original.status ?? '\u2014',\n },\n {\n accessorKey: 'amount',\n header: t('sales.documents.payments.amount', 'Amount'),\n cell: ({ row }) => formatMoney(row.original.amount, row.original.currencyCode ?? currencyCode),\n },\n {\n accessorKey: 'receivedAt',\n header: t('sales.documents.payments.receivedAt', 'Received'),\n cell: ({ row }) =>\n row.original.receivedAt\n ? new Date(row.original.receivedAt).toLocaleDateString()\n : '\u2014',\n },\n {\n accessorKey: 'createdAt',\n header: t('sales.documents.payments.createdAt', 'Created'),\n cell: ({ row }) =>\n row.original.createdAt ? new Date(row.original.createdAt).toLocaleString() : '\u2014',\n meta: {\n tooltipContent: (row: PaymentRow) =>\n row.createdAt ? new Date(row.createdAt).toLocaleString() : undefined,\n },\n },\n {\n id: 'actions',\n header: '',\n cell: ({ row }) => {\n return (\n <RowActions\n items={[\n { id: 'edit', label: editActionLabel, onSelect: () => openEditPayment(row.original) },\n {\n id: 'delete',\n label: deleteActionLabel,\n destructive: true,\n onSelect: () => void handleDelete(row.original),\n },\n ]}\n />\n )\n },\n },\n ],\n [currencyCode, deleteActionLabel, editActionLabel, handleDelete, openEditPayment, t]\n )\n\n if (loading) {\n return (\n <LoadingMessage\n label={t('sales.documents.payments.loading', 'Loading payments\u2026')}\n className=\"border-0 bg-transparent p-0 py-8 justify-center\"\n />\n )\n }\n\n if (error) {\n return (\n <ErrorMessage\n label={error}\n action={\n <Button variant=\"outline\" size=\"sm\" onClick={() => void loadPayments()}>\n {t('sales.documents.payments.retry', 'Retry')}\n </Button>\n }\n />\n )\n }\n\n return (\n <div className=\"space-y-4\">\n {payments.length ? (\n <DataTable<PaymentRow> columns={columns} data={payments} onRowClick={openEditPayment} />\n ) : (\n <TabEmptyState\n title={t('sales.documents.payments.emptyTitle', 'No payments yet.')}\n description={t(\n 'sales.documents.payments.emptyDescription',\n 'Track received payments to keep outstanding balances up to date.'\n )}\n action={{\n label: addActionLabel,\n onClick: openCreate,\n icon: <Plus className=\"h-4 w-4\" aria-hidden />,\n disabled: loading,\n }}\n />\n )}\n\n <PaymentDialog\n open={dialogOpen}\n onOpenChange={handleDialogChange}\n mode={editingPayment ? 'edit' : 'create'}\n payment={editingPayment}\n currencyCode={editingPayment?.currencyCode ?? currencyCode}\n orderId={orderId}\n organizationId={resolvedOrganizationId}\n tenantId={resolvedTenantId}\n documentUpdatedAt={documentUpdatedAt ?? null}\n onSaved={handlePaymentSaved}\n />\n </div>\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["\"use client\"\n\nimport * as React from 'react'\nimport type { LegacyColumnDef as ColumnDef } from '@tanstack/react-table/legacy'\nimport { DataTable } from '@open-mercato/ui/backend/DataTable'\nimport { LoadingMessage, ErrorMessage, TabEmptyState } from '@open-mercato/ui/backend/detail'\nimport { apiCall, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'\nimport { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'\nimport { deleteCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { handleSectionMutationError, readRowUpdatedAt } from './optimisticLock'\nimport type { SectionAction } from '@open-mercato/ui/backend/detail'\nimport { RowActions } from '@open-mercato/ui/backend/RowActions'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { useOrganizationScopeDetail } from '@open-mercato/shared/lib/frontend/useOrganizationScope'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\nimport { emitSalesDocumentTotalsRefresh } from '@open-mercato/core/modules/sales/lib/frontend/documentTotalsEvents'\nimport { extensionPoints } from '@open-mercato/core/modules/sales/extension-points'\nimport { PaymentDialog, type PaymentFormData, type PaymentTotals } from './PaymentDialog'\nimport { extractCustomFieldValues } from './customFieldHelpers'\nimport { Plus } from 'lucide-react'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('sales')\n\ntype PaymentRow = {\n id: string\n updatedAt: string | null\n paymentReference: string | null\n paymentMethodId: string | null\n paymentMethodName: string | null\n status: string | null\n statusEntryId: string | null\n statusLabel: string | null\n amount: number\n currencyCode: string | null\n receivedAt: string | null\n createdAt: string | null\n customValues?: Record<string, unknown> | null\n customFieldSetId?: string | null\n}\n\ntype SalesDocumentPaymentsSectionProps = {\n orderId: string\n currencyCode: string | null | undefined\n organizationId?: string | null\n tenantId?: string | null\n documentUpdatedAt?: string | null\n onActionChange?: (action: SectionAction | null) => void\n onTotalsChange?: () => void\n onPaymentsChange?: (payments: PaymentRow[]) => void\n}\n\nfunction normalizeNumber(value: unknown): number {\n if (typeof value === 'number' && Number.isFinite(value)) return value\n if (typeof value === 'string' && value.trim().length) {\n const parsed = Number(value)\n if (!Number.isNaN(parsed)) return parsed\n }\n return 0\n}\n\nfunction formatMoney(value: number, currency: string | null | undefined): string {\n if (!currency || currency.trim().length !== 3) return value.toFixed(2)\n try {\n return new Intl.NumberFormat(undefined, { style: 'currency', currency }).format(value)\n } catch {\n return `${currency.toUpperCase()} ${value.toFixed(2)}`\n }\n}\n\nexport function SalesDocumentPaymentsSection({\n orderId,\n currencyCode,\n organizationId: orgFromProps,\n tenantId: tenantFromProps,\n documentUpdatedAt,\n onActionChange,\n onTotalsChange,\n onPaymentsChange,\n}: SalesDocumentPaymentsSectionProps) {\n const t = useT()\n const { organizationId, tenantId } = useOrganizationScopeDetail()\n const resolvedOrganizationId = orgFromProps ?? organizationId ?? null\n const resolvedTenantId = tenantFromProps ?? tenantId ?? null\n const [payments, setPayments] = React.useState<PaymentRow[]>([])\n const [loading, setLoading] = React.useState(false)\n const [error, setError] = React.useState<string | null>(null)\n const [dialogOpen, setDialogOpen] = React.useState(false)\n const [editingPayment, setEditingPayment] = React.useState<PaymentFormData | null>(null)\n const onPaymentsChangeRef = React.useRef<typeof onPaymentsChange>(onPaymentsChange)\n\n React.useEffect(() => {\n onPaymentsChangeRef.current = onPaymentsChange\n }, [onPaymentsChange])\n\n const addActionLabel = t('sales.documents.payments.add', 'Add payment')\n const editActionLabel = t('sales.documents.payments.edit', 'Edit payment')\n const deleteActionLabel = t('sales.documents.payments.delete', 'Delete payment')\n\n const loadPayments = React.useCallback(async () => {\n setLoading(true)\n setError(null)\n try {\n const params = new URLSearchParams({ page: '1', pageSize: '100', orderId })\n const response = await apiCall<{ items?: Array<Record<string, unknown>> }>(\n `/api/sales/payments?${params.toString()}`,\n undefined,\n { fallback: { items: [] } }\n )\n if (response.ok && Array.isArray(response.result?.items)) {\n const mapped = response.result.items.flatMap<PaymentRow>((item) => {\n if (typeof item.id !== 'string') return []\n const customValues =\n item && typeof item === 'object'\n ? extractCustomFieldValues(item as Record<string, unknown>)\n : {}\n const record: PaymentRow = {\n id: item.id,\n updatedAt: readRowUpdatedAt(item),\n paymentReference: typeof item.payment_reference === 'string' ? item.payment_reference : null,\n paymentMethodId: typeof item.payment_method_id === 'string' ? item.payment_method_id : null,\n paymentMethodName:\n typeof item.payment_method_name === 'string'\n ? item.payment_method_name\n : typeof item.payment_method_code === 'string'\n ? item.payment_method_code\n : null,\n status: typeof item.status === 'string' ? item.status : null,\n statusEntryId:\n typeof (item as any).status_entry_id === 'string'\n ? (item as any).status_entry_id\n : typeof (item as any).statusEntryId === 'string'\n ? (item as any).statusEntryId\n : null,\n statusLabel:\n typeof (item as any).status_label === 'string'\n ? (item as any).status_label\n : typeof (item as any).statusLabel === 'string'\n ? (item as any).statusLabel\n : null,\n amount: normalizeNumber(item.amount),\n currencyCode:\n typeof item.currency_code === 'string'\n ? item.currency_code\n : typeof currencyCode === 'string'\n ? currencyCode\n : null,\n receivedAt: typeof item.received_at === 'string' ? item.received_at : null,\n createdAt: typeof item.created_at === 'string' ? item.created_at : null,\n customValues: Object.keys(customValues).length ? customValues : null,\n customFieldSetId:\n typeof (item as any)?.custom_field_set_id === 'string'\n ? (item as any).custom_field_set_id\n : typeof (item as any)?.customFieldSetId === 'string'\n ? (item as any).customFieldSetId\n : null,\n }\n return [record]\n })\n setPayments(mapped)\n onPaymentsChangeRef.current?.(mapped)\n } else {\n setPayments([])\n onPaymentsChangeRef.current?.([])\n }\n } catch (err) {\n logger.error('sales.payments.list', { err })\n setError(t('sales.documents.payments.errorLoad', 'Failed to load payments.'))\n onPaymentsChangeRef.current?.([])\n } finally {\n setLoading(false)\n }\n }, [currencyCode, orderId, t])\n\n React.useEffect(() => {\n void loadPayments()\n }, [loadPayments])\n\n const openCreate = React.useCallback(() => {\n setEditingPayment(null)\n setDialogOpen(true)\n }, [])\n\n const handleDialogChange = React.useCallback((nextOpen: boolean) => {\n setDialogOpen(nextOpen)\n if (!nextOpen) {\n setEditingPayment(null)\n }\n }, [])\n\n const openEditPayment = React.useCallback(\n (record: PaymentRow) => {\n setEditingPayment({\n id: record.id,\n updatedAt: record.updatedAt ?? null,\n amount: record.amount ?? '',\n paymentMethodId: record.paymentMethodId ?? '',\n paymentReference: record.paymentReference ?? '',\n receivedAt: record.receivedAt ? record.receivedAt.slice(0, 10) : '',\n currencyCode: record.currencyCode ?? currencyCode ?? null,\n statusEntryId: record.statusEntryId ?? null,\n customValues: record.customValues ?? null,\n customFieldSetId: record.customFieldSetId ?? null,\n })\n setDialogOpen(true)\n },\n [currencyCode]\n )\n\n const handlePaymentSaved = React.useCallback(\n async (_totals?: PaymentTotals | null) => {\n onTotalsChange?.()\n await loadPayments()\n emitSalesDocumentTotalsRefresh({ documentId: orderId, kind: 'order' })\n handleDialogChange(false)\n },\n [handleDialogChange, loadPayments, onTotalsChange, orderId]\n )\n\n const handleDelete = React.useCallback(\n async (row: PaymentRow) => {\n try {\n const result = await withScopedApiRequestHeaders(\n // The server guards the PARENT order's aggregate version (Gap A), so\n // send the order's `updated_at`, not the payment row's.\n buildOptimisticLockHeader(documentUpdatedAt ?? undefined),\n () =>\n deleteCrud<{ orderTotals?: PaymentTotals | null }>('sales/payments', {\n body: {\n id: row.id,\n orderId,\n organizationId: resolvedOrganizationId ?? undefined,\n tenantId: resolvedTenantId ?? undefined,\n },\n errorMessage: t('sales.documents.payments.errorDelete', 'Failed to delete payment.'),\n })\n )\n if (result.ok) {\n onTotalsChange?.()\n flash(t('sales.documents.payments.deleted', 'Payment deleted.'), 'success')\n await loadPayments()\n emitSalesDocumentTotalsRefresh({ documentId: orderId, kind: 'order' })\n }\n } catch (err) {\n if (handleSectionMutationError(err, t, () => void loadPayments())) {\n return\n }\n logger.error('sales.payments.delete', { err })\n flash(t('sales.documents.payments.errorDelete', 'Failed to delete payment.'), 'error')\n }\n },\n [documentUpdatedAt, loadPayments, onTotalsChange, orderId, resolvedOrganizationId, resolvedTenantId, t]\n )\n\n React.useEffect(() => {\n if (!onActionChange) return\n onActionChange({\n label: addActionLabel,\n onClick: openCreate,\n disabled: false,\n })\n return () => onActionChange(null)\n }, [addActionLabel, onActionChange, openCreate])\n\n const columns = React.useMemo<ColumnDef<PaymentRow>[]>(\n () => [\n {\n accessorKey: 'paymentReference',\n header: t('sales.documents.payments.reference', 'Reference'),\n cell: ({ row }) => row.original.paymentReference || '\u2014',\n },\n {\n accessorKey: 'paymentMethodName',\n header: t('sales.documents.payments.method', 'Method'),\n cell: ({ row }) => row.original.paymentMethodName ?? '\u2014',\n },\n {\n // Injected columns are placed against `ColumnDef.id` before the table is\n // built, so an accessor-derived id is not yet available: the gateway\n // status widget anchors on this explicit id.\n id: 'status',\n accessorKey: 'status',\n header: t('sales.documents.payments.status', 'Status'),\n cell: ({ row }) => row.original.statusLabel ?? row.original.status ?? '\u2014',\n },\n {\n accessorKey: 'amount',\n header: t('sales.documents.payments.amount', 'Amount'),\n cell: ({ row }) => formatMoney(row.original.amount, row.original.currencyCode ?? currencyCode),\n },\n {\n accessorKey: 'receivedAt',\n header: t('sales.documents.payments.receivedAt', 'Received'),\n cell: ({ row }) =>\n row.original.receivedAt\n ? new Date(row.original.receivedAt).toLocaleDateString()\n : '\u2014',\n },\n {\n accessorKey: 'createdAt',\n header: t('sales.documents.payments.createdAt', 'Created'),\n cell: ({ row }) =>\n row.original.createdAt ? new Date(row.original.createdAt).toLocaleString() : '\u2014',\n meta: {\n tooltipContent: (row: PaymentRow) =>\n row.createdAt ? new Date(row.createdAt).toLocaleString() : undefined,\n },\n },\n {\n id: 'actions',\n header: '',\n cell: ({ row }) => {\n return (\n <RowActions\n items={[\n { id: 'edit', label: editActionLabel, onSelect: () => openEditPayment(row.original) },\n {\n id: 'delete',\n label: deleteActionLabel,\n destructive: true,\n onSelect: () => void handleDelete(row.original),\n },\n ]}\n />\n )\n },\n },\n ],\n [currencyCode, deleteActionLabel, editActionLabel, handleDelete, openEditPayment, t]\n )\n\n if (loading) {\n return (\n <LoadingMessage\n label={t('sales.documents.payments.loading', 'Loading payments\u2026')}\n className=\"border-0 bg-transparent p-0 py-8 justify-center\"\n />\n )\n }\n\n if (error) {\n return (\n <ErrorMessage\n label={error}\n action={\n <Button variant=\"outline\" size=\"sm\" onClick={() => void loadPayments()}>\n {t('sales.documents.payments.retry', 'Retry')}\n </Button>\n }\n />\n )\n }\n\n return (\n <div className=\"space-y-4\">\n {payments.length ? (\n <DataTable<PaymentRow>\n columns={columns}\n data={payments}\n onRowClick={openEditPayment}\n extensionTableId={extensionPoints.hosts.paymentsTable.tableId}\n />\n ) : (\n <TabEmptyState\n title={t('sales.documents.payments.emptyTitle', 'No payments yet.')}\n description={t(\n 'sales.documents.payments.emptyDescription',\n 'Track received payments to keep outstanding balances up to date.'\n )}\n action={{\n label: addActionLabel,\n onClick: openCreate,\n icon: <Plus className=\"h-4 w-4\" aria-hidden />,\n disabled: loading,\n }}\n />\n )}\n\n <PaymentDialog\n open={dialogOpen}\n onOpenChange={handleDialogChange}\n mode={editingPayment ? 'edit' : 'create'}\n payment={editingPayment}\n currencyCode={editingPayment?.currencyCode ?? currencyCode}\n orderId={orderId}\n organizationId={resolvedOrganizationId}\n tenantId={resolvedTenantId}\n documentUpdatedAt={documentUpdatedAt ?? null}\n onSaved={handlePaymentSaved}\n />\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AA0TY,cAyCR,YAzCQ;AAxTZ,YAAY,WAAW;AAEvB,SAAS,iBAAiB;AAC1B,SA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ableId: "sales.orders", source: "components/documents/SalesDocumentsTable.tsx" }),
|
|
6
6
|
quotesTable: dataTableExtensionHost({ tableId: "sales.quotes", source: "components/documents/SalesDocumentsTable.tsx" }),
|
|
7
|
+
paymentsTable: dataTableExtensionHost({ tableId: "sales.payments", source: "components/documents/PaymentsSection.tsx" }),
|
|
7
8
|
orderItemColumns: injectionExtensionHost({
|
|
8
9
|
family: "detail",
|
|
9
10
|
spotId: "data-table:sales.order.items:columns",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/modules/sales/extension-points.ts"],
|
|
4
|
-
"sourcesContent": ["import { dataTableExtensionHost, defineModuleExtensionPoints, injectionExtensionHost } from '@open-mercato/shared/modules/widgets/extension-points'\n\nexport const extensionPoints = defineModuleExtensionPoints({\n moduleId: 'sales',\n hosts: {\n ordersTable: dataTableExtensionHost({ tableId: 'sales.orders', source: 'components/documents/SalesDocumentsTable.tsx' }),\n quotesTable: dataTableExtensionHost({ tableId: 'sales.quotes', source: 'components/documents/SalesDocumentsTable.tsx' }),\n orderItemColumns: injectionExtensionHost({\n family: 'detail',\n spotId: 'data-table:sales.order.items:columns',\n supported: ['column-widget'],\n source: 'components/documents/ItemsSection.tsx',\n }),\n orderShipping: injectionExtensionHost({\n family: 'detail',\n spotId: 'detail:sales.order:shipping',\n supported: ['render-widget'],\n source: 'backend/sales/documents/[id]/page.tsx',\n }),\n documentDetail: injectionExtensionHost({\n family: 'detail',\n pattern: 'sales.document.detail.{kind}:{surface}',\n parameters: {\n kind: { source: 'SalesDocumentKind', pattern: '^(order|quote)$' },\n surface: { source: 'host declaration', pattern: '^(tabs|details)$' },\n },\n supported: ['render-widget'],\n source: 'backend/sales/documents/[id]/page.tsx',\n }),\n },\n})\n\nexport default extensionPoints\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,wBAAwB,6BAA6B,8BAA8B;AAErF,MAAM,kBAAkB,4BAA4B;AAAA,EACzD,UAAU;AAAA,EACV,OAAO;AAAA,IACL,aAAa,uBAAuB,EAAE,SAAS,gBAAgB,QAAQ,+CAA+C,CAAC;AAAA,IACvH,aAAa,uBAAuB,EAAE,SAAS,gBAAgB,QAAQ,+CAA+C,CAAC;AAAA,IACvH,kBAAkB,uBAAuB;AAAA,MACvC,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW,CAAC,eAAe;AAAA,MAC3B,QAAQ;AAAA,IACV,CAAC;AAAA,IACD,eAAe,uBAAuB;AAAA,MACpC,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW,CAAC,eAAe;AAAA,MAC3B,QAAQ;AAAA,IACV,CAAC;AAAA,IACD,gBAAgB,uBAAuB;AAAA,MACrC,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,YAAY;AAAA,QACV,MAAM,EAAE,QAAQ,qBAAqB,SAAS,kBAAkB;AAAA,QAChE,SAAS,EAAE,QAAQ,oBAAoB,SAAS,mBAAmB;AAAA,MACrE;AAAA,MACA,WAAW,CAAC,eAAe;AAAA,MAC3B,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AACF,CAAC;AAED,IAAO,2BAAQ;",
|
|
4
|
+
"sourcesContent": ["import { dataTableExtensionHost, defineModuleExtensionPoints, injectionExtensionHost } from '@open-mercato/shared/modules/widgets/extension-points'\n\nexport const extensionPoints = defineModuleExtensionPoints({\n moduleId: 'sales',\n hosts: {\n ordersTable: dataTableExtensionHost({ tableId: 'sales.orders', source: 'components/documents/SalesDocumentsTable.tsx' }),\n quotesTable: dataTableExtensionHost({ tableId: 'sales.quotes', source: 'components/documents/SalesDocumentsTable.tsx' }),\n paymentsTable: dataTableExtensionHost({ tableId: 'sales.payments', source: 'components/documents/PaymentsSection.tsx' }),\n orderItemColumns: injectionExtensionHost({\n family: 'detail',\n spotId: 'data-table:sales.order.items:columns',\n supported: ['column-widget'],\n source: 'components/documents/ItemsSection.tsx',\n }),\n orderShipping: injectionExtensionHost({\n family: 'detail',\n spotId: 'detail:sales.order:shipping',\n supported: ['render-widget'],\n source: 'backend/sales/documents/[id]/page.tsx',\n }),\n documentDetail: injectionExtensionHost({\n family: 'detail',\n pattern: 'sales.document.detail.{kind}:{surface}',\n parameters: {\n kind: { source: 'SalesDocumentKind', pattern: '^(order|quote)$' },\n surface: { source: 'host declaration', pattern: '^(tabs|details)$' },\n },\n supported: ['render-widget'],\n source: 'backend/sales/documents/[id]/page.tsx',\n }),\n },\n})\n\nexport default extensionPoints\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,wBAAwB,6BAA6B,8BAA8B;AAErF,MAAM,kBAAkB,4BAA4B;AAAA,EACzD,UAAU;AAAA,EACV,OAAO;AAAA,IACL,aAAa,uBAAuB,EAAE,SAAS,gBAAgB,QAAQ,+CAA+C,CAAC;AAAA,IACvH,aAAa,uBAAuB,EAAE,SAAS,gBAAgB,QAAQ,+CAA+C,CAAC;AAAA,IACvH,eAAe,uBAAuB,EAAE,SAAS,kBAAkB,QAAQ,2CAA2C,CAAC;AAAA,IACvH,kBAAkB,uBAAuB;AAAA,MACvC,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW,CAAC,eAAe;AAAA,MAC3B,QAAQ;AAAA,IACV,CAAC;AAAA,IACD,eAAe,uBAAuB;AAAA,MACpC,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,WAAW,CAAC,eAAe;AAAA,MAC3B,QAAQ;AAAA,IACV,CAAC;AAAA,IACD,gBAAgB,uBAAuB;AAAA,MACrC,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,YAAY;AAAA,QACV,MAAM,EAAE,QAAQ,qBAAqB,SAAS,kBAAkB;AAAA,QAChE,SAAS,EAAE,QAAQ,oBAAoB,SAAS,mBAAmB;AAAA,MACrE;AAAA,MACA,WAAW,CAAC,eAAe;AAAA,MAC3B,QAAQ;AAAA,IACV,CAAC;AAAA,EACH;AACF,CAAC;AAED,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
+
import { InjectionPosition } from "@open-mercato/shared/modules/widgets/injection-position";
|
|
1
2
|
const widget = {
|
|
2
3
|
metadata: {
|
|
3
4
|
id: "sales.injection.payment-gateway-status-column",
|
|
4
|
-
priority: 50
|
|
5
|
+
priority: 50,
|
|
6
|
+
features: ["payment_gateways.view"],
|
|
7
|
+
// The header key and every value this column can ever show come from
|
|
8
|
+
// `payment_gateways`; without that module the column has no data source and
|
|
9
|
+
// its header would degrade to the raw translation key.
|
|
10
|
+
requiredModules: ["payment_gateways"]
|
|
5
11
|
},
|
|
6
12
|
columns: [
|
|
7
13
|
{
|
|
8
14
|
id: "gateway_status",
|
|
9
15
|
header: "payment_gateways.column.gatewayStatus",
|
|
10
16
|
accessorKey: "_gateway.unifiedStatus",
|
|
17
|
+
size: 120,
|
|
11
18
|
sortable: false,
|
|
19
|
+
placement: { position: InjectionPosition.After, relativeTo: "status" },
|
|
12
20
|
cell: ({ getValue }) => {
|
|
13
21
|
const value = getValue();
|
|
14
|
-
return typeof value === "string" && value.trim().length > 0 ? value : "
|
|
22
|
+
return typeof value === "string" && value.trim().length > 0 ? value : "\u2014";
|
|
15
23
|
}
|
|
16
24
|
}
|
|
17
25
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/sales/widgets/injection/payment-gateway-status-column/widget.ts"],
|
|
4
|
-
"sourcesContent": ["import type { InjectionColumnWidget } from '@open-mercato/shared/modules/widgets/injection'\n\nconst widget: InjectionColumnWidget = {\n metadata: {\n id: 'sales.injection.payment-gateway-status-column',\n priority: 50,\n },\n columns: [\n {\n id: 'gateway_status',\n header: 'payment_gateways.column.gatewayStatus',\n accessorKey: '_gateway.unifiedStatus',\n sortable: false,\n cell: ({ getValue }) => {\n const value = getValue()\n return typeof value === 'string' && value.trim().length > 0 ? value : '
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { InjectionColumnWidget } from '@open-mercato/shared/modules/widgets/injection'\nimport { InjectionPosition } from '@open-mercato/shared/modules/widgets/injection-position'\n\nconst widget: InjectionColumnWidget = {\n metadata: {\n id: 'sales.injection.payment-gateway-status-column',\n priority: 50,\n features: ['payment_gateways.view'],\n // The header key and every value this column can ever show come from\n // `payment_gateways`; without that module the column has no data source and\n // its header would degrade to the raw translation key.\n requiredModules: ['payment_gateways'],\n },\n columns: [\n {\n id: 'gateway_status',\n header: 'payment_gateways.column.gatewayStatus',\n accessorKey: '_gateway.unifiedStatus',\n size: 120,\n sortable: false,\n placement: { position: InjectionPosition.After, relativeTo: 'status' },\n cell: ({ getValue }) => {\n const value = getValue()\n return typeof value === 'string' && value.trim().length > 0 ? value : '\u2014'\n },\n },\n ],\n}\n\nexport default widget\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,yBAAyB;AAElC,MAAM,SAAgC;AAAA,EACpC,UAAU;AAAA,IACR,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,UAAU,CAAC,uBAAuB;AAAA;AAAA;AAAA;AAAA,IAIlC,iBAAiB,CAAC,kBAAkB;AAAA,EACtC;AAAA,EACA,SAAS;AAAA,IACP;AAAA,MACE,IAAI;AAAA,MACJ,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,MAAM;AAAA,MACN,UAAU;AAAA,MACV,WAAW,EAAE,UAAU,kBAAkB,OAAO,YAAY,SAAS;AAAA,MACrE,MAAM,CAAC,EAAE,SAAS,MAAM;AACtB,cAAM,QAAQ,SAAS;AACvB,eAAO,OAAO,UAAU,YAAY,MAAM,KAAK,EAAE,SAAS,IAAI,QAAQ;AAAA,MACxE;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -15,13 +15,10 @@ const injectionTable = {
|
|
|
15
15
|
priority: 50
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// '__disabled__:columns'. The widget itself is still registered and is now UNBOUND: giving
|
|
23
|
-
// the payments table a real tableId so the gateway-status column finally renders is a sales
|
|
24
|
-
// feature gap, tracked in #5142 rather than silently reintroduced here.
|
|
18
|
+
"data-table:sales.payments:columns": {
|
|
19
|
+
widgetId: "sales.injection.payment-gateway-status-column",
|
|
20
|
+
priority: 50
|
|
21
|
+
},
|
|
25
22
|
"crud-form:sales.payment_method:fields": {
|
|
26
23
|
widgetId: "sales.injection.payment-gateway-config-field",
|
|
27
24
|
priority: 40
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/modules/sales/widgets/injection-table.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ModuleInjectionTable } from '@open-mercato/shared/modules/widgets/injection'\n\nexport const injectionTable: ModuleInjectionTable = {\n 'sales.document.detail.order:tabs': [\n {\n widgetId: 'sales.injection.document-history',\n kind: 'tab',\n groupLabel: 'sales.documents.history.tabLabel',\n priority: 50,\n },\n ],\n 'sales.document.detail.quote:tabs': [\n {\n widgetId: 'sales.injection.document-history',\n kind: 'tab',\n groupLabel: 'sales.documents.history.tabLabel',\n priority: 50,\n },\n ],\n
|
|
5
|
-
"mappings": "AAEO,MAAM,iBAAuC;AAAA,EAClD,oCAAoC;AAAA,IAClC;AAAA,MACE,UAAU;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,oCAAoC;AAAA,IAClC;AAAA,MACE,UAAU;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["import type { ModuleInjectionTable } from '@open-mercato/shared/modules/widgets/injection'\n\nexport const injectionTable: ModuleInjectionTable = {\n 'sales.document.detail.order:tabs': [\n {\n widgetId: 'sales.injection.document-history',\n kind: 'tab',\n groupLabel: 'sales.documents.history.tabLabel',\n priority: 50,\n },\n ],\n 'sales.document.detail.quote:tabs': [\n {\n widgetId: 'sales.injection.document-history',\n kind: 'tab',\n groupLabel: 'sales.documents.history.tabLabel',\n priority: 50,\n },\n ],\n 'data-table:sales.payments:columns': {\n widgetId: 'sales.injection.payment-gateway-status-column',\n priority: 50,\n },\n 'crud-form:sales.payment_method:fields': {\n widgetId: 'sales.injection.payment-gateway-config-field',\n priority: 40,\n },\n 'crud-form:sales.sales_payment_method:fields': {\n widgetId: 'sales.injection.payment-gateway-config-field',\n priority: 40,\n },\n 'detail:sales.order:stage-bar': [],\n 'detail:sales.order:closure': [],\n 'detail:sales.quote:stage-bar': [],\n 'detail:sales.quote:closure': [],\n}\n\nexport default injectionTable\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,iBAAuC;AAAA,EAClD,oCAAoC;AAAA,IAClC;AAAA,MACE,UAAU;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,oCAAoC;AAAA,IAClC;AAAA,MACE,UAAU;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,qCAAqC;AAAA,IACnC,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,yCAAyC;AAAA,IACvC,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,+CAA+C;AAAA,IAC7C,UAAU;AAAA,IACV,UAAU;AAAA,EACZ;AAAA,EACA,gCAAgC,CAAC;AAAA,EACjC,8BAA8B,CAAC;AAAA,EAC/B,gCAAgC,CAAC;AAAA,EACjC,8BAA8B,CAAC;AACjC;AAEA,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/core",
|
|
3
|
-
"version": "0.6.8-develop.
|
|
3
|
+
"version": "0.6.8-develop.7040.1.0baee9dad1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -252,16 +252,16 @@
|
|
|
252
252
|
"zod": "^4.4.3"
|
|
253
253
|
},
|
|
254
254
|
"peerDependencies": {
|
|
255
|
-
"@open-mercato/ai-assistant": "0.6.8-develop.
|
|
256
|
-
"@open-mercato/shared": "0.6.8-develop.
|
|
257
|
-
"@open-mercato/ui": "0.6.8-develop.
|
|
255
|
+
"@open-mercato/ai-assistant": "0.6.8-develop.7040.1.0baee9dad1",
|
|
256
|
+
"@open-mercato/shared": "0.6.8-develop.7040.1.0baee9dad1",
|
|
257
|
+
"@open-mercato/ui": "0.6.8-develop.7040.1.0baee9dad1",
|
|
258
258
|
"react": "^19.0.0",
|
|
259
259
|
"react-dom": "^19.0.0"
|
|
260
260
|
},
|
|
261
261
|
"devDependencies": {
|
|
262
|
-
"@open-mercato/ai-assistant": "0.6.8-develop.
|
|
263
|
-
"@open-mercato/shared": "0.6.8-develop.
|
|
264
|
-
"@open-mercato/ui": "0.6.8-develop.
|
|
262
|
+
"@open-mercato/ai-assistant": "0.6.8-develop.7040.1.0baee9dad1",
|
|
263
|
+
"@open-mercato/shared": "0.6.8-develop.7040.1.0baee9dad1",
|
|
264
|
+
"@open-mercato/ui": "0.6.8-develop.7040.1.0baee9dad1",
|
|
265
265
|
"@testing-library/dom": "^10.4.1",
|
|
266
266
|
"@testing-library/jest-dom": "^7.0.0",
|
|
267
267
|
"@testing-library/react": "^16.3.1",
|
|
@@ -15,6 +15,7 @@ import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
|
15
15
|
import { useOrganizationScopeDetail } from '@open-mercato/shared/lib/frontend/useOrganizationScope'
|
|
16
16
|
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
17
17
|
import { emitSalesDocumentTotalsRefresh } from '@open-mercato/core/modules/sales/lib/frontend/documentTotalsEvents'
|
|
18
|
+
import { extensionPoints } from '@open-mercato/core/modules/sales/extension-points'
|
|
18
19
|
import { PaymentDialog, type PaymentFormData, type PaymentTotals } from './PaymentDialog'
|
|
19
20
|
import { extractCustomFieldValues } from './customFieldHelpers'
|
|
20
21
|
import { Plus } from 'lucide-react'
|
|
@@ -275,6 +276,10 @@ export function SalesDocumentPaymentsSection({
|
|
|
275
276
|
cell: ({ row }) => row.original.paymentMethodName ?? '—',
|
|
276
277
|
},
|
|
277
278
|
{
|
|
279
|
+
// Injected columns are placed against `ColumnDef.id` before the table is
|
|
280
|
+
// built, so an accessor-derived id is not yet available: the gateway
|
|
281
|
+
// status widget anchors on this explicit id.
|
|
282
|
+
id: 'status',
|
|
278
283
|
accessorKey: 'status',
|
|
279
284
|
header: t('sales.documents.payments.status', 'Status'),
|
|
280
285
|
cell: ({ row }) => row.original.statusLabel ?? row.original.status ?? '—',
|
|
@@ -350,7 +355,12 @@ export function SalesDocumentPaymentsSection({
|
|
|
350
355
|
return (
|
|
351
356
|
<div className="space-y-4">
|
|
352
357
|
{payments.length ? (
|
|
353
|
-
<DataTable<PaymentRow>
|
|
358
|
+
<DataTable<PaymentRow>
|
|
359
|
+
columns={columns}
|
|
360
|
+
data={payments}
|
|
361
|
+
onRowClick={openEditPayment}
|
|
362
|
+
extensionTableId={extensionPoints.hosts.paymentsTable.tableId}
|
|
363
|
+
/>
|
|
354
364
|
) : (
|
|
355
365
|
<TabEmptyState
|
|
356
366
|
title={t('sales.documents.payments.emptyTitle', 'No payments yet.')}
|
|
@@ -5,6 +5,7 @@ export const extensionPoints = defineModuleExtensionPoints({
|
|
|
5
5
|
hosts: {
|
|
6
6
|
ordersTable: dataTableExtensionHost({ tableId: 'sales.orders', source: 'components/documents/SalesDocumentsTable.tsx' }),
|
|
7
7
|
quotesTable: dataTableExtensionHost({ tableId: 'sales.quotes', source: 'components/documents/SalesDocumentsTable.tsx' }),
|
|
8
|
+
paymentsTable: dataTableExtensionHost({ tableId: 'sales.payments', source: 'components/documents/PaymentsSection.tsx' }),
|
|
8
9
|
orderItemColumns: injectionExtensionHost({
|
|
9
10
|
family: 'detail',
|
|
10
11
|
spotId: 'data-table:sales.order.items:columns',
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import type { InjectionColumnWidget } from '@open-mercato/shared/modules/widgets/injection'
|
|
2
|
+
import { InjectionPosition } from '@open-mercato/shared/modules/widgets/injection-position'
|
|
2
3
|
|
|
3
4
|
const widget: InjectionColumnWidget = {
|
|
4
5
|
metadata: {
|
|
5
6
|
id: 'sales.injection.payment-gateway-status-column',
|
|
6
7
|
priority: 50,
|
|
8
|
+
features: ['payment_gateways.view'],
|
|
9
|
+
// The header key and every value this column can ever show come from
|
|
10
|
+
// `payment_gateways`; without that module the column has no data source and
|
|
11
|
+
// its header would degrade to the raw translation key.
|
|
12
|
+
requiredModules: ['payment_gateways'],
|
|
7
13
|
},
|
|
8
14
|
columns: [
|
|
9
15
|
{
|
|
10
16
|
id: 'gateway_status',
|
|
11
17
|
header: 'payment_gateways.column.gatewayStatus',
|
|
12
18
|
accessorKey: '_gateway.unifiedStatus',
|
|
19
|
+
size: 120,
|
|
13
20
|
sortable: false,
|
|
21
|
+
placement: { position: InjectionPosition.After, relativeTo: 'status' },
|
|
14
22
|
cell: ({ getValue }) => {
|
|
15
23
|
const value = getValue()
|
|
16
|
-
return typeof value === 'string' && value.trim().length > 0 ? value : '
|
|
24
|
+
return typeof value === 'string' && value.trim().length > 0 ? value : '—'
|
|
17
25
|
},
|
|
18
26
|
},
|
|
19
27
|
],
|
|
@@ -17,13 +17,10 @@ export const injectionTable: ModuleInjectionTable = {
|
|
|
17
17
|
priority: 50,
|
|
18
18
|
},
|
|
19
19
|
],
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// '__disabled__:columns'. The widget itself is still registered and is now UNBOUND: giving
|
|
25
|
-
// the payments table a real tableId so the gateway-status column finally renders is a sales
|
|
26
|
-
// feature gap, tracked in #5142 rather than silently reintroduced here.
|
|
20
|
+
'data-table:sales.payments:columns': {
|
|
21
|
+
widgetId: 'sales.injection.payment-gateway-status-column',
|
|
22
|
+
priority: 50,
|
|
23
|
+
},
|
|
27
24
|
'crud-form:sales.payment_method:fields': {
|
|
28
25
|
widgetId: 'sales.injection.payment-gateway-config-field',
|
|
29
26
|
priority: 40,
|