diff --git a/src/types/api.ts b/src/types/api.ts index e068d0c..83d2d5d 100644 --- a/src/types/api.ts +++ b/src/types/api.ts @@ -228,10 +228,13 @@ export interface UnresolvedLineOut { line_code_text: string | null; } export interface FailedCheckOut { - column_index: number; + /** -1 в GET …/statement и null в теле 409 — нарушение без колонки (P3-60) */ + column_index: number | null; relation: string; - expected: string; - actual: string; + /** null — цель соотношения не заполнена при непустых членах (P3-30) */ + expected: string | null; + /** допускает null по OpenAPI ядра (P3-30) */ + actual: string | null; codes: string[]; line_ids: string[]; } diff --git a/src/widgets/DocumentReview/ChecksPanel.tsx b/src/widgets/DocumentReview/ChecksPanel.tsx index 4955519..d626ec9 100644 --- a/src/widgets/DocumentReview/ChecksPanel.tsx +++ b/src/widgets/DocumentReview/ChecksPanel.tsx @@ -1,10 +1,7 @@ import { Alert, Button, Input, Modal, Space, Tooltip, Typography } from 'antd'; import { useState } from 'react'; import type { ChecksOut, FailedCheckOut } from '../../types/api'; -import { formatAmount } from '../../utils/money'; - -export const failureText = (f: FailedCheckOut) => - `Колонка ${f.column_index + 1}: ${f.relation} — ожидалось ${formatAmount(f.expected)}, получено ${formatAmount(f.actual)}`; +import { expectedActualText, failureKey, failureText } from './checkText'; type Props = { checks: ChecksOut; @@ -20,7 +17,7 @@ type Props = { const failureList = (list: FailedCheckOut[], onShow?: (key: string) => void) => (
{list.map((f) => ( -
+
{failureText(f)} {onShow && (f.line_ids ?? []).length > 0 && (