Skip to content

feat(cli): add customer contact-verification commands#703

Closed
ls-bolt[bot] wants to merge 1 commit into
07-18-grid-cli-drift-fixesfrom
07-18-grid-cli-contact-verification
Closed

feat(cli): add customer contact-verification commands#703
ls-bolt[bot] wants to merge 1 commit into
07-18-grid-cli-drift-fixesfrom
07-18-grid-cli-contact-verification

Conversation

@ls-bolt

@ls-bolt ls-bolt Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

This PR has been claimed. The active PR is now #710.

Summary

Adds customer contact-verification commands to the Grid CLI — the email/phone verification flow required in some regulatory jurisdictions (e.g. EU). Stacked on the CLI drift-fix PR.

New commands:

  • grid customers verify-email <customerId>POST /customers/{id}/verify-email
  • grid customers confirm-email <customerId> --code <code>POST /customers/{id}/verify-email/confirm
  • grid customers verify-phone <customerId>POST /customers/{id}/verify-phone
  • grid customers confirm-phone <customerId> --code <code>POST /customers/{id}/verify-phone/confirm

Test plan

  • cd cli && npm run build — clean compile.
  • npm test — includes 4 new boundary tests asserting each command's method/path/body (34 tests total with the parent branch).

@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
grid-flow-builder Ignored Ignored Preview Jul 19, 2026 1:36am
grid-wallet-demo Ignored Ignored Preview Jul 19, 2026 1:36am

Request Review

@ls-bolt ls-bolt Bot added the bolt label Jul 18, 2026

akanter commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@ls-bolt

ls-bolt Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds four contact-verification CLI commands — verify-email, confirm-email, verify-phone, and confirm-phone — mirroring the regulatory verification flow required in some EU jurisdictions. All four commands follow the established customers.ts pattern exactly, with appropriate type usage (post<void> for the 204-trigger endpoints and post<Customer> for the confirm endpoints that return the updated customer object, consistent with the team's clarification on the previous review thread).

  • Four new subcommands are registered in customers.ts, each delegating to the correct API path (/customers/{id}/verify-email, /verify-email/confirm, /verify-phone, /verify-phone/confirm).
  • Tests in customers-verification.test.ts verify method, path, and request body for all four commands using the existing boundary-test harness.
  • README.md is updated with a matching usage block for the new commands.

Confidence Score: 5/5

Safe to merge — all four commands are additive, follow the existing pattern faithfully, and are covered by boundary tests.

The changes are purely additive new CLI subcommands that delegate to well-defined API endpoints. The type choices (post for trigger endpoints, post for confirm endpoints) correctly reflect the API contract discussed in the previous review thread, and the test harness validates method, path, and body for every command.

No files require special attention.

Important Files Changed

Filename Overview
cli/src/commands/customers.ts Adds four contact-verification commands; all follow the existing pattern correctly, using post for 204 trigger endpoints and post for confirm endpoints that return the updated customer.
cli/test/customers-verification.test.ts New boundary tests covering all four commands; validates method, path, and body (code field) using the shared runCli harness.
cli/README.md Adds a usage block for the four new verification commands and updates the update example to include the required --type discriminator.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    actor User
    participant CLI as Grid CLI
    participant API as Grid API

    User->>CLI: verify-email customerId
    CLI->>API: POST /customers/id/verify-email
    API-->>CLI: 204 No Content
    CLI-->>User: success true

    User->>CLI: confirm-email customerId --code 123456
    CLI->>API: POST /customers/id/verify-email/confirm
    API-->>CLI: 200 OK Customer
    CLI-->>User: success true with customer data

    User->>CLI: verify-phone customerId
    CLI->>API: POST /customers/id/verify-phone
    API-->>CLI: 204 No Content
    CLI-->>User: success true

    User->>CLI: confirm-phone customerId --code 654321
    CLI->>API: POST /customers/id/verify-phone/confirm
    API-->>CLI: 200 OK Customer
    CLI-->>User: success true with customer data
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    actor User
    participant CLI as Grid CLI
    participant API as Grid API

    User->>CLI: verify-email customerId
    CLI->>API: POST /customers/id/verify-email
    API-->>CLI: 204 No Content
    CLI-->>User: success true

    User->>CLI: confirm-email customerId --code 123456
    CLI->>API: POST /customers/id/verify-email/confirm
    API-->>CLI: 200 OK Customer
    CLI-->>User: success true with customer data

    User->>CLI: verify-phone customerId
    CLI->>API: POST /customers/id/verify-phone
    API-->>CLI: 204 No Content
    CLI-->>User: success true

    User->>CLI: confirm-phone customerId --code 654321
    CLI->>API: POST /customers/id/verify-phone/confirm
    API-->>CLI: 200 OK Customer
    CLI-->>User: success true with customer data
Loading

Reviews (2): Last reviewed commit: "feat(cli): add customer contact-verifica..." | Re-trigger Greptile

Comment thread cli/src/commands/customers.ts Outdated
@ls-bolt
ls-bolt Bot force-pushed the 07-18-grid-cli-drift-fixes branch from 60355e8 to d829484 Compare July 19, 2026 01:01
@ls-bolt
ls-bolt Bot force-pushed the 07-18-grid-cli-contact-verification branch from d8e8758 to 102281f Compare July 19, 2026 01:01
@ls-bolt

ls-bolt Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Revision — addressed Greptile review

  • Response typing (Greptile): the verify-email / verify-phone trigger endpoints return 204 No Content, so they now use post<void>. The confirm-email / confirm-phone variants keep post<Customer> (they do return the updated customer).

Faraday reviewed this PR as accept (no changes requested). npm test green.

@ls-bolt

ls-bolt Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@ls-bolt
ls-bolt Bot force-pushed the 07-18-grid-cli-drift-fixes branch from 90b36db to 0364499 Compare July 19, 2026 01:36
@ls-bolt
ls-bolt Bot force-pushed the 07-18-grid-cli-contact-verification branch from d573b9f to 876fe21 Compare July 19, 2026 01:36
@jklein24 jklein24 closed this Jul 19, 2026
jklein24 added a commit that referenced this pull request Jul 21, 2026
## Summary

Adds customer **contact-verification** commands to the Grid CLI — the
email/phone verification flow required in some regulatory jurisdictions
(e.g. EU). Stacked on the CLI drift-fix PR.

New commands:

- `grid customers verify-email <customerId>` — `POST
/customers/{id}/verify-email`
- `grid customers confirm-email <customerId> --code <code>` — `POST
/customers/{id}/verify-email/confirm`
- `grid customers verify-phone <customerId>` — `POST
/customers/{id}/verify-phone`
- `grid customers confirm-phone <customerId> --code <code>` — `POST
/customers/{id}/verify-phone/confirm`

## Test plan

- `cd cli && npm run build` — clean compile.
- `npm test` — includes 4 new boundary tests asserting each command's
method/path/body (34 tests total with the parent branch).

Original PR: #703

Co-authored-by: Jeremy <jeremy@lightspark.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants