enhancementgood first issuehacktoberfest
Repository metrics
- Stars
- (1 star)
- PR merge metrics
- (PR metrics pending)
Description
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