docs: add quote-rename example apps and an SDK test plan - #63
Merged
Conversation
4 tasks
yacinekahlerras-turbodocx
marked this pull request as ready for review
August 4, 2026 15:44
TurboQuote's naming behaviour changed underneath methods that already existed in all six SDKs — no method, signature, or type moved, so a caller sees the change with no version bump and no compile error. That is exactly the kind of change that needs a runnable check rather than a changelog line. Adds `examples/quote-rename/` to every SDK: a small self-contained app that creates its own company, contact and quotes, asserts each behaviour, prints a pass/fail summary, exits non-zero on failure, and deletes everything it made. Covered: trimming on create and update, whitespace-only rejection, the 255-char limit applying after the trim, `Copy of <source>` naming with its 255-char cap, and the draft-only rename gate. The send-dependent check is opt-in behind RUN_SEND_CHECKS=1, since it needs an org with sender identity configured and dispatches a real signature request. It reports as skipped rather than passed when it does not run. Also adds docs/QUOTE_RENAME_SDK_TEST_PLAN.md — the 46-row plan the examples implement, with row ids the example output quotes directly. Verified: Go compiles, TypeScript type-checks, PHP lints, Python compiles. Ruby and Java have no toolchain on this machine; their API usage was checked against the SDK sources by hand. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI's third PHP gate (cs-fix) failed on the new example — multi-line call formatting and `fn ($r)` vs `fn($r)`. Applied php-cs-fixer itself rather than hand-guessing the rules. All three PHP gates now pass locally: cs-fix (0 of 198 files to fix), phpstan (no errors), phpunit (341 tests). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Ran the examples against a real API rather than trusting the type-check. Three things only execution could surface: 1. `dana@rename-example.test` was rejected — the backend's email validator does not accept the `.test` TLD. Switched to `example.com` in all six, matching the existing examples. 2. The PHP example silently targeted PRODUCTION. `QuoteClientConfig` defaults `baseUrl` to api.turbodocx.com and does not read TURBODOCX_BASE_URL, so the documented env var was ignored — and this example creates and deletes real records. Now passed explicitly. 3. PHP `TurboDocxException` exposes `->statusCode` as a readonly property, not `getStatusCode()`. The rejection assertions fatal-errored on the first 400. The same production-targeting trap applies to Java (HttpClient defaults to api.turbodocx.com with no env fallback), so that example now passes baseUrl too. Go is the exception — NewQuoteClient reads TURBODOCX_BASE_URL itself — and now carries a comment saying so, since the asymmetry looks like an oversight. Live results against a local stack, 17 passed / 0 failed / 1 skipped each: JavaScript, Python, Go, PHP. Ruby and Java still unexecuted — no toolchain here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
amitsharma-turbodocx
force-pushed
the
docs/turboquote-rename-examples
branch
from
August 19, 2026 17:25
5898ab2 to
cd07403
Compare
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.
Description
TurboQuote's quote naming behaviour changed underneath methods that already exist in all six SDKs.
createQuote,updateQuote,duplicateQuote,handleExpiredQuoteandsendQuoteare unchanged in name, signature and type — so there is nothing to port, and a caller gets the new behaviour with no version bump and no compile error.That is exactly the kind of change a changelog line doesn't catch, so this adds a runnable check instead.
What's here
packages/*/examples/quote-rename/— one small app per SDKSelf-contained: creates its own company, contact and quotes, asserts each behaviour, prints a pass/fail summary, exits non-zero on failure, and deletes everything it made.
nametrimmed on create and on update400400and leaves the stored name untouchedCopy of <source>, built from the source's current namedocs/QUOTE_RENAME_SDK_TEST_PLAN.mdThe 46-row plan the examples implement. Row ids are stable and the example output quotes them directly, so a failure reads as
FAIL S29 …and maps straight to a plan row.The send check is deliberately opt-in
S72sends a quote, which needs an org whose quote template has sender name + email — without them the API returns400 SenderEmailRequiredfor an unrelated reason and the check would pass for the wrong reason. It also dispatches a real signature request, which isn't reversible by deleting the quote afterwards.So it's gated behind
RUN_SEND_CHECKS=1and reports asSKIP, never as a pass. The README in each folder says to use a disposable org.Verification — all six executed against a live API
17 passed / 0 failed / 1 skipped in every SDK. Ruby and Java were run in official
containers (
ruby:3.2-slim,maven:3.9-eclipse-temurin-17) since this machine has nointerpreter/JDK.
tsc --strict✅py_compile✅go build✅php -l+ phpstan + cs-fixer ✅ruby -c✅javac✅Sample output (identical shape in all six):
Each run left zero residue — companies, contacts and quotes all cleaned up.
Running them found three real bugs
None were visible to a type-checker:
.testTLD rejected.dana@rename-example.testfails the backend's email validator. All six switched toexample.com.QuoteClientConfigdefaultsbaseUrltoapi.turbodocx.comand does not readTURBODOCX_BASE_URL, so the env var the README documents was ignored — in an example that creates and deletes real records. Now passed explicitly.TurboDocxExceptionhas nogetStatusCode()— it exposes->statusCodeas a readonly property. Every rejection assertion fatal-errored on the first 400.Bug 2 applies to Java as well (
HttpClientdefaults to production with no env fallback), so that example now passesbaseUrltoo. Go is the exception —NewQuoteClientreadsTURBODOCX_BASE_URLitself — and carries a comment saying so, since the asymmetry reads like an oversight.Note on credentials
Every example reads
TURBODOCX_API_KEY,TURBODOCX_ORG_IDandTURBODOCX_BASE_URLfrom the environment. Nothing is hardcoded.Pre-Review Checklist
🤖 Generated with Claude Code