# jdanbo/prueba_tecnica_acme_daniel_borja architecture

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

- Interactive diagram: https://gitdiagram.com/jdanbo/prueba_tecnica_acme_daniel_borja
- Repository: https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja

## Overview

ACME is a Node.js console employee-management application. A user enters through the menu, which collects commands and delegates the register, list, search, update, or delete use case to the service. The service validates and coordinates repository operations; the in-memory repository stores Employee entities. The README documents all five operations and business rules. Edges reflect the shown calls and documented layering; no database or external service is present.

Main entry points: [`src/services/EmployeeService.js`](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/services/EmployeeService.js) (Employee operations), [`src/ui/ConsoleUI.js`](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/ui/ConsoleUI.js) (Interactive menu), [`index.js`](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/index.js) (Application wiring), [`src/validators/EmployeeValidator.js`](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/validators/EmployeeValidator.js) (Employee validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and interface"]
  node_composition["Application wiring<br/>[index.js]"]
  node_console["Interactive menu<br/>[ConsoleUI.js]"]
end

subgraph group_usecases["Employee use cases"]
  node_service["Employee operations<br/>[EmployeeService.js]"]
end

subgraph group_rules["Business rules and errors"]
  node_validator["Employee validation"]
  node_validation_error["Validation error<br/>[ValidationError.js]"]
  node_notfound_error["Not-found error<br/>[NotFoundError.js]"]
end

subgraph group_storage["Employee storage"]
  node_repository[("In-memory repository")]
  node_employee["Employee entity<br/>[Employee.js]"]
end

node_user(("Console user"))

node_user -->|"enters commands"| node_console
node_composition -->|"creates"| node_console
node_composition -->|"creates"| node_service
node_composition -->|"creates"| node_repository
node_composition -->|"creates"| node_validator
node_console -->|"dispatches operations"| node_service
node_service -->|"validates data"| node_validator
node_service -->|"reads and writes"| node_repository
node_repository -->|"creates entities"| node_employee
node_validator -->|"throws"| node_validation_error
node_service -->|"throws"| node_validation_error
node_service -->|"throws"| node_notfound_error
node_console -->|"handles"| node_validation_error
node_console -->|"handles"| node_notfound_error

click node_composition "https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/index.js"
click node_console "https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/ui/ConsoleUI.js"
click node_service "https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/services/EmployeeService.js"
click node_validator "https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/validators/EmployeeValidator.js"
click node_validation_error "https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/errors/ValidationError.js"
click node_notfound_error "https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/errors/NotFoundError.js"
click node_repository "https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/repositories/InMemoryEmployeeRepository.js"
click node_employee "https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/models/Employee.js"

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_composition,node_console,node_user toneBlue
class node_service toneAmber
class node_validator,node_validation_error,node_notfound_error toneMint
class node_repository,node_employee toneRose
```

## Components

### Entry and interface

- [Application wiring](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/index.js): `index.js`
- [Interactive menu](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/ui/ConsoleUI.js): `src/ui/ConsoleUI.js`

### Employee use cases

- [Employee operations](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/services/EmployeeService.js): `src/services/EmployeeService.js`

### Business rules and errors

- [Employee validation](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/validators/EmployeeValidator.js): `src/validators/EmployeeValidator.js`
- [Validation error](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/errors/ValidationError.js): `src/errors/ValidationError.js`
- [Not-found error](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/errors/NotFoundError.js): `src/errors/NotFoundError.js`

### Employee storage

- [In-memory repository](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/repositories/InMemoryEmployeeRepository.js): `src/repositories/InMemoryEmployeeRepository.js`
- [Employee entity](https://github.com/jdanbo/prueba_tecnica_acme_daniel_borja/blob/main/src/models/Employee.js): `src/models/Employee.js`

### Other components

- **Console user**

## Connections

- Console user → Interactive menu: enters commands (evidence: `README.md`)
- Application wiring → Interactive menu: creates (evidence: `index.js`)
- Application wiring → Employee operations: creates (evidence: `index.js`)
- Application wiring → In-memory repository: creates (evidence: `index.js`)
- Application wiring → Employee validation: creates (evidence: `index.js`)
- Interactive menu → Employee operations: dispatches operations (evidence: `src/ui/ConsoleUI.js`)
- Employee operations → Employee validation: validates data (evidence: `src/services/EmployeeService.js`)
- Employee operations → In-memory repository: reads and writes (evidence: `src/services/EmployeeService.js`)
- In-memory repository → Employee entity: creates entities (evidence: `src/repositories/InMemoryEmployeeRepository.js`)
- Employee validation → Validation error: throws (evidence: `src/validators/EmployeeValidator.js`)
- Employee operations → Validation error: throws (evidence: `src/services/EmployeeService.js`)
- Employee operations → Not-found error: throws (evidence: `src/services/EmployeeService.js`)
- Interactive menu → Validation error: handles (evidence: `src/ui/ConsoleUI.js`)
- Interactive menu → Not-found error: handles (evidence: `src/ui/ConsoleUI.js`)
