Skip to content

Add typed V4 Live finance and shared-account commands #125

Description

@axisrow

Summary

Expose the high-priority V4 Live finance and shared-account methods that still have no practical V5 equivalent, using typed Direct CLI commands.

Commands

Implement these commands with typed flags:

  • direct v4finance get-clients-units --logins LOGIN[,LOGIN...]
  • direct v4finance get-credit-limits --logins LOGIN[,LOGIN...]
  • direct v4finance transfer-money --from-login LOGIN --to-login LOGIN --amount AMOUNT --dry-run
  • direct v4finance pay-campaigns --campaign-ids IDS --amount AMOUNT --dry-run
  • direct v4finance check-payment --payment-id ID
  • direct v4account account-management ... --dry-run
  • direct v4account enable-shared-account ... --dry-run

Exact flag names should stay canonical: lowercase kebab-case, comma-separated list flags, and explicit typed inputs. Do not add raw JSON passthrough.

Implementation Notes

  • Use the V4 foundation helper from the V4 CLI foundation issue.
  • Money values stay human-readable at the CLI boundary and convert internally if V4 requires another wire format.
  • Mutating commands must support --dry-run and print the exact V4 request body.
  • If official V4 docs contradict the vendored SUPPORTED_V4_METHODS, record the finding and mark the method api-status:docs-drift before implementation.
  • Do not add GetBalance unless official verification shows it works; current vendored registry notes it was removed with error code 509.

Test Plan

  • Dry-run tests assert exact request bodies for mutating commands.
  • Unit tests for comma-separated login/campaign ID parsing.
  • CLI error tests for missing required flags and invalid money values.
  • Mocked adapter tests for successful read commands.

Acceptance Criteria

  • All listed commands are registered and documented.
  • Mutating commands have --dry-run coverage.
  • Invalid inputs fail with Click usage errors before API calls.
  • README includes single-line canonical examples.
  • Commands are classified in the smoke matrix.

Contract source rule

When this issue touches API contracts, V4 Live methods, request bodies, response shapes, safety classification, or CLI command payloads:

  • Treat official Yandex Direct docs and safe live probes as the only authoritative sources for wire shape.
  • Do not treat issue examples, guessed param names, or vendored method registries as authoritative by themselves.
  • If official docs are missing, 404, ambiguous, disabled, or contradict this issue, stop implementation and record the docs drift before coding.
  • Public CLI must stay typed and canonical: no public --json passthrough for user-facing input.
  • Mutating or financially sensitive V4 commands stay dry-run-only unless the issue explicitly says otherwise after verification.
  • Update direct_cli/v4_contracts.py source status (confirmed-live, docs, undocumented) and add focused tests for exact request bodies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-status:supportedAPI surface is supported by official docs/WSDLenhancementFeature addition

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions