Skip to content

[kyb] simplify business customer object#287

Merged
wuvictor-95 merged 1 commit intomainfrom
03-20-_kyb_simplify_business_customer_object
Mar 21, 2026
Merged

[kyb] simplify business customer object#287
wuvictor-95 merged 1 commit intomainfrom
03-20-_kyb_simplify_business_customer_object

Conversation

@wuvictor-95
Copy link
Contributor

@wuvictor-95 wuvictor-95 commented Mar 20, 2026

@vercel
Copy link

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Mar 20, 2026 11:58pm

Request Review

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

✱ Stainless preview builds

This PR will update the grid SDKs with the following commit messages.

kotlin

fix(types): remove beneficialOwners field, flatten expectedActivityVolumes in BusinessInfo

openapi

fix(types): flatten expectedActivityVolumes, move beneficialOwners in business models

python

fix(types): restructure beneficial owners, flatten activity volumes in business types

typescript

fix(types): restructure beneficialOwners, flatten activity volumes, update field types in customers
grid-openapi studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅

⚠️ grid-python studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ✅

pip install https://pkg.stainless.com/s/grid-python/f0d5002b91a48ff0c2e61f8782271a8cd4aa2774/grid-0.0.1-py3-none-any.whl
grid-kotlin studio · code

Your SDK build had at least one "note" diagnostic.
generate ✅build ✅lint ✅test ✅

⚠️ grid-typescript studio · code

Your SDK build had a failure in the lint CI job, which is a regression from the base state.
generate ✅build ✅lint ❗test ✅

npm install https://pkg.stainless.com/s/grid-typescript/d8d1e774a4f7710875c431a50a60e7f871042790/dist.tar.gz

This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
If you push custom code to the preview branch, re-run this workflow to update the comment.
Last updated: 2026-03-21 00:17:51 UTC

@wuvictor-95 wuvictor-95 marked this pull request as ready for review March 20, 2026 23:54
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 20, 2026

Greptile Summary

This PR simplifies the business customer schema in two meaningful ways: (1) expectedActivityVolumes (a nested object) is replaced with flat top-level fields expectedMonthlyTransactionCount and expectedMonthlyTransactionVolume, and purposeOfAccount/sourceOfFunds are relaxed from enum-constrained types to free-form strings; (2) beneficialOwners is moved from the shared create/update request schema (BusinessCustomerFields) to the read-only response schema (BusinessCustomer), reflecting a shift toward managing beneficial owners via a dedicated flow.

  /\_/\  
 ( o.o )  wuvictor-95's PR is here!
  > ^ <   
  • Free-form KYB fieldspurposeOfAccount and sourceOfFunds now accept any descriptive string; the old PurposeOfAccount, SourceOfFunds, and ExpectedActivityVolumes component schemas are no longer referenced (though their YAML files still exist on disk — worth cleaning up)
  • Flattened activity fieldsexpectedActivityVolumes.monthlyTransactionCount / monthlyTransactionVolume become top-level expectedMonthlyTransactionCount / expectedMonthlyTransactionVolume; their examples still show enum-format values (100_TO_500, 100K_TO_1M), creating ambiguity about whether they accept arbitrary strings or still require specific bucketed values
  • beneficialOwners removed from request path — this is a breaking change; clients that currently submit beneficialOwners on create/update will silently lose that data unless they migrate to the expected dedicated endpoint
  • Generated bundles (openapi.yaml, mintlify/openapi.yaml) correctly reflect all component-level changes via make build
    /)  /)
  ( •ᴗ• )  double-check those examples!
  /づ づ  

Confidence Score: 3/5

  • This PR introduces intentional breaking changes (field renames, removal of beneficialOwners from requests) that need coordination with existing API consumers before merging.
  • The structural simplification is clean and the generated bundles are consistent. However, there are two concerns that lower confidence: (1) the example values for expectedMonthlyTransactionCount/Volume look like enum values but have no enum constraint, making the intended valid inputs ambiguous in the spec; and (2) removing beneficialOwners from the create/update request is a breaking change that lacks documentation or a deprecation notice in this PR.
  • openapi/components/schemas/customers/BusinessInfo.yaml and BusinessInfoUpdate.yaml (example/enum inconsistency); openapi/components/schemas/customers/BusinessCustomerFields.yaml (breaking removal of beneficialOwners from request schema)

Important Files Changed

