Skip to content

Conversation

@martinsaposnic
Copy link
Contributor

Summary

  • Add list (simple) + listPaginated (cursor-based) for customer, order, checkout
  • Move entity schemas from contracts/ to schemas/
  • Create shared PaginatedInputSchema for DRY pagination inputs
  • Add externalId to CreateCustomerInput and UpdateCustomerInput

Test plan

  • api-contract builds
  • mcp package type-checks
  • moneydevkit.com mcp.ts type-checks
  • mdk-checkout builds

🤖 Generated with Claude Code

- Add list (simple) + listPaginated (cursor-based) for customer, order, checkout
- Move entity schemas from contracts/ to schemas/:
  - ProductSchema, ProductDetailSchema, ProductPriceSchema -> schemas/product.ts
  - CheckoutStatusSchema, CheckoutTypeSchema, CheckoutListItemSchema -> schemas/checkout.ts
  - OrderWithRelationsSchema -> schemas/order.ts
- Create shared PaginatedInputSchema for DRY pagination inputs
- Add externalId to CreateCustomerInput and UpdateCustomerInput
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73d04311c6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Replace refinement-based validation with a discriminated union for
CustomerLookupInputSchema. This ensures exactly-one-of validation
translates properly to JSON Schema for MCP/AI tool compatibility.
@martinsaposnic
Copy link
Contributor Author

@codex review

xmcp requires .shape property for tool schema generation, which only
ZodObject has. ZodUnion (CustomerLookupInputSchema) lacks .shape.

Add CustomerLookupToolSchema as a flat object with all optional fields
for MCP tools, while keeping the discriminated union for contract
validation.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65406b9eb6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +45 to +49
export const CustomerLookupInputSchema = z.union([
CustomerLookupByIdSchema,
CustomerLookupByEmailSchema,
CustomerLookupByExternalIdSchema,
]);

Choose a reason for hiding this comment

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

P3 Badge Enforce exactly one customer lookup identifier

CustomerLookupInputSchema is documented as “exactly one identifier,” but the union of non‑strict objects will accept payloads with multiple identifiers (e.g., { id, email }) and silently strip extras. That can cause a caller to pass conflicting identifiers and still get a result based only on the first matching branch. If you need to enforce exclusivity, add .strict() and a refinement or use a discriminated union so multi‑field payloads are rejected.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check 5c433b1

@martinsaposnic martinsaposnic merged commit cd694ba into main Jan 29, 2026
2 checks passed
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.

3 participants