-
Notifications
You must be signed in to change notification settings - Fork 25
feat: Добавлена поддержка CodeSeries и CheckUnique в Планы видов характеристик и Планы счетов #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Добавлена поддержка CodeSeries и CheckUnique в Планы видов характеристик и Планы счетов #551
Conversation
…counts и ChartOfCharacteristicTypes Добавлены поля для управления проверкой уникальности кода в классах ChartOfAccounts и ChartOfCharacteristicTypes: - checkUnique: определяет, нужно ли проверять уникальность кода - codeSeries: определяет область действия уникальности кода Оба поля имеют значение по умолчанию: checkUnique = false, codeSeries = WHOLE_CATALOG.
…tion и ChartsOfCharacteristicTypes Добавлены поля для управления проверкой уникальности кода в классах Configuration и ChartsOfCharacteristicTypes: - checkUnique: определяет, нужно ли проверять уникальность кода - codeSeries: определяет область действия уникальности кода Оба поля имеют значение по умолчанию: checkUnique = false, codeSeries = WHOLE_CATALOG.
…ounts и ChartOfCharacteristicTypes Добавлены параметризованные тесты testCheckUniqueTrue для проверки, что поле checkUnique установлено в true для планов счетов "ПланСчетов1" и видов характеристик "ПланВидовХарактеристик1". Также проверяется, что поле codeSeries соответствует значению WHOLE_CATALOG.
|
#548 |
|
@theshadowco готово |
WalkthroughThe pull request adds two new public fields, Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (12)
src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses/ChartsOfAccounts.ПланСчетов1_edt.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses/ChartsOfCharacteristicTypes.ПланВидовХарактеристик1_edt.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses/Configuration.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses/Configuration_edt.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses_3_18/Configuration.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses_3_18/Configuration_edt.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses_3_24/Configuration_edt.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/mdclasses_5_1/Configuration.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения.jsonis excluded by!src/test/resources/**src/test/resources/fixtures/ssl_3_1/ChartsOfCharacteristicTypes.ДополнительныеРеквизитыИСведения_edt.jsonis excluded by!src/test/resources/**
📒 Files selected for processing (4)
src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java(2 hunks)src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccountsTest.java(2 hunks)src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-05T10:03:02.229Z
Learnt from: johnnyshut
Repo: 1c-syntax/mdclasses PR: 515
File: src/test/java/com/github/_1c_syntax/bsl/mdo/AccountingRegisterTest.java:35-37
Timestamp: 2025-09-05T10:03:02.229Z
Learning: The MDTestUtils.getMDWithSimpleTest method already correctly handles optional 4th parameter "_edt" through ArgumentsAccessor - it doesn't need modification to process the additional CSV parameter for subdirectory selection.
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java
📚 Learning: 2025-09-05T10:03:02.229Z
Learnt from: johnnyshut
Repo: 1c-syntax/mdclasses PR: 515
File: src/test/java/com/github/_1c_syntax/bsl/mdo/AccountingRegisterTest.java:35-37
Timestamp: 2025-09-05T10:03:02.229Z
Learning: The MDTestUtils.getMDWithSimpleTest method already correctly handles optional 4th parameter through ArgumentsAccessor.size() check and argumentsAccessor.getString(3) call with null handling - no modification needed for CSV parameter processing.
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.javasrc/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccountsTest.java
🧬 Code graph analysis (1)
src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java (1)
src/test/java/com/github/_1c_syntax/bsl/test_utils/assertions/Assertions.java (1)
Assertions(24-29)
🔇 Additional comments (8)
src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccountsTest.java (2)
25-25: LGTM!The CodeSeries import is properly added to support the new assertions in the test method.
54-79: I'm unable to access the repository directly due to a cloning error, and the public information search didn't provide the specific fixture data needed. Given this limitation, I need to rewrite the review comment to reflect that manual verification of the fixtures is still required.
Fixture verification required before approval.
The test implementation correctly validates both
checkUniqueandcodeSeriesproperties. However, the request to verify that the XML fixture files contain<checkUnique>true</checkUnique>could not be completed automatically. Since the default value ofcheckUniqueisfalsein the main class but this test expectstrue, manually verify that both the Designer and EDT format XML fixture files explicitly set the expected values before merging.src/test/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypesTest.java (2)
24-30: LGTM!The necessary imports are properly added to support the new test method assertions.
46-71: I'm unable to access the repository due to infrastructure limitations in the sandbox environment. However, I can provide a rewritten review comment based on the information available from the code snippet provided.Fixture data verification is necessary but cannot be completed in current environment; test implementation is sound.
The test correctly validates both
checkUniqueandcodeSeriesproperties forChartOfCharacteristicTypesusing proper assertions with descriptive messages. Since the test expectscheckUnique=truebut defaults are typicallyfalse, the XML fixtures must explicitly set these values. The developer should verify that fixture files forПланВидовХарактеристик1(both with_edtsuffix and without) contain:
<checkUnique>true</checkUnique>- Appropriate
codeSeriesvalue matchingWHOLE_CATALOGThe test follows the established pattern from similar tests in the codebase and uses
MDTestUtils.getMDWithSimpleTest()correctly.src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java (2)
29-29: LGTM!The CodeSeries import is properly added to support the new
codeSeriesfield.
135-142: LGTM!The
codeSeriesfield is properly implemented with clear Javadoc explaining its purpose, default value, and EDT format behavior.src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java (2)
27-27: LGTM!The CodeSeries import is properly added to support the new
codeSeriesfield.
129-136: LGTM!The
codeSeriesfield is properly implemented with clear Javadoc, appropriate default value, and helpful EDT format notes.
src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java
Show resolved
Hide resolved
…unts и ChartOfCharacteristicTypes Изменено описание в документации для полей checkUnique в классах ChartOfAccounts и ChartOfCharacteristicTypes, чтобы уточнить, что при значении false проверка уникальности не выполняется.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: build (23, windows-latest)
- GitHub Check: build (23, ubuntu-latest)
- GitHub Check: build (23, macOS-latest)
- GitHub Check: build (21, macOS-latest)
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (21, ubuntu-latest)
- GitHub Check: build (17, macOS-latest)
- GitHub Check: build (17, windows-latest)
- GitHub Check: build (17, ubuntu-latest)
🔇 Additional comments (3)
src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfAccounts.java (2)
29-29: CodeSeries import is appropriate and minimal.The added
CodeSeriesimport cleanly supports the newcodeSeriesfield; no issues here.
126-142: Based on my investigation, I cannot access the repository code or retrieve definitive platform documentation about the ChartOfAccountscheckUniquedefault value. The web search did not provide clarity on whether the platform defaults totrueorfalsefor this property.The original review comment appropriately identifies this uncertainty and is correctly structured to request verification. It:
- Acknowledges the current implementation (
false)- Notes the potential discrepancy with PR description claims
- Requests developer confirmation of intended behavior
- Provides clear alternative paths forward
Since I cannot verify the PR description content, platform semantics, or related test expectations without repository access, I will preserve the original review comment's structure and substance, as it appropriately raises this as a verification point that requires developer input.
Confirm intended default for
checkUniquein ChartOfAccounts.The Javadoc now consistently documents that when
checkUnique == true, the code must be unique within the scope defined bycodeSeries; whenfalse, uniqueness is not checked. ThecodeSeriesdefault ofCodeSeries.WHOLE_CATALOGmatches EDT behavior.However, this implementation sets:
@Default boolean checkUnique = false;while the PR description suggests
checkUniqueshould default totruefor ChartOfAccounts. Please confirm the intended behavior:
- If the platform requires uniqueness by default, update the default:
- @Default - boolean checkUnique = false; + @Default + boolean checkUnique = true;
- If
falseis intentional, update the PR description to clarify.src/main/java/com/github/_1c_syntax/bsl/mdo/ChartOfCharacteristicTypes.java (1)
27-27: CodeSeries import usage is correct.The
CodeSeriesimport is needed for the newcodeSeriesfield and keeps dependencies aligned with ChartOfAccounts; no further changes needed.
Описание
Реализовано добавление свойств
CheckUniqueиCodeSeriesв классChartOfAccountsиChartOfCharacteristicTypesВнесенные изменения:
Добавлено свойство
checkUniqueв классChartOfAccountsиChartOfCharacteristicTypes:booleantrueОбновлены тестовые JSON-файлы:
checkUniqueиcodeSeriesво все тестовые JSON-файлы с корректными значениямиОсобенности реализации:
CheckUniqueиCodeSeriesобязательны и корректно парсятся из XMLCheckUniqueобязательно, полеCodeSeriesопционально — если отсутствует, используется значение по умолчаниюWHOLE_CATALOGСвязанные задачи
Closes #546
Чеклист
Общие
gradlew precommit)Дополнительно
Все тесты проходят успешно. Реализация соответствует требованиям issue #546 и обеспечивает корректную работу с обоими форматами (Designer и EDT).
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.