Filename Overview
openapi/components/schemas/customers/BusinessInfo.yaml Replaces $ref enum schemas with inline free-form strings and flattens expectedActivityVolumes; purposeOfAccount and sourceOfFunds examples clearly signal free-form intent, but expectedMonthlyTransaction* examples still use enum-format values creating ambiguity about accepted input.
openapi/components/schemas/customers/BusinessInfoUpdate.yaml Mirror of BusinessInfo.yaml changes for the update path — same enum-to-free-form conversion and flattening of expectedActivityVolumes; carries the same example inconsistency concern.
openapi/components/schemas/customers/BusinessCustomerFields.yaml Removes beneficialOwners from the shared create/update request schema — a breaking change for existing consumers who previously submitted beneficial owner data inline; should be coordinated with a dedicated beneficial-owner endpoint.
openapi/components/schemas/customers/BusinessCustomer.yaml Moves beneficialOwners (as UltimateBeneficialOwner[]) into the read-only response schema; structural change is clean and consistent with the intent to separate ownership management into a dedicated flow.
openapi/paths/customers/customers.yaml Request example updated to use the new flat fields and free-form values; purely cosmetic, consistent with schema changes.
openapi.yaml Generated bundle (via make build); faithfully reflects all component changes — do not edit directly per CLAUDE.md.
mintlify/openapi.yaml Generated Mintlify bundle; mirrors openapi.yaml changes correctly.

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class BusinessCustomerCreateRequest {
        +CustomerCreateRequest
        +BusinessCustomerFields
        +businessInfo: BusinessInfo
    }
    class BusinessCustomerUpdateRequest {
        +CustomerUpdateRequest
        +BusinessCustomerFields
    }
    class BusinessCustomerFields {
        +customerType: BUSINESS
        +kybStatus: KybStatus
        +address: Address
        +businessInfo: BusinessInfoUpdate
        -beneficialOwners REMOVED
    }
    class BusinessCustomer {
        +Customer
        +BusinessCustomerFields
        +businessInfo: BusinessInfo
        +beneficialOwners: UltimateBeneficialOwner[] MOVED HERE
    }
    class BusinessInfo {
        +legalName: string
        +purposeOfAccount: string (free-form)
        +sourceOfFunds: string (free-form)
        +expectedMonthlyTransactionCount: string (was nested)
        +expectedMonthlyTransactionVolume: string (was nested)
        +expectedRecipientJurisdictions: string[]
    }
    class BusinessInfoUpdate {
        +purposeOfAccount: string (free-form)
        +sourceOfFunds: string (free-form)
        +expectedMonthlyTransactionCount: string (was nested)
        +expectedMonthlyTransactionVolume: string (was nested)
    }

    BusinessCustomerCreateRequest --> BusinessCustomerFields
    BusinessCustomerCreateRequest --> BusinessInfo
    BusinessCustomerUpdateRequest --> BusinessCustomerFields
    BusinessCustomerFields --> BusinessInfoUpdate
    BusinessCustomer --> BusinessInfo
    BusinessCustomer --> BusinessCustomerFields
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/BusinessInfo.yaml
Line: 50-57

Comment:
**Example values hint at enum intent, but no constraint exists**

`expectedMonthlyTransactionCount` and `expectedMonthlyTransactionVolume` still use enum-format examples (`100_TO_500`, `100K_TO_1M`) — unlike `purposeOfAccount` and `sourceOfFunds`, which were clearly updated to free-form text examples (`"Payout to contractors"`, `"Funds derived from customer payments for software services"`).

This mixed style leaves API consumers uncertain whether these two fields still require an exact bucketed string (like the old enum) or accept arbitrary free-form input. If they still expect only the predefined buckets, the `enum` constraint should be restored:

```yaml
  expectedMonthlyTransactionCount:
    type: string
    description: Expected number of transactions per month
    enum:
      - LESS_THAN_10
      - 10_TO_100
      - 100_TO_500
      - 500_TO_1000
      - MORE_THAN_1000
    example: 100_TO_500
  expectedMonthlyTransactionVolume:
    type: string
    description: Expected total transaction volume per month in USD equivalent
    enum:
      - LESS_THAN_10K
      - 10K_TO_100K
      - 100K_TO_1M
      - 1M_TO_10M
      - MORE_THAN_10M
    example: 100K_TO_1M
```

If they're truly free-form, the examples should be updated to reflect that (e.g., `"Around 200 per month"`).

The same inconsistency exists in `openapi/components/schemas/customers/BusinessInfoUpdate.yaml` at lines 48–55.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: openapi/components/schemas/customers/BusinessCustomerFields.yaml
Line: 13-14

Comment:
**`beneficialOwners` removed from create/update request — breaking change**

`BusinessCustomerFields` is composed into both `BusinessCustomerCreateRequest` and `BusinessCustomerUpdateRequest`. Removing `beneficialOwners` here means any existing client that currently sends `beneficialOwners` in a create or PATCH request will silently have that data ignored (or receive an unexpected validation error, depending on server-side strictness).

