feat(v4)!: drop --currency from transfer-money to match docs 1:1 (closes #432)#441
Conversation
Closes #432. BREAKING CHANGE. Fetched https://yandex.ru/dev/direct/doc/dg-v4/reference/TransferMoney and confirmed the PayCampElement object carries only CampaignID and Sum; the Sum is in conventional units ("условные единицы") with no Currency field anywhere in the request. The prior CLI sent Currency on every FromCampaigns/ToCampaigns item, which is not part of the docs-defined wire-shape. Changes: - Remove --currency option from direct v4finance transfer-money. - Drop Currency from the FromCampaigns/ToCampaigns items. - Update v4_contracts.py:TransferMoney example_param and notes (Docs-verified 2026-05-28). - Update tests/test_v4finance_money.py:test_transfer_money_dry_run_*. - README example no longer passes --currency. - Bump version to 0.3.15; CHANGELOG entry under BREAKING CHANGES. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Three sentences in TransferMoney.notes all restated "Currency is absent from the wire". Consolidate to a single docs-verified statement. Also update tests/test_v4_contracts.py fixture to drop the stale Currency field that no longer appears in example_param.
|
@claude review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude finished @axisrow's task in 2m 43s —— View job Claude Code Review
No critical/blocking issues. Reviewed under the "bugs, security, data-loss, performance only" lens you asked for. Why the production-harm risk is essentially zero
Non-blocking follow-ups (doc drift from this PR)These are documentation-only and don't break runtime, but they're direct fallout from this PR and worth a quick cleanup before merge or in an immediate follow-up:
Things I checked and found clean
VerdictShip-safe. Two doc lines above are worth fixing — neither is a blocker, but both are stale specifically because of this PR. |
…dangerous-commands example Direct fallout of dropping --currency from transfer-money: - tests/API_COVERAGE.md still claimed TransferMoney requires Currency - scripts/test_dangerous_commands.sh checklist still passed --currency, which now errors with "No such option: --currency"
|
@claude review. Focus on critical issues: bugs, security vulnerabilities, logical errors, data loss risks, performance problems. Do NOT nitpick style, naming conventions, minor formatting, or subjective preferences — only flag issues that could break functionality or cause real harm in production. |
|
Claude finished @axisrow's task in 1m 55s —— View job Claude Code Review (round 2)
No critical / blocking issues. Reviewed under the "bugs, security, data-loss, performance only" lens you asked for, and the two stale-docs follow-ups from my prior review ( Why the production-harm risk is essentially zero
Cross-file consistency (the thing this PR could most easily get wrong)The TransferMoney wire-shape is now
The remaining Things I checked and found clean
Note on migration semanticsWorth noting for users hand-copying the migration example: removing Not a blocker — just a future-support breadcrumb. CHANGELOG language is accurate. VerdictShip-safe. No issues to fix. |
…#441/#442/#443) (#450) PRs #441/#442/#443 dropped the obligatory Live 4 input parameter Currency from PayCampElement on transfer-money, pay-campaigns, and create-invoice; #442 additionally dropped the valid Overdraft PayMethod. The commits cited dg-v4/reference/<Method> as the verification source. That URL is legacy v4 (pre-Live), where PayCampElement is {CampaignID, Sum} only. The CLI ships these commands in the v4finance Live group and must mirror dg-v4/live/<Method>. Verified 2026-05-29 by curling the live pages: - dg-v4/live/TransferMoney → PayCampElement = {CampaignID, Sum, Currency}; changelog "Новое в версии Live 4: Входной параметр Currency стал обязательным". - dg-v4/live/PayCampaigns → PayCampElement = {CampaignID, Sum, Currency}; same changelog plus "Добавлен метод оплаты Overdraft". - dg-v4/live/CreateInvoice → PayCampElement = {CampaignID, Sum, Currency}. Restored: - --currency (required, Choice: RUB/CHF/EUR/KZT/TRY/UAH/USD/BYN) on transfer-money, pay-campaigns, create-invoice. - Currency emitted on every Payments[] / FromCampaigns[] / ToCampaigns[] item. - Overdraft re-enabled in V4_PAY_METHODS; --contract-id remains required only when --pay-method Bank. Updated v4_contracts.py example_param and notes (now pointing at dg-v4/live/*); updated tests/test_v4finance_money.py and tests/test_v4_contracts.py expectations; updated README, CHANGELOG (0.3.16 BREAKING CHANGES), scripts/test_dangerous_commands.sh checklist, tests/API_COVERAGE.md, and the opt-in live-write test for CreateInvoice. Bumped version to 0.3.16. Audit trail: #125 (comment) Co-authored-by: hapi <[email protected]> Co-authored-by: Claude Opus 4.7 <[email protected]>
Summary
BREAKING CHANGE. Fetched https://yandex.ru/dev/direct/doc/dg-v4/reference/TransferMoney and confirmed that
PayCampElementcarries onlyCampaignIDandSum(in conventional units / условные единицы). NoCurrencyfield exists anywhere in the docs-defined request body.The prior CLI implementation sent
Currencyon everyFromCampaigns/ToCampaignsitem, which is not part of the docs-defined wire-shape. To match the docs 1:1, this PR removes--currencyfrom the command and dropsCurrencyfrom the wire-body items.Changes
--currencyoption fromdirect v4finance transfer-money.CurrencyfromFromCampaigns/ToCampaignsitems.direct_cli/v4_contracts.py:TransferMoneyexample_paramandnotes(Docs-verified 2026-05-28).tests/test_v4finance_money.py:test_transfer_money_dry_run_*.--currency.Migration
Before:
After:
The API takes
Sumin conventional units; the currency is implied by the campaign, not by the CLI option.Test plan
pytest tests/test_v4finance_money.py -k transfer_money— 3 passing.pytest tests/test_v4finance_money.py tests/test_v4finance_read.py tests/test_comprehensive.py tests/test_cli.py— 129 passing.direct v4finance transfer-money --help—--currencyabsent.Verification
Live API was not re-verified due to absence of finance credentials in this session. If the API turns out to also accept the extra
Currencyfield silently, no regression — but the docs-canonical shape is now what we send.Closes #432. Part of milestone 22.
🤖 Generated with Claude Code