fix(registry): «№ документа» необязателен при создании документа (#18, 2.4.4) - #22
Merged
MaximilianKaufmannCode merged 1 commit intoJun 30, 2026
Merged
Conversation
… 2.4.4) The "Add document" dialog marked «№ документа» with * and disabled the create button until it was filled — but the field was already optional on the backend (the `number` column is nullable and DocumentCreateRequest.number defaults to None). The requirement lived only in the form. Mirrors the INN-optional fix (2.2.1): align the UI with the backend's intent. - createDocSchema: `number` is now optional (max 500), no longer `.min(1)`. - Empty/whitespace number submits as `null` (document created without a number). - Label drops the `*`; aria-required removed; placeholder notes it's optional. - CreateDocumentPayload.number typed `string | null` to match the backend. - Registry table renders an empty number as «—» (app-wide convention). Company and Document Type stay required (the type drives custom fields and the notification schedule). Frontend-only — backend, schema and contracts unchanged. tsc + biome clean; dialog test updated (blank number now submits with null); no test regressions (8 failing registry tests are the pre-existing useSearch-mock failures, confirmed via git stash). Built + deployed to PreProd (version.json 2.4.4). Closes #18 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Закрывает #18.
Уточнение задачи
Заголовок issue говорит «Тип документа», но уточняющий комментарий со скриншотом (запрошенный владельцем) явно указывает поле «№ документа*». Бэкенд это подтверждает:
numberуже nullable (колонка nullable,DocumentCreateRequest.numberпо умолчаниюNone), аtype_code— обязателен по дизайну (NOT NULL, FK; тип задаёт кастомные поля и расписание уведомлений). Поэтому реализовано необязательное «№ документа» (как и просили в комментарии). Если имелся в виду именно Тип — это отдельная, более крупная задача (затронет модель уведомлений).Проблема
В окне «Добавить документ» номер был помечен
*и блокировал кнопку «Создать документ» до заполнения — хотя на бэкенде поле и так необязательное. Обязательность держалась только на форме (тот же класс, что ИНН в 2.2.1).Исправление (только фронтенд)
createDocSchema:numberтеперь необязателен (max 500), без.min(1).null— документ создаётся без номера.*; убранaria-required; плейсхолдер помечает «необязательно».CreateDocumentPayload.number→string | null(соответствует бэкенду).Компания и Тип документа остаются обязательными.
Проверки
null); 0 регрессий (8 падающих registry-тестов — пред-существующиеuseSearch-mock, подтвержденоgit stash).version.json = 2.4.4, login 200 / API 401.🤖 Generated with Claude Code