Since there are dedicated `BeneficialOwnerCreateRequest` / `BeneficialOwnerUpdateRequest` schemas in the codebase, it looks like beneficial-owner management is moving to its own endpoint — which is a clean separation. But this is a **breaking change** for the existing contract, and it would be worth:

1. Confirming a corresponding dedicated endpoint for `beneficialOwners` is available (or soon will be), and
2. Adding a deprecation notice or changelog entry so existing integrators know to migrate.

```
 (\\_/)
(='.'=)  <- this bunny wants a migration guide!
(")_(")
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: openapi/components/schemas/customers/BusinessInfo.yaml
Line: 42-57

Comment:
**Orphaned component YAML files still present on disk**

`PurposeOfAccount.yaml`, `SourceOfFunds.yaml`, and `ExpectedActivityVolumes.yaml` are still present in `openapi/components/schemas/customers/` but are no longer referenced by `BusinessInfo.yaml` or `BusinessInfoUpdate.yaml` after this PR. They will be silently excluded from the bundled spec (`make build`) but leave dead files in the repo that could confuse future contributors.

Consider deleting them in a follow-up (or as part of this PR):
- `openapi/components/schemas/customers/PurposeOfAccount.yaml`
- `openapi/components/schemas/customers/SourceOfFunds.yaml`
- `openapi/components/schemas/customers/ExpectedActivityVolumes.yaml`

```
 (\_/)
 ( •_•)
 / >🗑️  nom nom orphaned files
```

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: "[kyb] simplify busin..."

Comment on lines +50 to +57
expectedMonthlyTransactionCount:
type: string
description: Expected number of transactions per month
example: 100_TO_500
expectedMonthlyTransactionVolume:
type: string
description: Expected total transaction volume per month in USD equivalent
example: 100K_TO_1M
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Example values hint at enum intent, but no constraint exists

expectedMonthlyTransactionCount and expectedMonthlyTransactionVolume still use enum-format examples (100_TO_500, 100K_TO_1M) — unlike purposeOfAccount and sourceOfFunds, which were clearly updated to free-form text examples ("Payout to contractors", "Funds derived from customer payments for software services").

This mixed style leaves API consumers uncertain whether these two fields still require an exact bucketed string (like the old enum) or accept arbitrary free-form input. If they still expect only the predefined buckets, the enum constraint should be restored:

  expectedMonthlyTransactionCount:
    type: string
    description: Expected number of transactions per month
    enum:
      - LESS_THAN_10
      - 10_TO_100
      - 100_TO_500
      - 500_TO_1000
      - MORE_THAN_1000
    example: 100_TO_500
  expectedMonthlyTransactionVolume:
    type: string
    description: Expected total transaction volume per month in USD equivalent
    enum:
      - LESS_THAN_10K
      - 10K_TO_100K
      - 100K_TO_1M
      - 1M_TO_10M
      - MORE_THAN_10M
    example: 100K_TO_1M

If they're truly free-form, the examples should be updated to reflect that (e.g., "Around 200 per month").

The same inconsistency exists in openapi/components/schemas/customers/BusinessInfoUpdate.yaml at lines 48–55.

Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/BusinessInfo.yaml
Line: 50-57

Comment:
**Example values hint at enum intent, but no constraint exists**

`expectedMonthlyTransactionCount` and `expectedMonthlyTransactionVolume` still use enum-format examples (`100_TO_500`, `100K_TO_1M`) — unlike `purposeOfAccount` and `sourceOfFunds`, which were clearly updated to free-form text examples (`"Payout to contractors"`, `"Funds derived from customer payments for software services"`).

This mixed style leaves API consumers uncertain whether these two fields still require an exact bucketed string (like the old enum) or accept arbitrary free-form input. If they still expect only the predefined buckets, the `enum` constraint should be restored:

```yaml
  expectedMonthlyTransactionCount:
    type: string
    description: Expected number of transactions per month
    enum:
      - LESS_THAN_10
      - 10_TO_100
      - 100_TO_500
      - 500_TO_1000
      - MORE_THAN_1000
    example: 100_TO_500
  expectedMonthlyTransactionVolume:
    type: string
    description: Expected total transaction volume per month in USD equivalent
    enum:
      - LESS_THAN_10K
      - 10K_TO_100K
      - 100K_TO_1M
      - 1M_TO_10M
      - MORE_THAN_10M
    example: 100K_TO_1M
