Skip to content

C4 Diagram Draft for Clean Architecture (Phase 2)

Italo Pessoa edited this page Jul 18, 2024 · 2 revisions
%%{
  init: {
    'themeVariables': {
      'primaryColor': '#BB2528',
      'primaryTextColor': '#fff',
      'primaryBorderColor': '#7C0000',
      'lineColor': '#F8B229',
      'secondaryColor': '#006100',
      'tertiaryColor': '#fff'
    }
  }
}%%

graph LR
    subgraph Core
    subgraph Domain
            ICustomerService
            ICustomerRepository
            IProductService
            IOrderService
            IPaymentService
            IPaymentGatewayFactoryMethod
            IPaymentGateway
            IOrderRepository
            IOrderRepository
            IPaymentRepository
            IProductRepository
            IProductRepository
        end
       
         subgraph UseCase
            CreateOrderUseCase
            UpdateOrderStatusUseCase
            UpdateOrderPaymentUseCase
            GetOrderDetailUseCase
            GetAllOrderUseCase
            CreateCustomerUseCase
            CreateProductUseCase
            CreatePaymentUseCase
            UpdatePaymentStatusUseCase
        end
    end
   subgraph Application
            OrderController[OrdersService]
            CustomerController[CustomersService]
            ProductController[ProductsService]
            PaymentController[PaymentsService]
        end
    subgraph Presentation
        CustomerApiController
        ProductApiController
        PaymentApiController
        OrderApiController
    end

  subgraph Infrastructure
        subgraph Gateway
            MercadoPagoGateway[MercadoPago Gateway]
        end
        subgraph Persistence
           OrderRepository
           ProductRepository
           PaymentRepository
           CustomerRepository
        end
  end



CustomerApiController --> CustomerController
OrderApiController --> OrderController
PaymentApiController --> PaymentController
ProductApiController --> ProductController

CustomerController ----> ICustomerService
ProductController ----> IProductService
PaymentController ----> IPaymentService

CustomerController --> CreateCustomerUseCase
OrderController --> CreateOrderUseCase
OrderController --> GetOrderDetailUseCase
OrderController --> UpdateOrderStatusUseCase
OrderController --> UpdateOrderPaymentUseCase
OrderController --> GetAllOrderUseCase
OrderController --> IOrderService
ProductController --> CreateProductUseCase
PaymentController --> IPaymentGatewayFactoryMethod
PaymentController --> CreatePaymentUseCase
PaymentController --> UpdatePaymentStatusUseCase


CreateOrderUseCase --> IOrderRepository
UpdateOrderStatusUseCase --> IOrderRepository
UpdateOrderPaymentUseCase --> IOrderRepository
GetOrderDetailUseCase --> IOrderRepository
GetAllOrderUseCase --> IOrderRepository
CreateCustomerUseCase --> ICustomerRepository
CreateProductUseCase --> IProductRepository
CreatePaymentUseCase --> IPaymentRepository
UpdatePaymentStatusUseCase --> IPaymentRepository
UpdatePaymentStatusUseCase --> IPaymentGatewayFactoryMethod

MercadoPagoGateway --> IPaymentGateway
OrderRepository -----> IOrderRepository
CustomerRepository -----> ICustomerRepository
PaymentRepository -----> IPaymentRepository
ProductRepository -----> IProductRepository

Loading