feat: add TransactionFeeConfig schema (AT-5613)#613
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
✱ Stainless preview builds for gridThis PR will update the cli csharp go kotlin openapi php python ruby typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-ruby studio · code · diff
✅ grid-go studio · code · diff
✅ grid-typescript studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-python studio · code · diff
✅ grid-csharp studio · code · diff
✅ grid-php studio · code · diff
✅ grid-cli studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
| type: object | ||
| description: >- | ||
| Platform-collected transaction fee charged on top of corridor fees. Keyed | ||
| uniquely by `(feeEventType, sourceCurrency)` within a platform. To deactivate | ||
| a fee, send the same key with `variableFeeBps: 0` and `fixedFee.amount: 0`. | ||
| required: | ||
| - feeEventType | ||
| - sourceCurrency | ||
| - variableFeeBps | ||
| - fixedFee |
There was a problem hiding this comment.
Single schema reused for read and write contexts
TransactionFeeConfig is referenced by both PlatformConfig (GET response) and PlatformConfigUpdateRequest (PATCH body). In the write context, readOnly fields (id, isActive) appear in generated SDK request types — even though spec-compliant generators should strip them, some won't. Consider a dedicated TransactionFeeConfigInput schema for the write path that omits id and isActive entirely, so write-side types are unambiguous without relying on readOnly semantics being respected by all toolchains.
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/config/TransactionFeeConfig.yaml
Line: 1-10
Comment:
**Single schema reused for read and write contexts**
`TransactionFeeConfig` is referenced by both `PlatformConfig` (GET response) and `PlatformConfigUpdateRequest` (PATCH body). In the write context, `readOnly` fields (`id`, `isActive`) appear in generated SDK request types — even though spec-compliant generators should strip them, some won't. Consider a dedicated `TransactionFeeConfigInput` schema for the write path that omits `id` and `isActive` entirely, so write-side types are unambiguous without relying on `readOnly` semantics being respected by all toolchains.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
6f07fa7 to
c2ddd74
Compare
Adds platform-collected transaction-fee configuration to the Grid API
PlatformConfig surface.
- New TransactionFeeConfig schema: { id, feeEventType, sourceCurrency,
variableFeeBps, fixedFee, isActive }. `id` and `isActive` are
read-only.
- New TransactionFeeEventType enum: { CROSS_CURRENCY_TRANSACTION,
TRANSFER_OUT_TRANSACTION }.
- PlatformConfig: optional `transactionFeeConfigs: array`. Reads return
all active rows regardless of feeEventType so operator-created Transfer
Out rows are visible before the corresponding write path is enabled.
- PlatformConfigUpdateRequest: same field, with semantics documented as
merge-by-key upsert on (feeEventType, sourceCurrency). To deactivate a
fee, send the same key with variableFeeBps=0 and fixedFee.amount=0.
Sparkcore's PATCH /config handler (AT-5614) will accept only
feeEventType=CROSS_CURRENCY_TRANSACTION + sourceCurrency=USD for v0;
the OpenAPI enum is intentionally broader so the Transfer Out
fast-follow does not need an SDK regen.
The platform transaction fee's fixedFee.amount is enforced non-negative server-side in sparkcore (PATCH /config); document it on the schema so integrators see the constraint. CurrencyAmount stays unconstrained since negative amounts are valid elsewhere in the API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…5613) Add TransactionFeeConfigInput for the PATCH /config write path, omitting the read-only id/isActive fields, so generated SDK request types are unambiguous and do not rely on every toolchain stripping readOnly. This fixes the Stainless SDK build regressions (csharp build, ruby/python lint, kotlin test) caused by the read-only fields appearing in request types. Also clarify the isActive read semantics (no filter param exists). Addresses Greptile review feedback.
6de5f40 to
9248a32
Compare

Reason
Ships AT-5613 (Xc) of the Platform Fee Config: Cross Currency epic — Grid API OpenAPI schemas for platform-collected transaction fees.
This is the API-surface ticket that the sparkcore PATCH
/confighandler (AT-5614) and the Grid API SDKs will consume.Overview
Two new schemas + extensions to two existing ones:
TransactionFeeConfig.yaml—{ id, feeEventType, sourceCurrency, variableFeeBps, fixedFee, isActive }.idandisActiveare read-only. Required:feeEventType,sourceCurrency,variableFeeBps,fixedFee.TransactionFeeEventType.yaml— enum{ CROSS_CURRENCY_TRANSACTION, TRANSFER_OUT_TRANSACTION }. Intentionally broad — sparkcore enforces a narrower v0 whitelist (CROSS_CURRENCY_TRANSACTIONonly) at the handler layer (AT-5614) so the Transfer Out fast-follow does not need an SDK regen.PlatformConfig.yaml— adds optionaltransactionFeeConfigs: array. Reads return all active rows regardless offeeEventType, so operator-planted Transfer Out rows are visible to platforms before the write path is enabled.PlatformConfigUpdateRequest.yaml— same field. Documented as merge-by-key upsert on(feeEventType, sourceCurrency); "deactivate" = same key withvariableFeeBps: 0andfixedFee.amount: 0.Test Plan
npm run build:openapiclean — both new schemas auto-discovered intoopenapi.yaml(lines 8857 + 8904) and themintlify/openapi.yamlmirror.Your API description is valid 🎉). The pre-existing 33 warnings are all on unrelated webhook example schemas (none on the files this PR touches). Confirmed by runningnpm run lintagainstmainfirst — same 33.spectral: command not foundissue onmain— the npm script triesnpx spectralwhich resolves to a 0.0.0 placeholder package, not@stoplight/spectral-cli. Not introduced by this PR; tracking separately.Manual SDK-shape check (post-Stainless regen)
After Stainless picks this up, the generated TS SDK should expose:
TransactionFeeConfigtype with the shape aboveTransactionFeeEventTypeunion including bothCROSS_CURRENCY_TRANSACTIONandTRANSFER_OUT_TRANSACTIONPlatformConfig.transactionFeeConfigs?: TransactionFeeConfig[]PlatformConfigUpdateRequest.transactionFeeConfigs?: TransactionFeeConfig[]Blocked on
Nothing — this lands in parallel with AT-5611/AT-5612 sparkcore work.
Unblocks
/confighandler that consumestransactionFeeConfigsand enforces v0 validation