```

If they're truly free-form, the examples should be updated to reflect that (e.g., `"Around 200 per month"`).

The same inconsistency exists in `openapi/components/schemas/customers/BusinessInfoUpdate.yaml` at lines 48–55.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 13 to 14
businessInfo:
$ref: ./BusinessInfoUpdate.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 beneficialOwners removed from create/update request — breaking change

BusinessCustomerFields is composed into both BusinessCustomerCreateRequest and BusinessCustomerUpdateRequest. Removing beneficialOwners here means any existing client that currently sends beneficialOwners in a create or PATCH request will silently have that data ignored (or receive an unexpected validation error, depending on server-side strictness).

Since there are dedicated BeneficialOwnerCreateRequest / BeneficialOwnerUpdateRequest schemas in the codebase, it looks like beneficial-owner management is moving to its own endpoint — which is a clean separation. But this is a breaking change for the existing contract, and it would be worth:

  1. Confirming a corresponding dedicated endpoint for beneficialOwners is available (or soon will be), and
  2. Adding a deprecation notice or changelog entry so existing integrators know to migrate.
 (\\_/)
(='.'=)  <- this bunny wants a migration guide!
(")_(")
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/BusinessCustomerFields.yaml
Line: 13-14

Comment:
**`beneficialOwners` removed from create/update request — breaking change**

`BusinessCustomerFields` is composed into both `BusinessCustomerCreateRequest` and `BusinessCustomerUpdateRequest`. Removing `beneficialOwners` here means any existing client that currently sends `beneficialOwners` in a create or PATCH request will silently have that data ignored (or receive an unexpected validation error, depending on server-side strictness).

Since there are dedicated `BeneficialOwnerCreateRequest` / `BeneficialOwnerUpdateRequest` schemas in the codebase, it looks like beneficial-owner management is moving to its own endpoint — which is a clean separation. But this is a **breaking change** for the existing contract, and it would be worth:

1. Confirming a corresponding dedicated endpoint for `beneficialOwners` is available (or soon will be), and
2. Adding a deprecation notice or changelog entry so existing integrators know to migrate.

```
 (\\_/)
(='.'=)  <- this bunny wants a migration guide!
(")_(")
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 42 to +57
purposeOfAccount:
$ref: ./PurposeOfAccount.yaml
type: string
description: The intended purpose for using the Grid account
example: Payout to contractors
sourceOfFunds:
$ref: ./SourceOfFunds.yaml
expectedActivityVolumes:
$ref: ./ExpectedActivityVolumes.yaml
type: string
description: The primary source of funds for the business
example: Funds derived from customer payments for software services
expectedMonthlyTransactionCount:
type: string
description: Expected number of transactions per month
example: 100_TO_500
expectedMonthlyTransactionVolume:
type: string
description: Expected total transaction volume per month in USD equivalent
example: 100K_TO_1M
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Orphaned component YAML files still present on disk

PurposeOfAccount.yaml, SourceOfFunds.yaml, and ExpectedActivityVolumes.yaml are still present in openapi/components/schemas/customers/ but are no longer referenced by BusinessInfo.yaml or BusinessInfoUpdate.yaml after this PR. They will be silently excluded from the bundled spec (make build) but leave dead files in the repo that could confuse future contributors.

Consider deleting them in a follow-up (or as part of this PR):

  • openapi/components/schemas/customers/PurposeOfAccount.yaml
  • openapi/components/schemas/customers/SourceOfFunds.yaml
  • openapi/components/schemas/customers/ExpectedActivityVolumes.yaml
 (\_/)
 ( •_•)
 / >🗑️  nom nom orphaned files
Prompt To Fix With AI
This is a comment left during a code review.
Path: openapi/components/schemas/customers/BusinessInfo.yaml
Line: 42-57

Comment:
**Orphaned component YAML files still present on disk**

`PurposeOfAccount.yaml`, `SourceOfFunds.yaml`, and `ExpectedActivityVolumes.yaml` are still present in `openapi/components/schemas/customers/` but are no longer referenced by `BusinessInfo.yaml` or `BusinessInfoUpdate.yaml` after this PR. They will be silently excluded from the bundled spec (`make build`) but leave dead files in the repo that could confuse future contributors.

Consider deleting them in a follow-up (or as part of this PR):
- `openapi/components/schemas/customers/PurposeOfAccount.yaml`
- `openapi/components/schemas/customers/SourceOfFunds.yaml`
- `openapi/components/schemas/customers/ExpectedActivityVolumes.yaml`

```
 (\_/)
 ( •_•)
 / >🗑️  nom nom orphaned files
```

How can I resolve this? If you propose a fix, please make it concise.

@wuvictor-95 wuvictor-95 merged commit c7adcda into main Mar 21, 2026
9 checks passed
@wuvictor-95 wuvictor-95 deleted the 03-20-_kyb_simplify_business_customer_object branch March 21, 2026 00:12
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.

2 participants