# nalder23/ejercicios architecture

> Architecture diagram of the GitHub repository nalder23/ejercicios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nalder23/ejercicios
- Repository: https://github.com/nalder23/ejercicios

## Overview

#### Purpose and Runtime
This is a Java Spring Boot transaction-orchestration API for BREB/Neurona flows. It exposes HTTP endpoints to initiate and manage fund security, fund return, pledge confirmation, and transaction-core notification operations. Application entry points support both executable Spring Boot and servlet-container deployment:
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/SendTrxApplication.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/ServletInitializer.java`

#### HTTP API Boundary
`SendTrxController` implements the public controller contract and is the inbound boundary between client request DTOs and application services. Request/context models carry transaction, audit, device, office, agent, and service-point metadata.
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/ISendTrxController.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/SendTrxController.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/in/ContextTransaction.java`

#### Transaction Orchestration
`SendTrxServiceImpl` is the central application-service layer behind the controller. It coordinates transaction-specific implementations and maps inbound API payloads to downstream request/response contracts. The operation classes separate the principal financial workflows: secure funds, return funds, pledge confirmation, and core notification.
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/ISendTrxService.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SendTrxServiceImpl.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SecureFunds.java`

#### Downstream Integration Boundary
Outbound calls are isolated behind an API-client service and Spring `WebClient` configuration. Dedicated DTO namespaces define wire contracts for admin transactions, customer lookup, savings-account operations, notifications, and the send-transaction API, preventing those external schemas from becoming the public HTTP model.
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/ApiClientServiceImpl.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/config/WebClientConfig.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/admintrx/in`

#### Credentials and Token Lifecycle
Authentication material is obtained through a secret-management implementation, then acquired and cached through token services before outbound integration calls. This is a material operational boundary: runtime configuration must provide both downstream endpoints and secret/token settings.
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SecretManagerImpl.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/TokenService.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/TokenCacheService.java`

#### Audit, Errors, and Responses
Audit services and logging utilities track processing activity around transaction execution. A global exception handler converts domain failures—bad requests, missing resources, timeouts, and internal failures—into consistent API response DTOs rather than leaking integration errors across the HTTP boundary.
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/AuditServiceImpl.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/exception/GlobalExceptionHandler.java`
- `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/exception/ApiErrorResponse.java`

#### Deployment and Configuration
The service is containerized and has Docker Compose support. Kubernetes manifests define service, deployment, ingress, and ConfigMap resources for AWS-oriented environments, with parallel production manifests. Spring profile property files provide local, QA, and production runtime configuration; Swagger configuration indicates API documentation support.
- `srvapisendtrxbrebneurona-dev/Dockerfile`
- `srvapisendtrxbrebneurona-dev/deployment-aws.yml`
- `srvapisendtrxbrebneurona-dev/src/main/resources/application-prd.properties`

