heyibad/quickbook-mcp

Add input validation to customer handler

开放

#1 创建于 2025年10月26日

 (1 条评论) (0 个反应) (0 位负责人)TypeScript (0 个派生)auto 404
enhancementgood first issuehacktoberfest

仓库指标

星标
 (1 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Description

The customer handler (create-quickbooks-customer.handler.ts) currently accepts any customer data without validating required fields. This can lead to API errors and poor user experience.

Proposed Solution

Add Zod schema validation for customer data before making API calls to QuickBooks.

Requirements

  • Create a Zod schema for customer data validation
  • Add validation before API call in createQuickbooksCustomer function
  • Return clear validation errors to the user
  • Update tests to cover validation scenarios

Example Implementation

\\ ypescript import { z } from 'zod';

const CustomerSchema = z.object({ DisplayName: z.string().min(1, 'Display name is required'), // Add other required fields }); \`n

Benefits

  • Better error messages for users
  • Catch errors before API calls
  • Improve code reliability

贡献者指南