T. Narantuya a95ec60859 Refactor address management and update related services for improved clarity and functionality
- Updated address retrieval in user service to replace billing info with a dedicated address method.
- Adjusted API endpoints to use `PATCH /api/me/address` for address updates instead of billing updates.
- Enhanced documentation to reflect changes in address management processes and API usage.
- Removed deprecated types and services related to billing address handling, streamlining the codebase.
2025-09-17 18:43:43 +09:00

6.6 KiB

Codebase Refactoring Review Implementation Plan

  • 1. Audit and reorganize component structure according to atomic design

    • Audit all components and categorize them properly (atoms, molecules, organisms, business)
    • Create proper folder structure for each component category
    • Move components to their correct atomic design locations
    • Requirements: 1.1, 1.2, 1.3, 1.4, 1.5
  • 1.1 Reorganize UI components (Atoms)

    • Ensure all basic UI components are properly structured in components/ui/
    • Standardize component folder structure with proper index files
    • Remove any business logic from atomic components
    • Requirements: 1.1, 1.2, 4.1, 4.2
  • 1.2 Create and organize common components (Molecules)

    • Move appropriate components from catalog to components/common/
    • Create proper molecule components that combine atoms
    • Ensure molecules are truly reusable across features
    • Requirements: 1.2, 6.1, 6.2, 6.3
  • 1.3 Organize layout components (Organisms)

    • Clean up layout component structure and remove legacy exports
    • Ensure layout components are properly categorized as organisms
    • Remove backward compatibility code from layout components
    • Requirements: 1.1, 2.2, 4.3
  • 2. Move business-specific components to feature modules

    • Move catalog components to features/catalog/components/
    • Move subscription-specific components to features/subscriptions/components/
    • Move billing-specific components to features/billing/components/
    • Requirements: 6.1, 6.2, 6.3, 6.4
  • 2.1 Migrate catalog components to feature module

    • Move ProductCard, ProductComparison, PricingDisplay to features/catalog/components/
    • Move OrderSummary, ConfigurationStep, and related components to catalog feature
    • Update all imports to use new catalog feature module locations
    • Requirements: 6.1, 6.2, 3.2
  • 2.2 Complete catalog feature module implementation

    • Implement proper hooks, services, and types for catalog feature
    • Remove TODO comments and complete feature module exports
    • Ensure catalog feature has complete public API
    • Requirements: 3.1, 3.2, 3.3, 5.1, 5.2
  • 2.3 Migrate other business components to appropriate features

    • Move subscription-specific components to subscriptions feature
    • Move billing-specific components to billing feature
    • Ensure proper encapsulation of business logic within features
    • Requirements: 6.1, 6.2, 6.3
  • 3. Clean up legacy code and TODO comments

    • Remove all legacy compatibility exports from layout components
    • Complete or remove all TODO comments in component index files
    • Remove deprecated component references and implementations
    • Requirements: 2.1, 2.2, 2.3, 5.1, 5.2
  • 3.1 Remove legacy layout exports

    • Remove legacy exports like "DashboardLayout as default" and "LegacyPageLayout"
    • Update all imports to use new layout component names
    • Remove backward compatibility code from layout index files
    • Requirements: 2.2, 2.3, 4.3
  • 3.2 Complete disabled component exports

    • Enable and implement all disabled exports in component index files
    • Remove TODO comments from main components index file
    • Complete common components implementation or remove placeholders
    • Requirements: 5.1, 5.2, 7.1, 7.2
  • 3.3 Clean up feature module TODO comments

    • Complete feature module implementations or remove placeholder exports
    • Remove legacy hook exports and deprecated compatibility code
    • Implement missing feature module functionality
    • Requirements: 3.1, 3.2, 5.1, 5.2
  • 4. Standardize component structure and naming

    • Ensure all components follow consistent PascalCase naming for files
    • Standardize folder structure with proper index files for all components
    • Fix any mixed naming patterns or inconsistent organization
    • Requirements: 4.1, 4.2, 4.3, 4.4
  • 4.1 Standardize component file naming

    • Ensure all component files use PascalCase naming (ProductCard.tsx)
    • Ensure all utility files use kebab-case naming (form-validation.ts)
    • Fix any inconsistent naming patterns throughout the codebase
    • Requirements: 4.1, 4.2
  • 4.2 Standardize component folder structure

    • Ensure all components have proper folder structure with index files
    • Create missing index files for components that lack them
    • Standardize export patterns across all component index files
    • Requirements: 4.2, 4.3, 7.3
  • 4.3 Update import statements throughout codebase

    • Update all imports to use new component locations after reorganization
    • Ensure consistent import patterns using the centralized design system
    • Remove any imports from old or deprecated component locations
    • Requirements: 2.4, 4.3, 7.4
  • 5. Complete component library exports and documentation

    • Enable all component category exports in main components index
    • Ensure all UI components are properly exported with types
    • Complete feature component exports and make them accessible
    • Requirements: 7.1, 7.2, 7.3, 7.4
  • 5.1 Complete main components index exports

    • Enable layout components export in main components index
    • Enable common components export in main components index
    • Remove TODO comments and complete component library exports
    • Requirements: 7.1, 7.2, 5.2
  • 5.2 Ensure proper TypeScript types for all exports

    • Add missing TypeScript interfaces for all component props
    • Ensure all component exports include proper type exports
    • Complete type definitions for feature module exports
    • Requirements: 7.2, 7.4, 4.4
  • 6. Validate and test refactored structure

    • Run comprehensive tests to ensure all components work after reorganization
    • Verify that all imports resolve correctly after component moves
    • Test that the atomic design structure is properly implemented
    • Requirements: 1.5, 2.5, 4.5, 6.5
  • 6.1 Test component functionality after reorganization

    • Run unit tests for all moved and refactored components
    • Test that component props and functionality remain intact
    • Verify that styling and theming work correctly after moves
    • Requirements: 8.1, 8.2, 8.3
  • 6.2 Validate atomic design implementation

    • Verify that atoms only contain basic UI elements without business logic
    • Ensure molecules properly combine atoms and are reusable
    • Confirm organisms are complex UI sections with proper composition
    • Requirements: 1.1, 1.2, 1.3, 6.3
  • 6.3 Final cleanup and optimization

    • Remove any unused files or components after reorganization
    • Optimize imports and exports for better tree-shaking
    • Run bundle analysis to ensure no performance regression
    • Requirements: 2.5, 5.5, 8.5