Feature QA checklists
Mock Data Architecture
Centralized mock data management using the @kulcare/mock-data package for consistent development and testing.
Package Structure
packages/mock-data/
├── src/
│ ├── cms/ # CMS module mock data
│ ├── auth/ # Authentication mock data
│ ├── growth/ # Growth module mock data
│ ├── utils/ # Generic utilities
│ └── index.ts # Main exportsUsage
Basic Import
import { mockDoctors, getDoctorsByClinic, type Doctor } from "@kulcare/mock-data"Service Integration
// In service files
if (import.meta.env.DEV && !useRealAPI) {
const filteredData = getDoctorsByClinic(clinicId)
return { success: true, data: filteredData }
}Available Utilities
CMS Data:
mockDoctors,getDoctorsByClinic(),getAvailableDoctors()mockCategories,getCategoriesByStatus(),getCategoryById()mockQueuePatients,getQueueByStatus(),getQueueByDoctor()mockPatients,searchPatients(),getPatientsByGender()
Auth Data:
mockUsers,getUserByEmail(),validateUserCredentials()mockClinics,getClinicById(),getClinicsForUser()
Growth Data:
mockSocialPosts,getPostsByStatus(),getPostsByPlatform()
Generic Utilities:
createMockService()- CRUD operations with filtering/paginationcreateMockApiResponse()- API response simulation with delaysmockUtils- Environment detection and logging
Environment Control
Mock data usage is controlled by environment variables:
VITE_USE_REAL_API=false(default) - Uses mock data in developmentVITE_USE_REAL_API=true- Forces real API usage
Benefits
- Centralized: All mock data in one package
- Type-safe: Full TypeScript support
- Reusable: Shared across apps and tests
- Maintainable: Easy to update and extend
- Testable: Utilities for different test scenarios
Development Workflow
- Add new mock data: Create in appropriate domain folder
- Add utilities: Use generic
createMockService()or custom functions - Update services: Import and use in API service files
- Test: Verify with
pnpm typecheckandpnpm build