Skip to content

feat: full v1+v2 resource surface across all 7 SDKs (0.2.0)#1

Merged
sebyx07 merged 10 commits intomainfrom
feat/v1-v2-resources
Apr 29, 2026
Merged

feat: full v1+v2 resource surface across all 7 SDKs (0.2.0)#1
sebyx07 merged 10 commits intomainfrom
feat/v1-v2-resources

Conversation

@sebyx07
Copy link
Copy Markdown
Contributor

@sebyx07 sebyx07 commented Apr 29, 2026

Summary

  • Implements the full v1+v2 resource surface — 35 endpoints (6 v1 + 29 v2) — across all seven SDKs in lockstep, derived from the Rails controllers in treasury (the YAML was stale and missed batches, sync_sessions, transactions/{search,bulk,export}, accounts/{id}/sync). Single-source spec at /tmp/tesote_v1_v2_spec.md was used by all seven implementation agents.
  • Lockstep minor bump: every language goes 0.1.x → 0.2.0.
  • Adds parity-check coverage for C# and renames C# transaction listing to match the cross-language manifest.

What's new in each SDK

Resource clients on V1Client / V2Client (per-language idiomatic naming):

  • v1 (6): accounts (list/get), transactions (listForAccount/get), status (status/whoami)
  • v2 (29): accounts (list/get/sync), transactions (listForAccount/get/sync/syncLegacy/bulk/search/export), sync_sessions (list/get), transaction_orders (list/get/create/submit/cancel), batches (create/show/approve/submit/cancel), payment_methods (list/get/create/update/delete), status (status/whoami)