Main entry points: [`srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/SendTrxController.java`](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/SendTrxController.java) (SendTrx controller), [`srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/ApiClientServiceImpl.java`](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/ApiClientServiceImpl.java) (API client service), [`srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/SendTrxApplication.java`](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/SendTrxApplication.java) (Spring Boot application), [`srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SendTrxServiceImpl.java`](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SendTrxServiceImpl.java) (SendTrx service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_spring_app{{"Spring Boot application<br/>application entry point"}}
  node_servlet_initializer["Servlet initializer<br/>deployment entry point"]
end

subgraph group_api["HTTP API"]
  node_controller_contract["Controller contract<br/>HTTP interface"]
  node_send_controller["SendTrx controller<br/>REST controller"]
  node_transaction_context["Transaction context<br/>request DTO"]
  node_exception_handler["Global exception handler<br/>HTTP error boundary"]
  node_api_error["API error response<br/>response DTO"]
end

subgraph group_application["Transaction orchestration"]
  node_send_service["SendTrx service<br/>application service"]
  node_transaction_operations["Financial operations<br/>workflow implementations<br/>[SecureFunds.java]"]
  node_audit_service["Audit service"]
end

subgraph group_integration["Outbound integration"]
  node_api_client["API client service<br/>integration gateway"]
  node_webclient["WebClient configuration<br/>HTTP client config"]
  node_token_service["Token service<br/>credential lifecycle<br/>[TokenService.java]"]
  node_token_cache[("Token cache")]
  node_secret_manager["Secret manager<br/>secret provider"]
  node_downstream_services{{"BREB / Neurona services<br/>external APIs"}}
end

subgraph group_operations["Operations"]
end

subgraph group_deployment["Deployment"]
  node_container_deployment["Container and Kubernetes deployment<br/>deployment assets"]
  node_production_config["Production properties<br/>runtime configuration"]
end

node_spring_app -->|"starts HTTP API"| node_send_controller
node_servlet_initializer -->|"boots in container"| node_spring_app
node_controller_contract -.->|"implemented by"| node_send_controller
node_transaction_context -->|"request payload"| node_send_controller
node_send_controller -->|"delegates requests"| node_send_service
node_send_controller -.->|"failures handled by"| node_exception_handler
node_exception_handler -->|"returns"| node_api_error
node_send_service -->|"selects workflow"| node_transaction_operations
node_send_service -->|"records activity"| node_audit_service
node_transaction_operations -->|"executes downstream actions"| node_api_client
node_api_client -->|"uses"| node_webclient
node_api_client -->|"requests authorization"| node_token_service
node_token_service -->|"caches tokens"| node_token_cache
node_token_service -->|"obtains credentials"| node_secret_manager
node_api_client -->|"calls"| node_downstream_services
node_production_config -.->|"configures runtime"| node_spring_app
node_container_deployment -->|"packages and deploys"| node_spring_app

click node_spring_app "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/SendTrxApplication.java"
click node_servlet_initializer "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/ServletInitializer.java"
click node_controller_contract "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/ISendTrxController.java"
click node_send_controller "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/SendTrxController.java"
click node_transaction_context "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/in/ContextTransaction.java"
click node_exception_handler "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/exception/GlobalExceptionHandler.java"
click node_api_error "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/exception/ApiErrorResponse.java"
click node_send_service "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SendTrxServiceImpl.java"
click node_transaction_operations "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SecureFunds.java"
click node_audit_service "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/AuditServiceImpl.java"
click node_api_client "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/ApiClientServiceImpl.java"
click node_webclient "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/config/WebClientConfig.java"
click node_token_service "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/TokenService.java"
click node_token_cache "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/TokenCacheService.java"
click node_secret_manager "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SecretManagerImpl.java"
click node_container_deployment "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/Dockerfile"
click node_production_config "https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/resources/application-prd.properties"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_spring_app,node_servlet_initializer toneBlue
class node_controller_contract,node_send_controller,node_transaction_context,node_exception_handler,node_api_error toneAmber
class node_send_service,node_transaction_operations,node_audit_service toneMint
class node_api_client,node_webclient,node_token_service,node_token_cache,node_secret_manager,node_downstream_services toneRose
class node_container_deployment,node_production_config toneTeal
```

## Components

### Runtime

- [Spring Boot application](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/SendTrxApplication.java): application entry point · Supports executable application startup. · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/SendTrxApplication.java`
- [Servlet initializer](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/ServletInitializer.java): deployment entry point · Enables servlet-container deployment. · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/ServletInitializer.java`

### HTTP API

- [Controller contract](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/ISendTrxController.java): HTTP interface · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/ISendTrxController.java`
- [SendTrx controller](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/SendTrxController.java): REST controller · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/controller/SendTrxController.java`
- [Transaction context](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/in/ContextTransaction.java): request DTO · Carries transaction, audit, device, office, agent, and service-point data. · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/in/ContextTransaction.java`
- [Global exception handler](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/exception/GlobalExceptionHandler.java): HTTP error boundary · Maps domain and integration failures to API errors. · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/exception/GlobalExceptionHandler.java`
- [API error response](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/exception/ApiErrorResponse.java): response DTO · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/dto/exception/ApiErrorResponse.java`

### Transaction orchestration

- [SendTrx service](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SendTrxServiceImpl.java): application service · Maps API payloads and coordinates transaction flows. · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SendTrxServiceImpl.java`
- [Financial operations](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SecureFunds.java): workflow implementations · Secure funds, return funds, pledge confirmation, and core notification. · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SecureFunds.java`
- [Audit service](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/AuditServiceImpl.java): audit service · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/AuditServiceImpl.java`

### Outbound integration

- [API client service](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/ApiClientServiceImpl.java): integration gateway · Owns downstream request and response contracts. · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/ApiClientServiceImpl.java`
- [WebClient configuration](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/config/WebClientConfig.java): HTTP client config · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/config/WebClientConfig.java`
- [Token service](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/TokenService.java): credential lifecycle · Acquires tokens for downstream calls. · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/TokenService.java`
- [Token cache](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/TokenCacheService.java): token cache · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/TokenCacheService.java`
- [Secret manager](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SecretManagerImpl.java): secret provider · `srvapisendtrxbrebneurona-dev/src/main/java/com/bun/sendtrxbrebneurona/service/impl/SecretManagerImpl.java`
- **BREB / Neurona services**: external APIs · Admin transaction, customer, savings, and notification endpoints.

### Deployment

- [Container and Kubernetes deployment](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/Dockerfile): deployment assets · Docker image and AWS Kubernetes manifests deploy the service. · `srvapisendtrxbrebneurona-dev/Dockerfile`
- [Production properties](https://github.com/nalder23/ejercicios/blob/main/srvapisendtrxbrebneurona-dev/src/main/resources/application-prd.properties): runtime configuration · Supplies downstream endpoint and secret/token settings. · `srvapisendtrxbrebneurona-dev/src/main/resources/application-prd.properties`

## Connections

- Spring Boot application → SendTrx controller: starts HTTP API
- Servlet initializer → Spring Boot application: boots in container
- Controller contract → SendTrx controller: implemented by
- Transaction context → SendTrx controller: request payload
- SendTrx controller → SendTrx service: delegates requests
- SendTrx controller → Global exception handler: failures handled by
- Global exception handler → API error response: returns
- SendTrx service → Financial operations: selects workflow
- SendTrx service → Audit service: records activity
- Financial operations → API client service: executes downstream actions
- API client service → WebClient configuration: uses
- API client service → Token service: requests authorization
- Token service → Token cache: caches tokens
- Token service → Secret manager: obtains credentials
- API client service → BREB / Neurona services: calls
- Production properties → Spring Boot application: configures runtime
- Container and Kubernetes deployment → Spring Boot application: packages and deploys
