barsa 309dac630f Enhance order processing and caching mechanisms
- Introduced provisioning triggers in OrderCdcSubscriber to handle specific status changes and enqueue provisioning jobs.
- Implemented request coalescing in OrdersCacheService and CatalogCacheService to prevent duplicate Salesforce API calls during cache invalidation.
- Updated CatalogModule and OrdersModule to export additional services for improved module integration.
- Enhanced error handling and logging in various services to provide better insights during operations.
2025-11-06 17:01:34 +09:00
..

Customer Portal Documentation

This directory contains comprehensive system design documentation for the Customer Portal project.


📚 Core System Design Documents

System Architecture

Comprehensive overview of the entire system

  • System overview and high-level architecture
  • Architecture principles (Clean Architecture, DDD)
  • Monorepo structure and organization
  • Application layers (Portal, BFF, Domain)
  • Technology stack and infrastructure
  • Data flow and integration patterns
  • Deployment architecture

Start here for a complete understanding of the system.


Integration & Data Flow

External system integration patterns and data transformation

  • Integration architecture overview
  • Salesforce integration (REST API + Platform Events)
  • WHMCS integration (REST API + Webhooks)
  • Freebit SIM management integration
  • Domain mapper pattern (Map Once, Use Everywhere)
  • Data transformation flows
  • Error handling and retry strategies
  • Caching strategies

Read this to understand how external systems are integrated.


Domain Layer Design

Framework-agnostic type system and business logic

  • Domain-driven design principles
  • Provider pattern for multi-system abstraction
  • Type system architecture
  • Schema-driven validation with Zod
  • Adding new domains step-by-step
  • Import patterns and best practices

Read this to understand the domain layer and type system.


Authentication & Security

Security architecture and implementation

  • Authentication flow (JWT + Refresh Tokens)
  • Token management and rotation
  • Authorization and access control
  • Rate limiting strategies
  • Password security (Argon2id)
  • CSRF protection
  • PII redaction and data protection
  • Audit logging

Read this for security implementation details.


📖 Feature-Specific Documentation

Portal (Frontend)

Orders & Catalog

Integration Guides

BFF Integration Layer:

Salesforce:

API Integration:

Domain & Architecture

Validation & Data

Operations & Deployment

Getting Started:

Provisioning:

Logging:

Other Documentation


🗂️ Archived Documentation

Status reports and temporary implementation documents have been moved to _archive/:

  • Migration progress reports
  • Refactoring completion documents
  • Cleanup and audit documents
  • Priority tracking documents

These are kept for historical reference but are not part of the active system design.


🎯 Quick Start Guide

For New Developers

  1. Start with Core Design Documents:

  2. Set Up Your Environment:

  3. Understand Key Features:

For Backend Developers

  1. System Architecture - BFF architecture
  2. Integration & Data Flow - Integration patterns
  3. Authentication & Security - Auth implementation
  4. BFF Integration Patterns - Best practices

For Frontend Developers

  1. Portal Architecture - Frontend structure
  2. Domain Layer Design - Type system
  3. Portal Integration Overview - API integration
  4. Performance Optimization - Performance tips

For Integration Work

  1. Integration & Data Flow - Integration architecture
  2. Salesforce Portal Simple Guide
  3. Salesforce-WHMCS Mapping Reference
  4. SIM Management API Data Flow

For DevOps/Deployment

  1. Deployment Guide
  2. Provisioning Runbook
  3. Logging Guide

📋 Documentation Standards

When Adding New Documentation

  1. Place in appropriate category folder
  2. Use clear, descriptive filenames
  3. Update this README index
  4. Follow markdown best practices
  5. Include date and author information
  6. Keep documentation synchronized with code

Documentation Types

  • Design Documents: Architecture, patterns, and design decisions
  • Guides: Step-by-step instructions and tutorials
  • References: API documentation, data mappings, configuration
  • Status Reports: Move to _archive/ when outdated

Naming Conventions

  • Use UPPERCASE-WITH-DASHES.md for design documents
  • Use descriptive names that indicate content
  • Avoid version numbers in filenames
  • Use consistent prefixes for related docs