Plus, in every language:

  • Models: typed objects (TS interfaces, Python @dataclass(frozen=True), Ruby Structs, Java records, PHP readonly classes, Go structs, C# records) for every response shape — Account, Transaction, SyncTransaction, SyncResult, SyncSession, TransactionOrder, PaymentMethod, BatchSummary, etc. Snake_case on the wire, idiomatic case in the public model.
  • Errors: one typed exception per error_code from TesoteApi::ErrorCodes — adds ~20 classes per language (NotFound family, InvalidCursor/Count/Limit/Query, MissingDateRange, SyncInProgress, SyncRateLimitExceeded, BankUnderMaintenance, BankSubmission, BankConnectionNotFound, Validation, BatchValidation, InvalidOrderState, InternalError).
  • Transport: reused as-is. Mutations opt into idempotency keys via the existing hook. New requestRaw/request_raw/RequestRawAsync path for CSV/JSON export. Cursor + offset pagination iterators.

Per-language test results

Lang Build/lint Tests
TS typecheck + biome + build clean 106/106 vitest
Python ruff + mypy clean 103 pytest passed
Ruby rubocop clean (34 files, 0 offenses) 129 rspec passed
Java ./gradlew clean build test clean (-Werror -Xlint:all) 88 JUnit passed
PHP cs-check + phpstan L8 clean 84 PHPUnit / 302 assertions
Go gofmt + vet clean, go test -race ./... all passed
C# dotnet build -c Release clean (0 warnings, TreatWarningsAsErrors) 70/70 xUnit

python3 bin/check_parity.py: all checked languages pass.

Notable side-effects

  • PHP: lands the in-flight Transport.php slim refactor + src/Internal/ helpers (BackoffStrategy, CacheKey, JsonCodec, RateLimitTracker, RequestBuilder, RequestSummarizer, RetryPolicy, TransportConfig, Uuid). Deletes NotImplemented.php.
  • Java: first real resource layer (0.1.x shipped only the builder + transport). 25 typed exceptions; jackson-databind remains the only runtime dep (date fields stay ISO-8601 strings, no jsr310).
  • Go: zero ErrNotImplemented returns remain.
  • Python / Ruby: stub files (v2/_stubs.py, v2/stubs.rb) deleted.
  • C#: parity-script aware now via async_suffix: Async; renamed V1.AccountsClient.ListTransactionsAsyncV1.TransactionsClient.ListForAccountAsync, V2.TransactionsClient.ListAsyncListForAccountAsync to match the manifest.
  • bin/check_parity.py: gains an optional async_suffix per-language config field.
  • spec/parity.yaml: enrolls C#.

YAML drift in treasury

The engines/tesote_api/docs/openapi{,_v2}.yaml files in treasury are missing endpoints that the controllers expose with API-key auth: batches (×5), sync_sessions (×2), transactions/search, transactions/bulk, transactions/export, accounts/{id}/sync. The SDKs in this PR ship against the controller surface; a follow-up PR in treasury should bring the YAMLs in line. The matching docs site update lives in a separate PR in tesote.com.

Test plan

  • Per-language CI workflow green on branch (ts.yml, python.yml, ruby.yml, java.yml, php.yml, go.yml, csharp.yml).
  • parity-check.yml green.
  • Manual smoke after merge: hit a staging API key from each language's quickstart and exercise one v2 endpoint that's new in this PR (e.g., paymentMethods.list, transactionOrders.create against a sandbox account).
  • After release tags fire, verify each registry receives 0.2.0 (npm, PyPI, RubyGems, Sonatype, Packagist, proxy.golang.org, NuGet).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Complete v1/v2 SDKs with typed models and clients: Accounts, Transactions (list/get/sync/bulk/search/export), Sync Sessions, Transaction Orders (create/submit/cancel), Batches (create/show/approve/submit/cancel), Payment Methods (list/get/create/update/delete), Status/Whoami.
    • Typed error mapping for all documented error codes.
    • Raw download support for exports, pagination helpers/iterators, idempotency headers, rate-limit exposure, and per-endpoint caching TTLs.
  • Documentation
    • Updated changelogs and README for 0.2.0.
  • Tests
    • Extensive cross-language test coverage for endpoints, errors, idempotency, and pagination.
  • Chores
    • Version bumped to 0.2.0 across SDKs.

sebyx07 and others added 8 commits April 28, 2026 19:43
35 endpoints (6 v1 + 29 v2) wired against the Rails-controller-derived
spec. Adds resource clients on V1Client/V2Client (Accounts, Transactions,
Status, plus v2 SyncSessions, TransactionOrders, Batches, PaymentMethods),
20 typed exception classes covering every error_code, models as records
with snake_case wire markers, and Transport.RequestRawAsync for CSV/JSON
export. dotnet build clean (TreatWarningsAsErrors), 70/70 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 endpoints (6 v1 + 29 v2) wired against the Rails-controller-derived
spec. Replaces all ErrNotImplemented stubs with real services on
V1Client/V2Client (accounts, transactions, status, plus v2
sync_sessions, transaction_orders, batches, payment_methods). Adds 21
typed errors mapped from error_code, json-tagged structs for every
model, raw-bytes path for CSV/JSON export. gofmt/vet clean,
go test -race ./... green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 endpoints (6 v1 + 29 v2) wired against the Rails-controller-derived
spec. First real resource layer for Java — 0.1.x shipped only the
builder + transport plumbing. Adds 7 resource clients on V1Client/V2Client
(Accounts, Transactions, Status, plus v2 SyncSessions, TransactionOrders,
Batches, PaymentMethods), 22 model records with snake_case wire ↔
camelCase Java via @JsonProperty, 25 typed exceptions per error_code,
Transport.requestRaw for CSV/JSON export. ./gradlew clean build test
green with -Werror -Xlint:all, 88 JUnit tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 endpoints (6 v1 + 29 v2) wired against the Rails-controller-derived
spec. Lands the Transport.php slim refactor (extracts BackoffStrategy,
CacheKey, JsonCodec, RateLimitTracker, RequestBuilder, RequestSummarizer,
RetryPolicy, TransportConfig, Uuid into src/Internal/) and wires every
resource client on V1\Client / V2\Client (Accounts, Transactions, Status,
plus v2 SyncSessions, TransactionOrders, Batches, PaymentMethods). Adds
37 readonly model classes with typed properties and 20 new typed
exceptions per error_code. composer test/phpstan(L8)/cs-check clean,
84 phpunit tests / 302 assertions pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 endpoints (6 v1 + 29 v2) wired against the Rails-controller-derived
spec. Replaces v2/_stubs.py with real per-resource modules
(transactions, sync_sessions, transaction_orders, batches,
payment_methods, status). Adds 20+ typed exception classes per
error_code, frozen @DataClass models for every response shape,
cursor + offset iter_* generators, and request_raw transport path
for CSV/JSON export. ruff/mypy clean, 103 pytest passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 endpoints (6 v1 + 29 v2) wired against the Rails-controller-derived
spec. Replaces lib/tesote_sdk/v2/stubs.rb with seven dedicated resource
modules. Adds typed Struct models with keyword_init + tolerant
from_hash/from_array, all spec error codes mapped to typed errors,
cursor + offset enumerators, and request_unversioned + request_raw
transport hooks for /status,/whoami at root and CSV/JSON export.
rubocop clean (34 files, 0 offenses), 129 rspec examples pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
35 endpoints (6 v1 + 29 v2) wired against the Rails-controller-derived
spec. Adds resource clients on V1Client/V2Client (Accounts, Transactions,
Status, plus v2 SyncSessions, TransactionOrders, Batches, PaymentMethods),
typed model interfaces for every response shape, 19 new typed error
classes per error_code, cursor + offset listAll* async iterators, and
raw-text transport bodies for CSV/JSON export. typecheck/biome lint/build
clean, 106/106 vitest tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- spec/parity.yaml: add csharp entry (pascal case, Async suffix, .cs extension)
- bin/check_parity.py: support optional async_suffix per language so the
  parity grep matches WhoamiAsync/UpdateAsync/DeleteAsync etc.
- csharp: move ListForAccount from V1.AccountsClient.ListTransactionsAsync
  to V1.TransactionsClient.ListForAccountAsync; rename
  V2.TransactionsClient.ListAsync -> ListForAccountAsync (matches the
  cross-language manifest spelling). Tests updated.

dotnet build -c Release clean (0 warnings, TreatWarningsAsErrors), 70/70
tests pass, python3 bin/check_parity.py reports OK for all six checked
languages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f68612c2-ab64-4563-a996-e9f43e06a06b

📥 Commits

Reviewing files that changed from the base of the PR and between bd1f2d4 and 392999b.

⛔ Files ignored due to path filters (1)
  • .coderabbit.yaml is excluded by none and included by none
📒 Files selected for processing (37)
  • packages/php/src/Models/Account.php
  • packages/php/src/Models/AccountData.php
  • packages/php/src/Models/AccountList.php
  • packages/php/src/Models/Bank.php
  • packages/php/src/Models/BatchActionResult.php
  • packages/php/src/Models/BatchCreated.php
  • packages/php/src/Models/BatchSummary.php
  • packages/php/src/Models/BulkAccountResult.php
  • packages/php/src/Models/BulkResult.php
  • packages/php/src/Models/Counterparty.php
  • packages/php/src/Models/CursorPagination.php
  • packages/php/src/Models/Destination.php
  • packages/php/src/Models/ExportFile.php
  • packages/php/src/Models/LegalEntity.php
  • packages/php/src/Models/Money.php
  • packages/php/src/Models/PagePagination.php
  • packages/php/src/Models/PaymentMethod.php
  • packages/php/src/Models/PaymentMethodList.php
  • packages/php/src/Models/SourceAccount.php
  • packages/php/src/Models/StatusInfo.php
  • packages/php/src/Models/SyncRemoval.php
  • packages/php/src/Models/SyncResult.php
  • packages/php/src/Models/SyncSession.php
  • packages/php/src/Models/SyncSessionList.php
  • packages/php/src/Models/SyncStarted.php
  • packages/php/src/Models/SyncTransaction.php
  • packages/php/src/Models/TesoteAccountRef.php
  • packages/php/src/Models/TesoteTransactionRef.php
  • packages/php/src/Models/Transaction.php
  • packages/php/src/Models/TransactionCategory.php
  • packages/php/src/Models/TransactionData.php
  • packages/php/src/Models/TransactionList.php
  • packages/php/src/Models/TransactionOrder.php
  • packages/php/src/Models/TransactionOrderAttempt.php
  • packages/php/src/Models/TransactionOrderList.php
  • packages/php/src/Models/TransactionSearchResult.php
  • packages/php/src/Models/WhoAmI.php

📝 Walkthrough

Walkthrough

Implements full v1/v2 client surfaces, typed models, and granular error mapping across Go, C#, Java, PHP, Python, and Ruby. Adds raw-response transports, idempotency handling, pagination helpers, and tests. Removes stubbed clients, updates versions to 0.2.0, and refines error-code fallbacks and content-type behavior.

Changes

Cohort / File(s) Summary
Parity tooling
bin/check_parity.py
Adds optional async method suffix handling when grepping for method names.
Go: errors and mapping
go/errors.go, go/errors_api.go, go/errors_map.go
Introduces many new exported sentinel errors and typed wrappers; expands error_code→type mapping and HTTP status fallbacks. Review for collision/Is semantics and fallback changes (400/404/500).
Go: models and version
go/models.go, go/version.go
Adds comprehensive exported models; bumps Version to 0.2.0. Check JSON tags and RawMessage usages for error payloads.
Go v1 services
go/v1/accounts.go, go/v1/transactions.go, go/v1/status.go, go/v1/client.go, go/v1/v1_test.go
Adds functional v1 clients (list/get, transactions, status). Removes prior stubs. Verify cache TTLs and query serialization.
Go v2 services
go/v2/accounts.go, go/v2/transactions.go, go/v2/sync_sessions.go, go/v2/transaction_orders.go, go/v2/batches.go, go/v2/payment_methods.go, go/v2/status.go, go/v2/client.go, go/v2/*_test.go, go/v2/helper_test.go
Replaces stubs with full implementations (list/get/sync/export/bulk/search/orders/batches/payment methods/status). Verify idempotency header propagation, 415/429/409 mappings, and Export filename parsing.
C#: errors and transport
packages/csharp/src/Errors/*, packages/csharp/src/Transport.cs
Adds many typed exceptions and dispatcher mappings; adds RequestRawAsync and bumps SDK version. Confirm consistent mapping and Retry-After handling; ensure JSON Content-Type on empty bodies.
C#: models and clients
packages/csharp/src/Models/*, packages/csharp/src/V1/*, packages/csharp/src/V2/*, packages/csharp/src/RawResponse.cs, packages/csharp/src/Internal/*
Introduces typed models and concrete v1/v2 clients (breaking: method signatures return typed models). Validate public API changes and envelope shapes; ensure delete returns void and patch method usage.
C#: metadata/tests
packages/csharp/CHANGELOG.md, packages/csharp/src/Tesote.Sdk.csproj, packages/csharp/tests/*
Version bump to 0.2.0 and broad test coverage for errors/idempotency/pagination/raw export.
Java: transport and errors
packages/java/src/main/java/com/tesote/sdk/Transport.java, .../errors/*
Adds requestRaw, SDK_VERSION 0.2.0, Content-Type enforcement; many new typed exceptions and dispatcher cases. Validate header parsing and fallback status→code mapping.
Java: models and clients
packages/java/src/main/java/com/tesote/sdk/models/*, .../v1/*, .../v2/*
Adds typed records and concrete clients (breaking: accessors return clients; methods return models). Check JSON bindings and export filename parsing.
Java: metadata/tests
packages/java/build.gradle.kts, packages/java/CHANGELOG.md, packages/java/src/test/java/...
Version bump and extensive tests for mapping and request formation.
PHP: transport and internals
packages/php/src/Transport.php, packages/php/src/Internal/*
Refactors transport (requestRaw, retries, rate-limit tracking, config validation, UUID, backoff). Verify security of API-key redaction and cache-key derivation; confirm Content-Type on mutations.
PHP: errors and models
packages/php/src/Errors/*, packages/php/src/Models/*
Adds many typed exceptions and readonly models. Ensure ApiException dispatch table completeness and 500/404 fallbacks.
PHP: v1/v2 clients
packages/php/src/V1/*, packages/php/src/V2/*, packages/php/src/NotImplemented.php
Implements all resources; removes NotImplemented (breaking). Methods now return typed models. Validate idempotency header propagation and empty-body JSON encoding.
PHP: metadata/tests/docs
packages/php/VERSION, packages/php/README.md, packages/php/CHANGELOG.md, packages/php/tests/...
Version bump to 0.2.0; broad tests for error mapping, pagination, idempotency, raw export, and 415 behavior.
Python: version and exports
packages/python/src/tesote_sdk/_version.py, .../__init__.py
Bumps to 0.2.0; expands top-level exports (errors/models). Check for import surface changes.
Python: errors, models, resources
packages/python/src/tesote_sdk/errors.py, .../models.py, .../v1/*, .../v2/*, .../v2/_stubs.py
Adds comprehensive models, error mappings, and full v1/v2 resources; deletes v2 stubs (breaking). Validate iterator pagination and idempotency header usage.
Python: tests
packages/python/tests/*, packages/python/tests/_helpers.py
Adds end-to-end tests for mappings, pagination, raw export, and content-type checks.
Ruby: core wiring
packages/ruby/lib/tesote_sdk.rb, .../transport.rb
Loads models/pagination; adds request_unversioned and request_raw (RawResponse). Verify raw path building and header extraction.
Ruby: errors/models/pagination
packages/ruby/lib/tesote_sdk/errors.rb, .../models.rb, .../pagination.rb
Adds typed errors and rich model structs; introduces cursor/offset enumerators. Review error registration completeness and nested build_field logic.
Ruby: v1/v2 resources
packages/ruby/lib/tesote_sdk/v1/*, .../v2/*, packages/ruby/lib/tesote_sdk/v2/client.rb
Implements status/accounts/transactions and v2 resources (batches, payment methods, orders, sync sessions, status). Check cache TTL defaults and argument validation.
Multi-language metadata
go/version.go, packages/csharp/src/Tesote.Sdk.csproj, packages/java/build.gradle.kts, packages/php/VERSION
All SDKs updated to 0.2.0. Potential dependency consumers should note breaking surface changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/v1-v2-resources

sebyx07 and others added 2 commits April 28, 2026 19:53
CLAUDE.md mandates a PHP 8.1 floor. The agents that scaffolded the v2
model classes used class-level `final readonly class X` syntax, which
PHP 8.1 cannot parse — CI on PHP 8.1 was failing with linter errors on
all 37 model files.

Move `readonly` from the class declaration onto each promoted
constructor parameter (`public readonly string $foo,`). Same
immutability guarantee, syntax-compatible with 8.1+. composer
cs-check / phpstan (level 8) / phpunit all clean (84 tests / 302
assertions). `php -l` against every modified file confirms no syntax
errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CodeRabbit failed to parse the config with "String must contain at most
250 character(s) at tone_instructions". The previous string was 317
chars. Drop the per-linter list (each language already has its own
linter run in CI; doesn't need to be enumerated here).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sebyx07 sebyx07 merged commit b8af408 into main Apr 29, 2026
20 checks passed
@sebyx07 sebyx07 deleted the feat/v1-v2-resources branch April 29, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant