Repository navigation
Split the Lead agreements by customer kind and drop the consent-count cap - #1061
Conversation
… cap A consumer and a commercial customer accept different Lead cardholder and accountholder documents, so each is its own agreement type rather than one type covering both. The array cap went with them. It restated a bound the type list already implies, and any new agreement silently invalidated it. The per-type uniqueness the description states is the real constraint.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
|
| - LEAD_ACCOUNTHOLDER_CONSUMER_AGREEMENT | ||
| - LEAD_ACCOUNTHOLDER_COMMERCIAL_AGREEMENT | ||
| - LEAD_PRIVACY_POLICY | ||
| - LEAD_CARDHOLDER_AGREEMENT | ||
| - LEAD_CARDHOLDER_CONSUMER_AGREEMENT | ||
| - LEAD_CARDHOLDER_COMMERCIAL_AGREEMENT |
There was a problem hiding this comment.
Enum Removal Breaks Compatibility
Removing LEAD_ACCOUNTHOLDER_AGREEMENT and LEAD_CARDHOLDER_AGREEMENT makes previously valid requests and generated enum constants invalid in the existing 2025-10-13 API contract. This violates the repository directive that breaking OpenAPI changes must bump info.version and use a matching new servers.url. Preserve the old values or release the replacements under a new API version.
Context Used: CLAUDE.md (source)
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/AgreementType.yaml
Line: 14-18
Comment:
**Enum Removal Breaks Compatibility**
Removing `LEAD_ACCOUNTHOLDER_AGREEMENT` and `LEAD_CARDHOLDER_AGREEMENT` makes previously valid requests and generated enum constants invalid in the existing `2025-10-13` API contract. This violates the repository directive that breaking OpenAPI changes must bump `info.version` and use a matching new `servers.url`. Preserve the old values or release the replacements under a new API version.
**Context Used:** CLAUDE.md ([source](https://github.com/lightsparkdev/grid-api/blob/main/CLAUDE.md))
**Knowledge Base Used:**
- [Grid API contract](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/api-contract.md)
- [Contract validation workflows](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/contract-validation-workflows.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.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!
There was a problem hiding this comment.
Not treating this as breaking: the two values shipped 8 days ago in #990 and no backend ever accepted them - sparkcore implements neither agreementConsents nor GET /customers/agreements, so no request using them was ever valid. The repo's breaking-change CI agrees (Detect breaking changes passes). Keeping dead aliases would instead ship four spellings for two documents. Happy to bump info.version and servers.url if you'd rather play it safe.
There was a problem hiding this comment.
That context is sufficient to resolve my concern. PR #990 explicitly shipped these as spec/docs-only changes, with backend support deferred, and documented that no consent evidence could yet exist. If Sparkcore implements neither the consent field nor the agreements endpoint, the removed enum values could not have been accepted by the service.
With the breaking-change check passing, this is a correction to an unimplemented contract rather than a live wire-compatibility break. I withdraw the version-bump finding; keeping the obsolete aliases would indeed leave four spellings for two documents.
| type does not. Accepting one agreement never implies acceptance of another, | ||
| even when two agreements share a hosted page. | ||
| even when two agreements share a hosted page. A consumer and a commercial | ||
| customer accept different cardholder and accountholder documents, so each is | ||
| its own type. |
There was a problem hiding this comment.
The contract represents customer kind as INDIVIDUAL or BUSINESS, but this description introduces consumer and commercial without defining how they map. Because callers must choose an agreement type themselves, this ambiguity can cause them to submit and record the wrong consent. Explicitly state which customerType corresponds to each agreement variant.
Knowledge Base Used: Customers and accounts API
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/AgreementType.yaml
Line: 5-8
Comment:
**Customer Kind Mapping Missing**
The contract represents customer kind as `INDIVIDUAL` or `BUSINESS`, but this description introduces `consumer` and `commercial` without defining how they map. Because callers must choose an agreement type themselves, this ambiguity can cause them to submit and record the wrong consent. Explicitly state which `customerType` corresponds to each agreement variant.
**Knowledge Base Used:** [Customers and accounts API](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/customers-and-accounts-api.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Good catch - the description now says an INDIVIDUAL customer accepts the _CONSUMER_ variant and a BUSINESS customer the _COMMERCIAL_ one, using the contract's own customerType spellings.
Co-Authored-By: bsiaotickchong <bsiaotickchong@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
⚡ Review ledger Round 1
|

Summary
LEAD_CARDHOLDER_AGREEMENTandLEAD_ACCOUNTHOLDER_AGREEMENTinto consumer and commercial variants. A consumer and a commercial customer accept different documents, so a single type cannot identify which one was accepted.maxItems: 7cap onagreementConsentsin the customer create and update requests.Why the cap goes
It restated a bound the type list already implies, and it silently became wrong the moment a type was added — as this change demonstrates, since the list is now nine. A caller reading
maxItems: 7learns nothing they could act on.The constraint that matters is already stated in the field description and enforced server-side: at most one entry per type. That one does not drift when the enum grows.
Compatibility
The two replaced values are not yet recorded against any customer, so no existing consent evidence refers to them.
Test plan
npm run build:openapiregenerates both bundles; verified the new values are present and the replaced ones are gone fromopenapi.yamlandmintlify/openapi.yaml.npm run lint:openapiexits 0. The only agreement-related output is a pre-existing informational note about a missing example onAgreementConsentRequest.acceptedAt, untouched by this change.Original PR: #1053