🤝 Contributing

When updating documentation:

  • Keep files organized in their respective categories
  • Update the changelog for significant changes
  • Ensure all links work correctly
  • Use relative links for internal documentation
  • Keep the README index updated
  • Archive outdated status reports

📞 Support

For questions about the system:

  1. Check the relevant design document
  2. Review related guides and references
  3. Check archived documents for historical context
  4. Contact the development team

Last Updated: October 2025
Maintained By: Development Team


📑 Complete File Index

View all documentation files

Core Design

  • SYSTEM-ARCHITECTURE.md
  • INTEGRATION-DATAFLOW.md
  • DOMAIN-LAYER-DESIGN.md
  • AUTHENTICATION-SECURITY.md

Architecture

  • architecture/MONOREPO-ARCHITECTURE.md
  • architecture/MODULAR-PROVISIONING-ARCHITECTURE.md
  • architecture/NEW-DOMAIN-ARCHITECTURE.md
  • architecture/ORDERS-ARCHITECTURE-REVIEW.md
  • architecture/PRODUCT-CATALOG-ARCHITECTURE.md

API & Integration

  • api/FREEBIT-SIM-MANAGEMENT.md
  • api/SIM-MANAGEMENT-API-DATA-FLOW.md

Authentication

  • auth/AUTH-MODULE-ARCHITECTURE.md
  • auth/AUTH-SCHEMA-IMPROVEMENTS.md
  • auth/DEVELOPMENT-AUTH-SETUP.md
  • auth/REDIS-TOKEN-FLOW-IMPLEMENTATION.md

BFF

  • bff/BFF-INTEGRATION-PATTERNS-ARCHITECTURE.md
  • bff/BFF-INTEGRATION-PATTERNS-GUIDE.md
  • bff/DB-MAPPERS.md

Domain

  • domain/DOMAIN-STRUCTURE.md
  • domain/PACKAGE-ORGANIZATION.md

Guides

  • guides/ADDRESS_SYSTEM.md
  • guides/DEPLOY.md
  • guides/GETTING_STARTED.md
  • guides/RUN.md
  • guides/STRUCTURE.md

Logging

  • logging/LOGGING.md
  • logging/LOGGING_LEVELS.md

Orders

  • orders/ORDER-FULFILLMENT-COMPLETE-GUIDE.md
  • orders/PORTAL-ORDERING-PROVISIONING.md

Portal

  • portal/PERFORMANCE.md
  • portal/PORTAL-ARCHITECTURE.md
  • portal/PORTAL-DATA-MODEL.md
  • portal/PORTAL-INTEGRATION-OVERVIEW.md
  • portal/PORTAL-NONTECH-PRESENTATION.md
  • portal/PORTAL-ROADMAP.md
  • portal/RECOMMENDED-LIB-STRUCTURE.md

Products

  • products/ADDON-INSTALLATION-LOGIC.md
  • products/BUNDLE_ANALYSIS.md

Provisioning

  • provisioning/RUNBOOK_PROVISIONING.md
  • provisioning/SUBSCRIPTION-SERVICE-MANAGEMENT.md
  • provisioning/TEMPORARY-DISABLED-MODULES.md

Salesforce

  • salesforce/SALESFORCE-ORDER-COMMUNICATION.md
  • salesforce/SALESFORCE-PORTAL-SECURITY-GUIDE.md
  • salesforce/SALESFORCE-PORTAL-SIMPLE-GUIDE.md
  • salesforce/SALESFORCE-PRODUCTS.md
  • salesforce/SALESFORCE-WHMCS-MAPPING-REFERENCE.md
  • salesforce/WHMCS_BILLING_ISSUES_RESOLUTION.md

Types

  • types/CONSOLIDATED-TYPE-SYSTEM.md
  • types/UNIFIED-PRODUCT-TYPES.md

Validation

  • validation/SIGNUP_VALIDATION_RULES.md
  • validation/VALIDATION_CLEANUP_SUMMARY.md
  • validation/VALIDATION_PATTERNS.md
  • validation/bff-validation-migration.md