{"id":22433171,"url":"https://github.com/andresweitzel/apirest_electronic_devices_expressjs","last_synced_at":"2026-04-11T01:47:17.424Z","repository":{"id":177415633,"uuid":"659982996","full_name":"andresWeitzel/ApiRest_Electronic_Devices_ExpressJS","owner":"andresWeitzel","description":"Rest Api about electronic devices implemented with Express, Morgan, Railway ,NodeJS, Sequelize, Jest Testing, dotenv, cors, express-validator, Nodemon, Swagger, Swagger-ui, PostgreSQL, ohers.","archived":false,"fork":false,"pushed_at":"2025-01-24T21:57:21.000Z","size":1584,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T12:46:16.537Z","etag":null,"topics":["cors","dotenv","express-js","express-validator","integration-testing","jest-tests","morgan-middleware","nodejs","nodemon","postgresql","railway-app","sequelize-orm","supertest","swagger-api","swagger-ui","tdd","testing","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andresWeitzel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-29T01:56:21.000Z","updated_at":"2024-12-24T05:02:23.000Z","dependencies_parsed_at":"2024-12-19T03:26:00.164Z","dependency_job_id":"083255f8-0671-46da-8d5c-a27db69b2629","html_url":"https://github.com/andresWeitzel/ApiRest_Electronic_Devices_ExpressJS","commit_stats":null,"previous_names":["andresweitzel/apirest_dispositivos_electronicos_expressjs","andresweitzel/apirest_disp_electr_expressjs","andresweitzel/apirest_electronic_devices_expressjs"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresWeitzel%2FApiRest_Electronic_Devices_ExpressJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresWeitzel%2FApiRest_Electronic_Devices_ExpressJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresWeitzel%2FApiRest_Electronic_Devices_ExpressJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andresWeitzel%2FApiRest_Electronic_Devices_ExpressJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andresWeitzel","download_url":"https://codeload.github.com/andresWeitzel/ApiRest_Electronic_Devices_ExpressJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245806333,"owners_count":20675296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cors","dotenv","express-js","express-validator","integration-testing","jest-tests","morgan-middleware","nodejs","nodemon","postgresql","railway-app","sequelize-orm","supertest","swagger-api","swagger-ui","tdd","testing","unit-testing"],"created_at":"2024-12-05T22:14:09.189Z","updated_at":"2026-04-11T01:47:17.398Z","avatar_url":"https://github.com/andresWeitzel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![Index app](./doc/assets/componentes-example.png)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"right\"\u003e\n   \u003cimg width=\"25\" height=\"25\" src=\"./doc/assets/icons/backend/javascript-typescript/png/sequelize.png\" /\u003e\n   \u003cimg width=\"25\" height=\"25\" src=\"./doc/assets/icons/database/png/postgres.png\" /\u003e\n   \u003cimg width=\"25\" height=\"25\" src=\"./doc/assets/icons/backend/javascript-typescript/png/typescript.png\" /\u003e\n   \u003cimg width=\"25\" height=\"25\" src=\"./doc/assets/icons/devops/png/swagger.png\" /\u003e\n   \u003cimg width=\"25\" height=\"25\" src=\"./doc/assets/icons/backend/javascript-typescript/png/nodejs.png\" /\u003e\n   \u003cimg width=\"25\" height=\"25\" src=\"./doc/assets/icons/backend/javascript-typescript/png/express-js.png\" /\u003e\n   \u003cimg width=\"25\" height=\"25\" src=\"./doc/assets/icons/devops/png/postman.png\" /\u003e\n   \u003cimg width=\"25\" height=\"25\" src=\"./doc/assets/icons/devops/png/git.png\" /\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n\u003cdiv align=\"right\"\u003e\n     \u003ca href=\"./translations/README.es.md\" target=\"_blank\"\u003e\n       \u003cimg src=\"./doc/assets/translation/arg-flag.jpg\" width=\"65\" height=\"40\" /\u003e\n   \u003c/a\u003e\n    \u003ca href=\"./README.md\" target=\"_blank\"\u003e\n       \u003cimg src=\"./doc/assets/translation/eeuu-flag.jpg\" width=\"65\" height=\"40\" /\u003e\n   \u003c/a\u003e\n\u003c/div\u003e\n\n\n\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n# ApiRest Electronic Devices ExpressJS ![(status-completed)](./doc/assets/icons/badges/status-completed.svg)\n\n\n\u003c/div\u003e\n\nRest Api about electronic devices implemented with Express, Morgan, Railway ,NodeJS, Sequelize, Jest Testing, dotenv, cors, express-validator, nodemon, swagger, swagger-ui, PostgreSQL, Docker, others.\n\n*   [Postman Collection](./postman/collections/Api_DispElectr_Express.postman_collection.json)\n*   [Functionality Test Playlist](https://www.youtube.com/playlist?list=PLCl11UFjHurDLAizKGgiChAKBJx1V19Fo)\u003ca href=\"https://www.youtube.com/playlist?list=PLCl11UFjHurDLAizKGgiChAKBJx1V19Fo\" target=\"_blank\" \u003e \u003cimg src=\"./doc/assets/social-networks/yt.png\" width=\"25\" /\u003e \u003c/a\u003e\n\n\u003cbr\u003e\n\n## Index 📜\n\n\u003cdetails\u003e\n  \u003csummary\u003eView details\u003c/summary\u003e\n\n\u003cdiv align=\"right\"\u003e\n\n`Latest update: 19/02/26` \n\n\u003c/div\u003e\n\n### Section 1) Description, configuration and technologies\n\n*   [1.0) Project Description.](#10-description-)\n*   [1.1) Project Execution.](#11-project-execution-)\n*   [1.2) Project configuration from scratch](#12-project-configuration-from-scratch-)\n*   [1.3) Database Configuration with Docker and PostgreSQL](#13-database-configuration-with-docker-and-postgresql-)\n*   [1.4) Technologies.](#14-technologies-)\n\n### Section 2) Testing Documentation and Implementation\n\n*   [2.0) Testing Overview.](#20-testing-overview-)\n*   [2.1) Testing Structure.](#21-testing-structure-)\n*   [2.2) Testing Commands.](#22-testing-commands-)\n*   [2.3) Test Types.](#23-test-types-)\n*   [2.4) Test Configuration.](#24-test-configuration-)\n*   [2.5) Test Coverage.](#25-test-coverage-)\n*   [2.6) Test Cases.](#26-test-cases-)\n*   [2.7) Troubleshooting.](#27-troubleshooting-)\n*   [2.8) Quality Metrics.](#28-quality-metrics-)\n*   [2.9) Maintenance.](#29-maintenance-)\n\n### Section 3) Endpoints and Examples\n\n*   [3.0) EndPoints and resources.](#30-endpoints-and-resources-)\n\n### Section 4) Functionality Testing and References\n\n*   [4.0) Functionality test.](#40-functionality-test-)\n*   [4.1) References.](#41-references-)\n*   [4.2) Postman Collection.](#42-postman-collection-)\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## Section 1) Description, configuration and technologies\n\n### 1.0) Description [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n### 1.0.0) General Description\n\n**ApiRest_Electronic_Devices_ExpressJS** is a comprehensive REST API designed to manage electronic components inventory and specifications. This project provides a robust backend solution for electronic device management systems, featuring advanced search capabilities, detailed component specifications, and a scalable architecture.\n\n**Key Features:**\n- **Multi-Component Support**: Manages various electronic components including transistors, capacitors, resistors, microcontrollers, and development boards\n- **Advanced Search \u0026 Filtering**: Sophisticated search capabilities with multiple criteria and pagination\n- **Comprehensive API Documentation**: Auto-generated Swagger documentation for all endpoints\n- **Robust Testing Suite**: Extensive unit and integration tests with \u003e90% code coverage\n- **Database Management**: PostgreSQL database with Docker containerization for easy deployment\n- **Validation \u0026 Error Handling**: Comprehensive input validation and error management\n- **Scalable Architecture**: Modular design with clear separation of concerns\n\n**Target Users:**\n- Electronic component suppliers and distributors\n- Electronics engineering teams\n- Inventory management systems\n- Educational institutions teaching electronics\n- Hobbyists and makers managing component collections\n\n### 1.0.1) Description Architecture and Operation\n\n**Architecture Overview:**\nThe application follows a **layered architecture pattern** with clear separation of concerns:\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    Presentation Layer                       │\n│  ┌─────────────────┐  ┌─────────────────┐  ┌──────────────┐ │\n│  │   API Routes    │  │   Middleware    │  │   Swagger    │ │\n│  │                 │  │                 │  │ Documentation│ │\n│  └─────────────────┘  └─────────────────┘  └──────────────┘ │\n└─────────────────────────────────────────────────────────────┘\n┌─────────────────────────────────────────────────────────────┐\n│                    Business Logic Layer                     │\n│  ┌─────────────────┐  ┌─────────────────┐  ┌──────────────┐ │\n│  │   Controllers   │  │    Services     │  │   Helpers    │ │\n│  │                 │  │                 │  │              │ │\n│  └─────────────────┘  └─────────────────┘  └──────────────┘ │\n└─────────────────────────────────────────────────────────────┘\n┌─────────────────────────────────────────────────────────────┐\n│                    Data Access Layer                        │\n│  ┌─────────────────┐  ┌─────────────────┐  ┌──────────────┐ │\n│  │    Models       │  │   Sequelize     │  │  PostgreSQL  │ │\n│  │                 │  │     ORM         │  │  Database    │ │\n│  └─────────────────┘  └─────────────────┘  └──────────────┘ │\n└─────────────────────────────────────────────────────────────┘\n```\n\n**Core Components:**\n\n1. **Routes Layer** (`src/config/routes/`):\n   - RESTful API endpoints for each component type\n   - Request routing and HTTP method handling\n   - URL parameter processing\n\n2. **Controllers Layer** (`src/controllers/`):\n   - Request/response handling\n   - Input validation and sanitization\n   - Business logic coordination\n   - Error response formatting\n\n3. **Services Layer** (`src/services/`):\n   - Core business logic implementation\n   - Database operations through Sequelize\n   - Data transformation and processing\n   - Complex query handling\n\n4. **Models Layer** (`src/models/sequelize/`):\n   - Database schema definitions\n   - Sequelize model configurations\n   - Table relationships and associations\n   - Data validation rules\n\n5. **Database Layer**:\n   - PostgreSQL database engine\n   - Docker containerization\n   - Connection pooling and optimization\n   - Data persistence and retrieval\n\n**Data Flow:**\n1. **Request Reception**: HTTP requests are received by Express.js\n2. **Middleware Processing**: CORS, logging, and validation middleware process the request\n3. **Route Matching**: Express router matches the request to appropriate endpoint\n4. **Controller Execution**: Controller validates input and calls appropriate service\n5. **Service Processing**: Service layer handles business logic and database operations\n6. **Response Generation**: Formatted response is sent back to client\n\n**Component Types Supported:**\n- **Components** (`componentes`): Base component information (code, description, price, stock)\n- **Component Details** (`componentes_detalles`): Technical specifications and datasheets\n- **Bipolar Transistors** (`transistores_bipolares`): BJT specifications and parameters\n- **MOSFET Transistors** (`transistores_mosfet`): MOSFET characteristics and ratings\n- **Electrolytic Capacitors** (`capacitores_electroliticos`): Capacitor specifications\n\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 1.1) Project Execution [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n\n\u003cbr\u003e\n\n#### [Watch playlist](https://www.youtube.com/playlist?list=PLCl11UFjHurDLAizKGgiChAKBJx1V19Fo)\n\n  \u003ca href=\"https://www.youtube.com/playlist?list=PLCl11UFjHurDLAizKGgiChAKBJx1V19Fo\"\u003e\n    \u003cimg src=\"./doc/assets/componentes-example-yt.png\" /\u003e\n  \u003c/a\u003e\n\n\u003cbr\u003e      \n\n### 1.1.0) Initial settings\n\n#### Prerequisites\nBefore starting, ensure you have the following installed:\n- **Node.js** (v18 LTS or higher) - [Download here](https://nodejs.org/en/download)\n- **Docker Desktop** - [Download here](https://www.docker.com/products/docker-desktop/)\n- **Git** - [Download here](https://git-scm.com/downloads)\n- **IDE** (VS Code recommended) - [Download here](https://code.visualstudio.com/)\n\n#### Step 1: Clone and Setup Project\n\n1. **Clone the repository:**\n```bash\ngit clone https://github.com/andresWeitzel/ApiRest_Dispositivos_Electronicos_ExpressJS\n```\n\n2. **Navigate to project directory:**\n```bash\ncd ApiRest_Dispositivos_Electronicos_ExpressJS\n```\n\n3. **Install dependencies:**\n```bash\nnpm install\n```\n\n#### Step 2: Database Setup\n\n1. **Start PostgreSQL database with Docker:**\n```bash\ndocker-compose up -d\n```\n\n2. **Verify database container is running (optional):**\n```bash\ndocker ps\n```\n\n3. **Check database logs (optional):**\n```bash\ndocker-compose logs postgres\n```\n\n4. **Reset database if needed (optional):**\n```bash\ndocker-compose down -v\ndocker-compose up -d\n```\n\n#### Step 3: Run the Application\n\n**Development Mode (with auto-reload):**\n```bash\nnpm run start:dev\n```\n\n**Production Mode:**\n```bash\nnpm start\n```\n\n**Alternative development command:**\n```bash\nnpm run dev\n```\n\n#### Step 4: Verify Installation\n\n1. **Check if server is running:**\n   - Look for: `Server is running on port 8082`\n   - Look for: `Swagger documentation available at http://localhost:8082/api-docs`\n\n2. **Access the application:**\n   - **API Base URL**: `http://localhost:8082`\n   - **Swagger Documentation**: `http://localhost:8082/api-docs`\n   - **Health Check**: `http://localhost:8082/api/v1/health`\n\n#### Troubleshooting\n\n**Port Already in Use:**\n```bash\n# Kill processes using port 8082\nnpx kill-port 8082\n\n# Or find and kill specific process\nnetstat -ano | findstr :8082\ntaskkill /PID \u003cPID\u003e /F\n```\n\n**Database Connection Issues:**\n```bash\n# Check if Docker is running\ndocker --version\n\n# Check container status\ndocker-compose ps\n\n# Restart containers\ndocker-compose restart\n\n# View detailed logs\ndocker-compose logs postgres\n```\n\n**Node.js Version Issues:**\n```bash\n# Check Node.js version\nnode --version\n\n# Use nvm to switch versions (if installed)\nnvm use 18\n```\n\n**Permission Issues (Linux/Mac):**\n```bash\n# Fix Docker permissions\nsudo usermod -aG docker $USER\n# Log out and log back in\n```\n\n#### Available Scripts\n\n| Command | Description |\n|---------|-------------|\n| `npm start` | Start production server |\n| `npm run start:dev` | Start development server with auto-reload |\n| `npm run dev` | Alternative development command |\n| `npm test` | Run all tests |\n| `npm run test:watch` | Run tests in watch mode |\n| `npm run test:cov` | Run tests with coverage |\n| `npm run test:unit` | Run unit tests only |\n| `npm run test:integration` | Run integration tests only |\n| `npm run format-prettier` | Format code with Prettier |\n| `npm run check` | Check markdown formatting |\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 1.2) Project configuration from scratch [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n### 1.2.0) Initial settings\n\nThis section guides you through setting up the project from scratch, including all dependencies, project structure, and configuration.\n\n#### Prerequisites\n- **Node.js** (v18 LTS or higher) - [Download here](https://nodejs.org/en/download)\n- **Docker Desktop** - [Download here](https://www.docker.com/products/docker-desktop/)\n- **Git** - [Download here](https://git-scm.com/downloads)\n- **IDE** (VS Code recommended) - [Download here](https://code.visualstudio.com/)\n\n#### Step 1: Project Initialization\n\n1. **Create project directory:**\n```bash\nmkdir ApiRest_Electronic_Devices_ExpressJS\ncd ApiRest_Electronic_Devices_ExpressJS\n```\n\n2. **Initialize Node.js project:**\n```bash\nnpm init -y\n```\n\n3. **Create project structure:**\n```bash\nmkdir -p src/{config/{middleware,routes},controllers,db,enums,helpers,models,services,test,utils}\nmkdir -p src/controllers/{component,component-detail,bipolar-transistor,mosfet-transistor,electrolytic-capacitor}\nmkdir -p src/services/{component,component-detail,bipolar-transistor,mosfet-transistor,electrolytic-capacitor}\nmkdir -p src/models/sequelize\nmkdir -p src/test/{unit-test,integration-test,mock}\nmkdir -p src/test/unit-test/{helpers,services}\nmkdir -p src/test/unit-test/helpers/{pagination,validations}\nmkdir -p doc/{assets,translation}\nmkdir -p init\nmkdir -p postman/collections\nmkdir -p scripts\n```\n\n#### Step 2: Core Dependencies Installation\n\n1. **Install production dependencies:**\n```bash\n# Core framework and middleware\nnpm install express cors morgan dotenv dotenv-expand\n\n# Database and ORM\nnpm install sequelize pg pg-hstore\n\n# API documentation\nnpm install swagger-ui-express swagger-jsdoc\n\n# Logging\nnpm install winston\n\n# Body parsing\nnpm install body-parser\n```\n\n2. **Install development dependencies:**\n```bash\n# Development server\nnpm install --save-dev nodemon\n\n# Testing framework\nnpm install --save-dev jest supertest\n\n# Code formatting and linting\nnpm install --save-dev prettier\n\n# Markdown linting\nnpm install --save-dev remark-cli remark-preset-lint-recommended remark-lint-emphasis-marker remark-lint-strong-marker remark-lint-table-cell-padding remark-preset-lint-consistent\n\n# Validation\nnpm install --save-dev express-validator\n\n# Utilities\nnpm install --save-dev express-list-endpoints sqlite3\n```\n\n#### Step 3: Configuration Files\n\n1. **Create .gitignore:**\n```bash\n# Dependencies\nnode_modules/\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Environment variables\n.env\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\n# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Coverage directory used by tools like istanbul\ncoverage/\n*.lcov\n\n# nyc test coverage\n.nyc_output\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# Optional npm cache directory\n.npm\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variables file\n.env\n\n# IDE files\n.vscode/\n.idea/\n*.swp\n*.swo\n\n# OS generated files\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db\n\n# Test reports\ntest-report.json\n```\n\n2. **Create package.json scripts:**\n```json\n{\n  \"scripts\": {\n    \"start\": \"node src/server.js\",\n    \"start:dev\": \"nodemon src/server.js\",\n    \"dev\": \"nodemon src/server.js\",\n    \"test\": \"jest --verbose\",\n    \"test:watch\": \"jest --watch --verbose\",\n    \"test:cov\": \"jest --coverage --verbose\",\n    \"test:unit\": \"jest --verbose ./src/test/unit-test\",\n    \"test:integration\": \"jest --verbose ./src/test/integration-test\",\n    \"test:pagination-helpers\": \"jest --verbose ./src/test/unit-test/helpers/pagination/*\",\n    \"test:services\": \"jest --verbose ./src/test/unit-test/services/*\",\n    \"test:validations\": \"jest --verbose ./src/test/unit-test/helpers/validations/*\",\n    \"test:all\": \"node scripts/run-tests.js\",\n    \"format-prettier\": \"prettier --write \\\"{src,test}/**/*.{js,ts}\\\"\",\n    \"check\": \"remark . --quiet --frail\",\n    \"format-remark\": \"remark . --quiet --frail --output\",\n    \"format-md\": \"remark . --output\"\n  }\n}\n```\n\n#### Step 4: Database Configuration\n\n1. **Create docker-compose.yml:**\n```yaml\nversion: '3.8'\n\nservices:\n  postgres:\n    image: postgres:15\n    container_name: electronic_devices_db\n    environment:\n      POSTGRES_DB: dispositivos_electronicos\n      POSTGRES_USER: dispositivos_user\n      POSTGRES_PASSWORD: dispositivos_pass\n    ports:\n      - \"5432:5432\"\n    volumes:\n      - postgres_data:/var/lib/postgresql/data\n      - ./init:/docker-entrypoint-initdb.d\n    command: \u003e\n      postgres\n      -c shared_buffers=256MB\n      -c effective_cache_size=1GB\n      -c maintenance_work_mem=64MB\n      -c wal_buffers=16MB\n      -c work_mem=4MB\n\nvolumes:\n  postgres_data:\n```\n\n2. **Create .env file:**\n```env\n# Database Configuration\nDB_NAME_PROD=dispositivos_electronicos\nDB_USER_PROD=dispositivos_user\nDB_PASS_PROD=dispositivos_pass\nDB_HOST_PROD=localhost\nDB_DIALECT_PROD=postgres\nDB_PORT_PROD=5432\n\n# Application Configuration\nPROD_PORT=8082\nAPP_PORT=8082\n\n# API Endpoints\nAPI_LOCAL_BASE_URL=http://localhost:8082\nAPI_COMPONENT_NAME_URL=/api/v1/componentes\nAPI_COMPONENT_DETAIL_NAME_URL=/api/v1/componentes-detalles\nAPI_BIPOLAR_TRANSISTOR_NAME_URL=/api/v1/transistores-bipolares\nAPI_ELECTROLYTIC_CAPACITOR_NAME_URL=/api/v1/capacitores-electroliticos\n```\n\n#### Step 5: Core Application Files\n\n1. **Create src/server.js:**\n```javascript\nrequire('dotenv').config();\n\nconst PORT = process.env.PROD_PORT || process.env.APP_PORT || 8082;\nconst { appMiddleware } = require('./config/middleware/index');\nconst { swaggerDocs } = require('./utils/swagger');\nconst { defineAssociations } = require('./models/sequelize/associations');\n\nlet app;\n\nconst run = async () =\u003e {\n  try {\n    defineAssociations();\n    app = await appMiddleware();\n    \n    app.listen(PORT, async () =\u003e {\n      console.log(`Server is running on port ${PORT}`);\n      await swaggerDocs(app, PORT);\n    });\n  } catch (error) {\n    console.log(`Error in run() function: ${error}`);\n  }\n};\n\nrun();\n```\n\n2. **Create Jest configuration (jest.config.js):**\n```javascript\nconst config = {\n  setupFilesAfterEnv: ['./src/test/mock/set-env-vars.js'],\n  testEnvironment: 'node',\n  collectCoverageFrom: [\n    'src/**/*.js',\n    '!src/test/**',\n    '!src/server.js'\n  ],\n  coverageDirectory: 'coverage',\n  coverageReporters: ['text', 'lcov', 'html']\n};\n\nmodule.exports = config;\n```\n\n#### Step 6: Start Development\n\n1. **Start database:**\n```bash\ndocker-compose up -d\n```\n\n2. **Run the application:**\n```bash\n# Development mode\nnpm run start:dev\n\n# Production mode\nnpm start\n```\n\n3. **Run tests:**\n```bash\n# All tests\nnpm test\n\n# Unit tests only\nnpm run test:unit\n\n# Integration tests only\nnpm run test:integration\n\n# With coverage\nnpm run test:cov\n```\n\n#### Step 7: Additional Configuration\n\n1. **Create README.md with project documentation**\n2. **Set up Postman collection for API testing**\n3. **Configure VS Code settings for consistent development**\n4. **Set up CI/CD pipeline (optional)**\n\n#### Project Structure Overview\n\n```\nApiRest_Electronic_Devices_ExpressJS/\n├── src/\n│   ├── config/\n│   │   ├── middleware/\n│   │   └── routes/\n│   ├── controllers/\n│   ├── db/\n│   ├── enums/\n│   ├── helpers/\n│   ├── models/\n│   ├── services/\n│   ├── test/\n│   ├── utils/\n│   └── server.js\n├── doc/\n├── init/\n├── postman/\n├── scripts/\n├── docker-compose.yml\n├── jest.config.js\n├── package.json\n└── README.md\n```\n\nThis structure provides a scalable and maintainable foundation for the electronic devices API project.\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 1.3) Database Configuration with Docker and PostgreSQL [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n### 1.3.0) Database Overview\n\nThis project uses **PostgreSQL** as the database engine, containerized with **Docker** for easy setup and deployment. The database contains information about electronic components including:\n\n*   **Components** (`componentes`): Main table with basic component information\n*   **Component Details** (`componentes_detalles`): Technical specifications and datasheets\n*   **Bipolar Transistors** (`transistores_bipolares`): Specific transistor data\n*   **MOSFET Transistors** (`transistores_mosfet`): MOSFET transistor specifications\n*   **Electrolytic Capacitors** (`capacitores_electroliticos`): Capacitor specifications\n\n\n### 1.3.1) Docker Setup\n\nThe project includes a `docker-compose.yml` file that automatically sets up PostgreSQL with all necessary configurations:\n\n**Database Configuration:**\n*   **Image**: PostgreSQL 15\n*   **Port**: 5432 (standard PostgreSQL port)\n*   **Database Name**: `dispositivos_electronicos`\n*   **Username**: `dispositivos_user`\n*   **Password**: `dispositivos_pass`\n\n**Performance Optimizations:**\n*   Shared buffers: 256MB\n*   Effective cache size: 1GB\n*   Maintenance work memory: 64MB\n*   WAL buffers: 16MB\n*   Work memory: 4MB\n\n### 1.3.2) Environment Variables\n\nCreate a `.env` file in the project root with the following configuration:\n\n```env\n# Database Configuration\nDB_NAME_PROD=dispositivos_electronicos\nDB_USER_PROD=dispositivos_user\nDB_PASS_PROD=dispositivos_pass\nDB_HOST_PROD=localhost\nDB_DIALECT_PROD=postgres\nDB_PORT_PROD=5432\n\n# Application Configuration\nPROD_PORT=8082\nAPP_PORT=8082\n\n# API Endpoints\nAPI_LOCAL_BASE_URL=http://localhost:8082\nAPI_COMPONENT_NAME_URL=/api/v1/componentes\nAPI_COMPONENT_DETAIL_NAME_URL=/api/v1/componentes-detalles\nAPI_BIPOLAR_TRANSISTOR_NAME_URL=/api/v1/transistores-bipolares\nAPI_ELECTROLYTIC_CAPACITOR_NAME_URL=/api/v1/capacitores-electroliticos\n```\n\n### 1.3.3) Database Initialization\n\nThe database is automatically initialized with the following SQL files located in the `init/` directory:\n\n1. **`01_db_dispositivos_electronicos_DDL.sql`**: Creates all tables, sequences, and constraints\n2. **`02_db_dispositivos_electronicos_DML_INSERT.sql`**: Inserts initial data\n3. **`03_db_dispositivos_electronicos_DML_UPDATE.sql`**: Sample update operations\n4. **`04_db_dispositivos_electronicos_DML_DELETE.sql`**: Sample delete operations\n5. **`05_db_dispositivos_electronicos_DML_QUERIES.sql`**: Sample queries\n\n### 1.3.4) Starting the Database\n\n**Prerequisites:**\n*   [Docker](https://docs.docker.com/get-docker/) installed on your system\n*   [Docker Compose](https://docs.docker.com/compose/install/) installed\n\n**Commands:**\n\n1. **Start the database:**\n   ```bash\n   docker-compose up -d\n   ```\n\n2. **Check if the database is running:**\n   ```bash\n   docker-compose ps\n   ```\n\n3. **View database logs:**\n   ```bash\n   docker-compose logs postgres\n   ```\n\n4. **Stop the database:**\n   ```bash\n   docker-compose down\n   ```\n\n5. **Stop and remove all data (volumes):**\n   ```bash\n   docker-compose down -v\n   ```\n\n### 1.3.5) Database Connection\n\nThe application automatically connects to the PostgreSQL database using Sequelize ORM. The connection is configured in `src/db/config.js` and uses the environment variables defined in your `.env` file.\n\n**Connection Details:**\n*   **Host**: localhost\n*   **Port**: 5432\n*   **Database**: dispositivos_electronicos\n*   **Username**: dispositivos_user\n*   **Password**: dispositivos_pass\n\n### 1.3.6) Database Schema\n\nThe database includes the following main tables:\n\n**Core Tables:**\n*   `componentes`: Main component information (code, description, price, stock, etc.)\n*   `componentes_detalles`: Technical details and datasheets\n*   `transistores_bipolares`: Bipolar transistor specifications\n*   `transistores_mosfet`: MOSFET transistor data\n*   `capacitores_electroliticos`: Electrolytic capacitor specifications\n\n**Specialized Tables:**\n*   `resistores_alta_frecuencia`: High-frequency resistors\n*   `microcontroladores_especif`: Specific microcontrollers\n*   `microcontroladores_risc_pics`: PIC microcontrollers\n*   `microcontroladores_risc_avrs`: AVR microcontrollers\n*   `placas_arduinos`: Arduino development boards\n*   `placas_esp8266`: ESP8266 boards\n*   `placas_esp32`: ESP32 development boards\n\n### 1.3.7) Troubleshooting\n\n**Common Issues:**\n\n1. **Port already in use:**\n   ```bash\n   # Check what's using port 5432\n   netstat -ano | findstr :5432\n   \n   # Kill the process or change the port in docker-compose.yml\n   ```\n\n2. **Database connection refused:**\n   ```bash\n   # Check if container is running\n   docker-compose ps\n   \n   # Check container logs\n   docker-compose logs postgres\n   ```\n\n3. **Permission denied:**\n   ```bash\n   # Make sure Docker has proper permissions\n   # On Windows: Run Docker Desktop as administrator\n   # On Linux/Mac: Add user to docker group\n   ```\n\n4. **Data persistence issues:**\n   ```bash\n   # Remove volumes and recreate\n   docker-compose down -v\n   docker-compose up -d\n   ```\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 1.4) Technologies [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n| **Technologies** | **Version** | **Purpose** |\n| ------------- | ------------- | ------------- |\n| [NodeJS](https://nodejs.org/en/) | 18.x | JavaScript Runtime |\n| [Express](https://expressjs.com/) | 4.21.2 | Web Framework |\n| [PostgreSQL](https://www.postgresql.org/) | 15 | Database Engine |\n| [Docker](https://www.docker.com/) | Latest | Containerization |\n| [Sequelize](https://sequelize.org/) | 6.32.1 | ORM for Node.js |\n| [Jest](https://jestjs.io/) | 29.7.0 | Testing Framework |\n| [Swagger](https://swagger.io/) | 6.2.8 | API Documentation |\n| [VSC](https://code.visualstudio.com/docs) | 1.72.2 | IDE |\n| [Postman](https://www.postman.com/downloads/) | 10.11 | HTTP Client |\n| [Git](https://git-scm.com/downloads) | 2.29.1 | Version Control |\n\n\u003c/br\u003e\n\n| **Plugin** | **Description** |\n| ------------- | ------------- |\n| [pg](https://www.npmjs.com/package/pg) | PostgreSQL client for Node.js |\n| [pg-hstore](https://www.npmjs.com/package/pg-hstore) | Serialize and deserialize JSON data to hstore format |\n| [cors](https://www.npmjs.com/package/cors) | Cross-Origin Resource Sharing |\n| [dotenv](https://www.npmjs.com/package/dotenv) | Environment variables loader |\n| [morgan](https://www.npmjs.com/package/morgan) | HTTP request logger middleware |\n| [nodemon](https://www.npmjs.com/package/nodemon) | Auto-restart server during development |\n| [express-validator](https://www.npmjs.com/package/express-validator) | Request validation middleware |\n| [swagger-ui-express](https://www.npmjs.com/package/swagger-ui-express) | Swagger UI for Express |\n| [winston](https://www.npmjs.com/package/winston) | Logging library |\n\n\u003c/br\u003e\n\n| **Extension** |\n| ------------- |\n| Prettier - Code formatter |\n| YAML - Autoformatter .yml (alt+shift+f) |\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## Section 2) Testing Documentation and Implementation\n\n### 2.0) Testing Overview [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n\n  \u003cbr\u003e\n\n#### [Watch playlist](https://www.youtube.com/playlist?list=PLCl11UFjHurDLAizKGgiChAKBJx1V19Fo)\n\n  \u003ca href=\"https://www.youtube.com/playlist?list=PLCl11UFjHurDLAizKGgiChAKBJx1V19Fo\"\u003e\n    \u003cimg src=\"./doc/assets/componentes-example-yt.png\" /\u003e\n  \u003c/a\u003e\n\n\u003cbr\u003e   \n\nThis project includes a comprehensive testing suite with both unit tests and integration tests to ensure code quality and reliability.\n\n**Testing Framework:** Jest with Supertest for API testing\n**Coverage:** \u003e90% code coverage\n**Test Types:** Unit tests, Integration tests, Validation tests\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.1) Testing Structure [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n```\nsrc/test/\n├── integration-test/          # Integration tests\n│   ├── app.test.js           # App configuration for tests\n│   ├── test-setup.js         # Test database configuration\n│   ├── component.test.js     # Component endpoint tests\n│   ├── mosfet-transistor.test.js\n│   ├── bipolar-transistor.test.js\n│   ├── electrolytic-capacitor.test.js\n│   └── component-detail.test.js\n├── unit-test/                # Unit tests\n│   ├── helpers/              # Helper tests\n│   │   ├── pagination/       # Pagination tests\n│   │   │   ├── component/\n│   │   │   ├── component-detail/\n│   │   │   └── mosfet-transistor.test.js\n│   │   └── validations/      # Validation tests\n│   │       ├── component.test.js\n│   │       └── mosfet-transistor.test.js\n│   └── services/             # Service tests\n│       ├── component.test.js\n│       └── mosfet-transistor.test.js\n└── mock/                     # Mocks and configuration\n    └── set-env-vars.js       # Environment variables for tests\n```\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.2) Testing Commands [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n#### Execute all tests\n```bash\nnpm test\n```\n\n#### Execute unit tests\n```bash\nnpm run test:unit\n```\n\n#### Execute integration tests\n```bash\nnpm run test:integration\n```\n\n#### Execute specific tests\n```bash\n# Pagination tests\nnpm run test:pagination-helpers\n\n# Service tests\nnpm run test:services\n\n# Validation tests\nnpm run test:validations\n```\n\n#### Execute tests with coverage\n```bash\nnpm run test:cov\n```\n\n#### Execute tests in watch mode\n```bash\nnpm run test:watch\n```\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.3) Test Types [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n#### 2.3.1) Unit Tests\n\nUnit tests focus on testing individual functions and isolated modules:\n\n**Pagination Helpers:**\n- **checkOrderBy**: Validates ordering fields\n- **checkOrderAt**: Validates ordering direction (ASC/DESC)\n\n**Validation Helpers:**\n- **validateCreateComponent**: Validates data for creating components\n- **validateUpdateComponent**: Validates data for updating components\n- **validateCreateMosfetTransistor**: Validates data for creating MOSFET transistors\n- **validateUpdateMosfetTransistor**: Validates data for updating MOSFET transistors\n\n**Services:**\n- **createComponentService**: Tests component creation\n- **getAllComponentService**: Tests component retrieval with pagination\n- **getComponentByIdService**: Tests retrieval by ID\n- **updateComponentService**: Tests updates\n- **deleteComponentService**: Tests deletion\n\n#### 2.3.2) Integration Tests\n\nIntegration tests test complete API endpoints:\n\n**Component Endpoints:**\n- **POST /api/component**: Create component\n- **GET /api/component**: Get all components\n- **GET /api/component/:id**: Get component by ID\n- **PATCH /api/component/:id**: Update component\n- **DELETE /api/component/:id**: Delete component\n- **GET /api/component/search/***: Search endpoints\n\n**MOSFET Transistor Endpoints:**\n- **POST /api/mosfet-transistor**: Create MOSFET transistor\n- **GET /api/mosfet-transistor**: Get all MOSFET transistors\n- **GET /api/mosfet-transistor/:id**: Get by ID\n- **GET /api/mosfet-transistor/component/:componentId**: Get by component\n- **PATCH /api/mosfet-transistor/:id**: Update\n- **DELETE /api/mosfet-transistor/:id**: Delete\n- **GET /api/mosfet-transistor/search/***: Search endpoints\n\n**Bipolar Transistor Endpoints:**\n- Similar structure to MOSFET transistors\n\n**Electrolytic Capacitor Endpoints:**\n- Similar structure to MOSFET transistors\n\n**Component Detail Endpoints:**\n- Similar structure to components\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.4) Test Configuration [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n#### 2.4.1) Environment Variables for Tests\n\n```bash\n# Test database\nTEST_DB_NAME=test_electronic_devices\nTEST_DB_USER=postgres\nTEST_DB_PASSWORD=postgres\nTEST_DB_HOST=localhost\nTEST_DB_PORT=5432\n\n# Mock variables for unit tests\nMOCK_NUMBER_01=1212313\nMOCK_BOOLEAN_01=true\nMOCK_STRING_01=MOCK_STRING_01\nMOCK_ID_NAME=id\nMOCK_CODE_NAME=codigo\nMOCK_NRO_PART_NAME=nro_pieza\nMOCK_ORDER_AT_ASC_NAME=ASC\nMOCK_ORDER_AT_DESC_NAME=DESC\n```\n\n#### 2.4.2) Jest Configuration\n\n```javascript\n// jest.config.js\nconst config = {\n  setupFilesAfterEnv: ['./src/test/mock/set-env-vars.js'],\n  testEnvironment: 'node',\n  collectCoverageFrom: [\n    'src/**/*.js',\n    '!src/test/**',\n    '!src/server.js'\n  ],\n  coverageDirectory: 'coverage',\n  coverageReporters: ['text', 'lcov', 'html']\n};\n```\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.5) Test Coverage [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\nThe tests cover:\n\n#### CRUD Functionality\n- ✅ Create (POST)\n- ✅ Read (GET)\n- ✅ Update (PATCH)\n- ✅ Delete (DELETE)\n\n#### Validations\n- ✅ Required fields\n- ✅ Data types\n- ✅ Value ranges\n- ✅ Specific formats\n\n#### Pagination and Ordering\n- ✅ Page parameters\n- ✅ Result limits\n- ✅ Ordering fields\n- ✅ Ordering direction\n\n#### Specific Searches\n- ✅ Search by code\n- ✅ Search by description\n- ✅ Search by price ranges\n- ✅ Search by stock ranges\n- ✅ Technical searches specific to component type\n\n#### Error Handling\n- ✅ Validation errors (400)\n- ✅ Resources not found (404)\n- ✅ Server errors (500)\n- ✅ Database connection errors\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.6) Test Cases [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n#### Successful Cases\n- Successful component creation\n- Data retrieval with pagination\n- Partial record updates\n- Successful deletion\n- Searches with filters\n\n#### Error Cases\n- Invalid data in creation\n- Invalid data in updates\n- Non-existent IDs\n- Missing required fields\n- Out-of-range values\n\n#### Edge Cases\n- Pagination with extreme limits\n- Ordering with invalid fields\n- Searches with empty parameters\n- Relationships between entities\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.7) Troubleshooting [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n#### Common Issues\n\n1. **Database connection error**\n   - Verify PostgreSQL is running\n   - Verify test database credentials\n   - Verify test database exists\n\n2. **Integration tests failing**\n   - Verify test database is clean\n   - Verify models are synchronized\n   - Verify environment variables are configured\n\n3. **Unit tests failing**\n   - Verify mocks are configured correctly\n   - Verify dependencies are imported correctly\n   - Verify mock variables are defined\n\n#### Debug Logs\n\nTo enable detailed logs during tests:\n\n```bash\n# Enable Jest logs\nnpm test -- --verbose\n\n# Enable database logs\nDEBUG=sequelize:* npm test\n```\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.8) Quality Metrics [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n- **Code coverage**: \u003e90%\n- **Unit tests**: 100+ cases\n- **Integration tests**: 50+ cases\n- **Execution time**: \u003c30 seconds\n- **Reliability**: 99%+ tests passing consistently\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 2.9) Maintenance [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n#### Adding New Tests\n\n1. **For new endpoints**:\n   - Create file in `integration-test/`\n   - Follow existing test patterns\n   - Include successful and error cases\n\n2. **For new services**:\n   - Create file in `unit-test/services/`\n   - Mock external dependencies\n   - Test all use cases\n\n3. **For new helpers**:\n   - Create file in `unit-test/helpers/`\n   - Test edge cases and errors\n   - Maintain high coverage\n\n#### Updating Existing Tests\n\n- Maintain compatibility with API changes\n- Update mocks when dependencies change\n- Review and update test cases according to new validations\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## Section 3) Endpoints and Examples.\n\n### 3.0) Endpoints and resources [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n\n\u003cbr\u003e\n\n#### [Watch playlist](https://www.youtube.com/playlist?list=PLCl11UFjHurDLAizKGgiChAKBJx1V19Fo)\n\n  \u003ca href=\"https://www.youtube.com/playlist?list=PLCl11UFjHurDLAizKGgiChAKBJx1V19Fo\"\u003e\n    \u003cimg src=\"./doc/assets/componentes-example-yt.png\" /\u003e\n  \u003c/a\u003e\n\n\u003cbr\u003e  \n\n## API Summary\n\nThe API provides RESTful endpoints for managing electronic components with the following base URL:\n```\nhttp://localhost:8082\n```\n\n### Authentication\nCurrently, the API does not require authentication. All endpoints are publicly accessible.\n\n### Response Format\nAll API responses follow a consistent JSON format:\n\n**Success Response:**\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Operation completed successfully\",\n  \"data\": {\n    // Response data here\n  },\n  \"pagination\": {\n    \"page\": 1,\n    \"limit\": 10,\n    \"total\": 100,\n    \"pages\": 10\n  }\n}\n```\n\n**Error Response:**\n```json\n{\n  \"status\": \"error\",\n  \"message\": \"Error description\",\n  \"errors\": [\n    {\n      \"field\": \"fieldName\",\n      \"message\": \"Validation error message\"\n    }\n  ]\n}\n```\n\n## Component Endpoints\n\n### 3.1) GET Operations\n\n#### 3.1.1) Get Components List\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/list?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\"\n    },\n    {\n        \"id\": 2,\n        \"codigo\": \"DFHSDK-3CD010G\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n        \"nro_pieza\": \"3CD010G\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT PNP\",\n        \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n        \"stock\": 450,\n        \"precio\": \"5.00\"\n    }\n]\n```\n\n#### 3.1.2) Get Component by Code\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/list-with-attributes?codigo=LSÑK871-JSKU99\u0026imagen=\u0026nroPieza=\u0026categoria=\u0026descripcion=\u0026fabricante=\u0026stock=\u0026precio=\u0026page=0\u0026limit=10\u0026orderBy=codigo\u0026orderAt=DESC' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 14,\n        \"codigo\": \"LSÑK871-JSKU99\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/capacitoresElectr/04_Capacitor%20Electrolitico%20de%20Aluminio%20Encaje%20a%20Presi%C3%B3n%20hitachi.webp\",\n        \"nro_pieza\": \"JSKU99\",\n        \"categoria\": \"Capacitores Electroliticos\",\n        \"descripcion\": \"Capacitor Electrolitico de Aluminio Encaje a Presión\",\n        \"fabricante\": \"HITACHI\",\n        \"stock\": 67,\n        \"precio\": \"3.00\"\n    }\n]\n```\n\n#### 3.1.3) Get Components with Details\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/list-with-details?page=0\u0026limit=10\u0026orderBy=codigo\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\",\n        \"componente_detalle\": {\n            \"id\": 1,\n            \"componente_id\": 1,\n            \"longitud\": 68.6,\n            \"ancho\": 53.4,\n            \"peso\": 25,\n            \"material\": \"FR4\",\n            \"voltaje_min_entrada\": 7,\n            \"voltaje_max_entrada\": 12,\n            \"voltaje_recomendado\": 9,\n            \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n        }\n    }\n]\n```\n\n#### 3.1.4) Get Components with Bipolar Transistors\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/list-with-bipolar-transistor?page=0\u0026limit=10\u0026orderBy=codigo\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\",\n        \"transistores_bipolare\": {\n            \"id\": 1,\n            \"componente_id\": 1,\n            \"tipo\": \"NPN\",\n            \"voltaje_colec_emis\": 40,\n            \"voltaje_colec_base\": 60,\n            \"voltaje_emis_base\": 6,\n            \"corriente_colec\": 0.6,\n            \"ganancia_hfe\": 100,\n            \"disip_max\": 0.625,\n            \"temp_juntura\": 150,\n            \"voltaje_colec_emis_sat\": 0.3\n        }\n    }\n]\n```\n\n#### 3.1.5) Get Components with Electrolytic Capacitors\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/list-with-electronic-capacitor?page=0\u0026limit=10\u0026orderBy=codigo\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 11,\n        \"codigo\": \"009-KLDIUAOASS\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/capacitoresElectr/01_capElectrAlumRadialVishay.webp\",\n        \"nro_pieza\": \"KLDIUAOASS\",\n        \"categoria\": \"Capacitores Electroliticos\",\n        \"descripcion\": \"Capacitor Electrolitico de Aluminio Radial\",\n        \"fabricante\": \"VISHAY\",\n        \"stock\": 20,\n        \"precio\": \"1.00\",\n        \"capacitores_electrolitico\": {\n            \"id\": 1,\n            \"componente_id\": 11,\n            \"tipo\": \"Plomo Radial\",\n            \"capacitancia\": \"22 µF a 12000 µF\",\n            \"tolerancia\": \"5/+20%\",\n            \"rango_temperatura\": \"-55 °C a to 105 °C\",\n            \"rango_tension_nominal\": \"10 V to 100 V\"\n        }\n    }\n]\n```\n\n#### 3.1.6) Get Components with MOSFET Transistors\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/list-with-mosfet-transistor?page=0\u0026limit=10\u0026orderBy=codigo\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 9,\n        \"codigo\": \"JDHFYT-AP4519GED\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresMosfet/01_transNpAdvancedPower.webp\",\n        \"nro_pieza\": \"AP4519GED\",\n        \"categoria\": \"Transistores MOSFET\",\n        \"descripcion\": \"Transistor Mosfet NP\",\n        \"fabricante\": \"Advanced Power\",\n        \"stock\": 200,\n        \"precio\": \"4.00\",\n        \"transistores_mosfet\": {\n            \"id\": 1,\n            \"componente_id\": 9,\n            \"tipo\": \"pMOS\",\n            \"voltaje_drenaje_fuente\": \"35 VDC\",\n            \"corriente_cc_drenaje\": \"10.4 A\",\n            \"disip_max\": \"35 W\",\n            \"temp_op_max\": \"170 °C\",\n            \"conduct_drenaje_sustrato\": \"95 (118) pF\",\n            \"resist_drenaje_fuente\": \"0.178 (0.142) Ohm\"\n        }\n    }\n]\n```\n\n#### 3.1.7) Get Components with All Models\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/list-with-all-models?page=0\u0026limit=10\u0026orderBy=codigo\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\",\n        \"componentes_detalles\": {\n            \"id\": 1,\n            \"componente_id\": 1,\n            \"longitud\": 68.6,\n            \"ancho\": 53.4,\n            \"peso\": 25,\n            \"material\": \"FR4\",\n            \"voltaje_min_entrada\": 7,\n            \"voltaje_max_entrada\": 12,\n            \"voltaje_recomendado\": 9,\n            \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n        },\n        \"transistores_bipolare\": {\n            \"id\": 1,\n            \"componente_id\": 1,\n            \"tipo\": \"NPN\",\n            \"voltaje_colec_emis\": 40,\n            \"voltaje_colec_base\": 60,\n            \"voltaje_emis_base\": 6,\n            \"corriente_colec\": 0.6,\n            \"ganancia_hfe\": 100,\n            \"disip_max\": 0.625,\n            \"temp_juntura\": 150,\n            \"voltaje_colec_emis_sat\": 0.3\n        },\n        \"transistores_mosfet\": null,\n        \"capacitores_electrolitico\": {\n            \"id\": 34,\n            \"componente_id\": 1,\n            \"tipo\": \"Aluminio\",\n            \"capacitancia\": \"1000µF\",\n            \"tolerancia\": \"±20%\",\n            \"rango_temperatura\": \"-40°C a +85°C\",\n            \"rango_tension_nominal\": \"6.3V a 450V\"\n        }\n    }\n]\n```\n\n#### 3.1.8) Get Component by ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/id/1' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"codigo\": \"HDGHFK-KSH13006\",\n    \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n    \"nro_pieza\": \"KSH13006\",\n    \"categoria\": \"Transistores BJT\",\n    \"descripcion\": \"Transistor BJT NPN\",\n    \"fabricante\": \"SHANTOU HUASHAN\",\n    \"stock\": 300,\n    \"precio\": \"2.00\"\n}\n```\n\n#### 3.1.9) Search Components by Code\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/codigo/A?page=0\u0026limit=20\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 5,\n        \"codigo\": \"JSKSHDD-10QQKAA\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/05_transNpnSTMicroelectronics.webp\",\n        \"nro_pieza\": \"10QQKAA\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"STMicroelectronics\",\n        \"stock\": 212,\n        \"precio\": \"4.00\"\n    },\n    {\n        \"id\": 6,\n        \"codigo\": \"KALDSHY-222AASA\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/06_transPnpInchangeSemiConduc02.webp\",\n        \"nro_pieza\": \"222AASA\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT PNP\",\n        \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n        \"stock\": 450,\n        \"precio\": \"3.00\"\n    }\n]\n```\n\n#### 3.1.10) Search Components by Image\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/imagen/http?page=0\u0026limit=4\u0026orderBy=stock\u0026orderAt=DESC' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 6,\n        \"codigo\": \"KALDSHY-222AASA\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/06_transPnpInchangeSemiConduc02.webp\",\n        \"nro_pieza\": \"222AASA\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT PNP\",\n        \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n        \"stock\": 450,\n        \"precio\": \"3.00\"\n    }\n]\n```\n\n#### 3.1.11) Search Components by Part Number\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/nro-pieza/10QQKAA?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 5,\n        \"codigo\": \"JSKSHDD-10QQKAA\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/05_transNpnSTMicroelectronics.webp\",\n        \"nro_pieza\": \"10QQKAA\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"STMicroelectronics\",\n        \"stock\": 212,\n        \"precio\": \"4.00\"\n    }\n]\n```\n\n#### 3.1.12) Search Components by Category and Manufacturer\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/categoria-fabricante/Transistores%20BJT/SHANTOU%20HUASHAN?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\"\n    }\n]\n```\n\n#### 3.1.13) Search Components by Description\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/descripcion/Transistor?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\"\n    }\n]\n```\n\n#### 3.1.14) Search Components by Stock\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/stock/300?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\"\n    }\n]\n```\n\n#### 3.1.15) Search Components by Maximum Stock\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/stock-max/500?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 2,\n        \"codigo\": \"DFHSDK-3CD010G\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n        \"nro_pieza\": \"3CD010G\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT PNP\",\n        \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n        \"stock\": 450,\n        \"precio\": \"5.00\"\n    }\n]\n```\n\n#### 3.1.16) Search Components by Stock Range\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/stock-min-max/200/500?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\"\n    },\n    {\n        \"id\": 2,\n        \"codigo\": \"DFHSDK-3CD010G\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n        \"nro_pieza\": \"3CD010G\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT PNP\",\n        \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n        \"stock\": 450,\n        \"precio\": \"5.00\"\n    }\n]\n```\n\n#### 3.1.17) Search Components by Price\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/precio/5.00?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 2,\n        \"codigo\": \"DFHSDK-3CD010G\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n        \"nro_pieza\": \"3CD010G\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT PNP\",\n        \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n        \"stock\": 450,\n        \"precio\": \"5.00\"\n    }\n]\n```\n\n#### 3.1.18) Search Components by Maximum Price\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/precio-max/10.00?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\"\n    },\n    {\n        \"id\": 2,\n        \"codigo\": \"DFHSDK-3CD010G\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n        \"nro_pieza\": \"3CD010G\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT PNP\",\n        \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n        \"stock\": 450,\n        \"precio\": \"5.00\"\n    }\n]\n```\n\n#### 3.1.19) Search Components by Price Range\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/precio-min-max/1.00/5.00?page=0\u0026limit=10\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"codigo\": \"HDGHFK-KSH13006\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/01_transNpnShantouHuashan.jpg\",\n        \"nro_pieza\": \"KSH13006\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT NPN\",\n        \"fabricante\": \"SHANTOU HUASHAN\",\n        \"stock\": 300,\n        \"precio\": \"2.00\"\n    },\n    {\n        \"id\": 2,\n        \"codigo\": \"DFHSDK-3CD010G\",\n        \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n        \"nro_pieza\": \"3CD010G\",\n        \"categoria\": \"Transistores BJT\",\n        \"descripcion\": \"Transistor BJT PNP\",\n        \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n        \"stock\": 450,\n        \"precio\": \"5.00\"\n    }\n]\n```\n\n### 3.2) POST Operations\n\n#### 3.2.1) Create Component\n\n##### Request (POST)\n\n```bash\ncurl --location 'http://localhost:8082/componentes/' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"codigo\": \"DFHSDK-3CD010P3\",\n    \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n    \"nro_pieza\": \"3CD010k\",\n    \"categoria\": \"Transistores BJT\",\n    \"descripcion\": \"Transistor BJT PNP\",\n    \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n    \"stock\": 400,\n    \"precio\": 5.0\n}'\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 35,\n    \"codigo\": \"DFHSDK-3CD010P3\",\n    \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n    \"nro_pieza\": \"3CD010k\",\n    \"categoria\": \"Transistores BJT\",\n    \"descripcion\": \"Transistor BJT PNP\",\n    \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n    \"stock\": 400,\n    \"precio\": \"5.00\"\n}\n```\n\n### 3.3) PATCH Operations\n\n#### 3.3.1) Update Component\n\n##### Request (PATCH)\n\n```bash\ncurl --location --request PATCH 'http://localhost:8082/componentes/id/35' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"codigo\": \"HHHSA7-332\",\n    \"imagen\": \"https://raw.githubusercontent.com/andresWeitzel/db_microelectronica_Oracle/master/files/transistoresBjt/02_transPnpInchangeSemiConduc.jpg\",\n    \"nro_pieza\": \"3CD010k\",\n    \"categoria\": \"Transistores BJT\",\n    \"descripcion\": \"Transistor BJT PNP\",\n    \"fabricante\": \"INCHANGE SEMICONDUCTOR\",\n    \"stock\": 400,\n    \"precio\": 5.0\n}'\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"objectUpdated\": \"Component has been successfully updated based on id 35\"\n}\n```\n\n### 3.4) DELETE Operations\n\n#### 3.4.1) Delete Component\n\n##### Request (DELETE)\n\n```bash\ncurl --location --request DELETE 'http://localhost:8082/componentes/35' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"message\": \"Component deleted successfully\"\n}\n```\n\n## MOSFET Transistor Endpoints\n\n### 3.5) GET Operations\n\n#### 3.5.1) Get All MOSFET Transistors\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/list?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 9,\n        \"tipo\": \"NP\",\n        \"voltaje_drenaje_fuente\": 60,\n        \"corriente_cc_drenaje\": 3.2,\n        \"disip_max\": 1.4,\n        \"resist_drenaje_fuente\": 0.085,\n        \"temp_op_max\": 150,\n        \"conduct_drenaje_sustrato\": 0.0001\n    },\n    {\n        \"id\": 2,\n        \"componente_id\": 10,\n        \"tipo\": \"N\",\n        \"voltaje_drenaje_fuente\": 60,\n        \"corriente_cc_drenaje\": 6.0,\n        \"disip_max\": 1.0,\n        \"resist_drenaje_fuente\": 0.12,\n        \"temp_op_max\": 150,\n        \"conduct_drenaje_sustrato\": 0.0001\n    }\n]\n```\n\n#### 3.5.2) Get MOSFET Transistors by Type\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/tipo/NP?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 9,\n        \"tipo\": \"NP\",\n        \"voltaje_drenaje_fuente\": 60,\n        \"corriente_cc_drenaje\": 3.2,\n        \"disip_max\": 1.4,\n        \"resist_drenaje_fuente\": 0.085,\n        \"temp_op_max\": 150,\n        \"conduct_drenaje_sustrato\": 0.0001\n    }\n]\n```\n\n#### 3.5.3) Get MOSFET Transistor by ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/id/1' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"componente_id\": 9,\n    \"tipo\": \"pMOS\",\n    \"voltaje_drenaje_fuente\": \"35 VDC\",\n    \"corriente_cc_drenaje\": \"10.4 A\",\n    \"disip_max\": \"35 W\",\n    \"temp_op_max\": \"170 °C\",\n    \"conduct_drenaje_sustrato\": \"95 (118) pF\",\n    \"resist_drenaje_fuente\": \"0.178 (0.142) Ohm\"\n}\n```\n\n#### 3.5.4) Get MOSFET Transistor by Component ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/componente/9' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"componente_id\": 9,\n    \"tipo\": \"pMOS\",\n    \"voltaje_drenaje_fuente\": \"35 VDC\",\n    \"corriente_cc_drenaje\": \"10.4 A\",\n    \"disip_max\": \"35 W\",\n    \"temp_op_max\": \"170 °C\",\n    \"conduct_drenaje_sustrato\": \"95 (118) pF\",\n    \"resist_drenaje_fuente\": \"0.178 (0.142) Ohm\"\n}\n```\n\n#### 3.5.5) Search MOSFET Transistors by Drain-Source Voltage\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/voltaje-drenaje-fuente/35?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 9,\n        \"tipo\": \"pMOS\",\n        \"voltaje_drenaje_fuente\": \"35 VDC\",\n        \"corriente_cc_drenaje\": \"10.4 A\",\n        \"disip_max\": \"35 W\",\n        \"temp_op_max\": \"170 °C\",\n        \"conduct_drenaje_sustrato\": \"95 (118) pF\",\n        \"resist_drenaje_fuente\": \"0.178 (0.142) Ohm\"\n    }\n]\n```\n\n#### 3.5.6) Search MOSFET Transistors by Drain Current\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/corriente-cc-drenaje/10?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 9,\n        \"tipo\": \"pMOS\",\n        \"voltaje_drenaje_fuente\": \"35 VDC\",\n        \"corriente_cc_drenaje\": \"10.4 A\",\n        \"disip_max\": \"35 W\",\n        \"temp_op_max\": \"170 °C\",\n        \"conduct_drenaje_sustrato\": \"95 (118) pF\",\n        \"resist_drenaje_fuente\": \"0.178 (0.142) Ohm\"\n    }\n]\n```\n\n#### 3.5.7) Search MOSFET Transistors by Maximum Dissipation\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/disip-max/35?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 9,\n        \"tipo\": \"pMOS\",\n        \"voltaje_drenaje_fuente\": \"35 VDC\",\n        \"corriente_cc_drenaje\": \"10.4 A\",\n        \"disip_max\": \"35 W\",\n        \"temp_op_max\": \"170 °C\",\n        \"conduct_drenaje_sustrato\": \"95 (118) pF\",\n        \"resist_drenaje_fuente\": \"0.178 (0.142) Ohm\"\n    }\n]\n```\n\n#### 3.5.8) Search MOSFET Transistors by Maximum Operating Temperature\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/temp-op-max/170?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 9,\n        \"tipo\": \"pMOS\",\n        \"voltaje_drenaje_fuente\": \"35 VDC\",\n        \"corriente_cc_drenaje\": \"10.4 A\",\n        \"disip_max\": \"35 W\",\n        \"temp_op_max\": \"170 °C\",\n        \"conduct_drenaje_sustrato\": \"95 (118) pF\",\n        \"resist_drenaje_fuente\": \"0.178 (0.142) Ohm\"\n    }\n]\n```\n\n### 3.6) POST Operations\n\n#### 3.6.1) Create MOSFET Transistor\n\n##### Request (POST)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-mosfet/' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"componente_id\": 11,\n    \"tipo\": \"P-Channel\",\n    \"voltaje_drenaje_fuente\": 30,\n    \"corriente_cc_drenaje\": 2.1,\n    \"disip_max\": 1.0,\n    \"resist_drenaje_fuente\": 0.12,\n    \"temp_op_max\": 150,\n    \"conduct_drenaje_sustrato\": 0.0001\n}'\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 3,\n    \"componente_id\": 11,\n    \"tipo\": \"P-Channel\",\n    \"voltaje_drenaje_fuente\": 30,\n    \"corriente_cc_drenaje\": 2.1,\n    \"disip_max\": 1.0,\n    \"resist_drenaje_fuente\": 0.12,\n    \"temp_op_max\": 150,\n    \"conduct_drenaje_sustrato\": 0.0001\n}\n```\n\n## Bipolar Transistor Endpoints\n\n### 3.7) GET Operations\n\n#### 3.7.1) Get All Bipolar Transistors\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/list?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    },\n    {\n        \"id\": 2,\n        \"componente_id\": 2,\n        \"tipo\": \"PNP\",\n        \"voltaje_colec_emis\": 30,\n        \"voltaje_colec_base\": 50,\n        \"voltaje_emis_base\": 5,\n        \"corriente_colec\": 0.5,\n        \"ganancia_hfe\": 80,\n        \"disip_max\": 0.5,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.2\n    }\n]\n```\n\n#### 3.7.2) Get Bipolar Transistors by Type\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/tipo/NPN?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    }\n]\n```\n\n#### 3.7.3) Get Bipolar Transistor by ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/id/1' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"componente_id\": 1,\n    \"tipo\": \"NPN\",\n    \"voltaje_colec_emis\": 40,\n    \"voltaje_colec_base\": 60,\n    \"voltaje_emis_base\": 6,\n    \"corriente_colec\": 0.6,\n    \"ganancia_hfe\": 100,\n    \"disip_max\": 0.625,\n    \"temp_juntura\": 150,\n    \"voltaje_colec_emis_sat\": 0.3\n}\n```\n\n#### 3.7.4) Get Bipolar Transistor by Component ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/componente/1' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"componente_id\": 1,\n    \"tipo\": \"NPN\",\n    \"voltaje_colec_emis\": 40,\n    \"voltaje_colec_base\": 60,\n    \"voltaje_emis_base\": 6,\n    \"corriente_colec\": 0.6,\n    \"ganancia_hfe\": 100,\n    \"disip_max\": 0.625,\n    \"temp_juntura\": 150,\n    \"voltaje_colec_emis_sat\": 0.3\n}\n```\n\n#### 3.7.5) Search Bipolar Transistors by Collector-Emitter Voltage\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/voltaje-colec-emis/40?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    }\n]\n```\n\n#### 3.7.6) Search Bipolar Transistors by Collector-Base Voltage\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/voltaje-colec-base/60?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    }\n]\n```\n\n#### 3.7.7) Search Bipolar Transistors by Emitter-Base Voltage\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/voltaje-emis-base/6?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    }\n]\n```\n\n#### 3.7.8) Search Bipolar Transistors by Collector Current\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/corriente-colec/0.6?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    }\n]\n```\n\n#### 3.7.9) Search Bipolar Transistors by HFE Gain\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/ganancia-hfe/100?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    }\n]\n```\n\n#### 3.7.10) Search Bipolar Transistors by Maximum Dissipation\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/disip-max/0.625?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    }\n]\n```\n\n#### 3.7.11) Search Bipolar Transistors by Junction Temperature\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/transistores-bipolares/temp-juntura/150?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"tipo\": \"NPN\",\n        \"voltaje_colec_emis\": 40,\n        \"voltaje_colec_base\": 60,\n        \"voltaje_emis_base\": 6,\n        \"corriente_colec\": 0.6,\n        \"ganancia_hfe\": 100,\n        \"disip_max\": 0.625,\n        \"temp_juntura\": 150,\n        \"voltaje_colec_emis_sat\": 0.3\n    }\n]\n```\n\n## Electrolytic Capacitor Endpoints\n\n### 3.8) GET Operations\n\n#### 3.8.1) Get All Electrolytic Capacitors\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/capacitores-electroliticos/list?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 11,\n        \"capacitancia\": 100,\n        \"voltaje_nominal\": 16,\n        \"tolerancia\": 20,\n        \"rango_temperatura\": \"-40 to 85\",\n        \"tipo\": \"Aluminum\"\n    },\n    {\n        \"id\": 2,\n        \"componente_id\": 12,\n        \"capacitancia\": 220,\n        \"voltaje_nominal\": 25,\n        \"tolerancia\": 10,\n        \"rango_temperatura\": \"-55 to 105\",\n        \"tipo\": \"Tantalum\"\n    }\n]\n```\n\n#### 3.8.2) Get Electrolytic Capacitors by Type\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/capacitores-electroliticos/tipo/Aluminio?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=ASC' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 11,\n        \"capacitancia\": 100,\n        \"voltaje_nominal\": 16,\n        \"tolerancia\": 20,\n        \"rango_temperatura\": \"-40 to 85\",\n        \"tipo\": \"Aluminum\"\n    }\n]\n```\n\n#### 3.8.3) Get Electrolytic Capacitor by ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/capacitores-electroliticos/id/1' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"componente_id\": 11,\n    \"capacitancia\": 100,\n    \"voltaje_nominal\": 16,\n    \"tolerancia\": 20,\n    \"rango_temperatura\": \"-40 to 85\",\n    \"tipo\": \"Aluminum\"\n}\n```\n\n#### 3.8.4) Get Electrolytic Capacitor by Component ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/capacitores-electroliticos/componente/11' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"componente_id\": 11,\n    \"capacitancia\": 100,\n    \"voltaje_nominal\": 16,\n    \"tolerancia\": 20,\n    \"rango_temperatura\": \"-40 to 85\",\n    \"tipo\": \"Aluminum\"\n}\n```\n\n#### 3.8.5) Search Electrolytic Capacitors by Capacitance\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/capacitores-electroliticos/capacitancia/100?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 11,\n        \"capacitancia\": 100,\n        \"voltaje_nominal\": 16,\n        \"tolerancia\": 20,\n        \"rango_temperatura\": \"-40 to 85\",\n        \"tipo\": \"Aluminum\"\n    }\n]\n```\n\n#### 3.8.6) Search Electrolytic Capacitors by Tolerance\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/capacitores-electroliticos/tolerancia/20?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 11,\n        \"capacitancia\": 100,\n        \"voltaje_nominal\": 16,\n        \"tolerancia\": 20,\n        \"rango_temperatura\": \"-40 to 85\",\n        \"tipo\": \"Aluminum\"\n    }\n]\n```\n\n#### 3.8.7) Search Electrolytic Capacitors by Temperature Range\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/capacitores-electroliticos/rango-temperatura/-40?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 11,\n        \"capacitancia\": 100,\n        \"voltaje_nominal\": 16,\n        \"tolerancia\": 20,\n        \"rango_temperatura\": \"-40 to 85\",\n        \"tipo\": \"Aluminum\"\n    }\n]\n```\n\n#### 3.8.8) Search Electrolytic Capacitors by Nominal Voltage Range\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/capacitores-electroliticos/rango-tension-nominal/16?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 11,\n        \"capacitancia\": 100,\n        \"voltaje_nominal\": 16,\n        \"tolerancia\": 20,\n        \"rango_temperatura\": \"-40 to 85\",\n        \"tipo\": \"Aluminum\"\n    }\n]\n```\n\n## Component Details Endpoints\n\n### 3.9) GET Operations\n\n#### 3.9.1) Get All Component Details\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/list?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n    },\n    {\n        \"id\": 2,\n        \"componente_id\": 2,\n        \"longitud\": 85.6,\n        \"ancho\": 56.0,\n        \"peso\": 46,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 4.75,\n        \"voltaje_max_entrada\": 5.25,\n        \"voltaje_recomendado\": 5.0,\n        \"hoja_datos\": \"raspberry-pi-4-datasheet.pdf\"\n    }\n]\n```\n\n#### 3.9.2) Get Component Details by Datasheet\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/hoja-datos/semiconductor?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"semiconductor-datasheet.pdf\"\n    }\n]\n```\n\n#### 3.9.3) Get Component Detail by ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/id/1' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"componente_id\": 1,\n    \"longitud\": 68.6,\n    \"ancho\": 53.4,\n    \"peso\": 25,\n    \"material\": \"FR4\",\n    \"voltaje_min_entrada\": 7,\n    \"voltaje_max_entrada\": 12,\n    \"voltaje_recomendado\": 9,\n    \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n}\n```\n\n#### 3.9.4) Get Component Detail by Component ID\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/componente/1' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n{\n    \"id\": 1,\n    \"componente_id\": 1,\n    \"longitud\": 68.6,\n    \"ancho\": 53.4,\n    \"peso\": 25,\n    \"material\": \"FR4\",\n    \"voltaje_min_entrada\": 7,\n    \"voltaje_max_entrada\": 12,\n    \"voltaje_recomendado\": 9,\n    \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n}\n```\n\n#### 3.9.5) Search Component Details by Length\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/longitud/68.6?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n    }\n]\n```\n\n#### 3.9.6) Search Component Details by Width\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/ancho/53.4?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n    }\n]\n```\n\n#### 3.9.7) Search Component Details by Weight\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/peso/25?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n    }\n]\n```\n\n#### 3.9.8) Search Component Details by Material\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/material/FR4?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n    }\n]\n```\n\n#### 3.9.9) Search Component Details by Recommended Voltage\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/voltaje-recomendado/9?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n    }\n]\n```\n\n#### 3.9.10) Search Component Details by Minimum Input Voltage\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/voltaje-min-entrada/7?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n    }\n]\n```\n\n#### 3.9.11) Search Component Details by Maximum Input Voltage\n\n##### Request (GET)\n\n```bash\ncurl --location 'http://localhost:8082/componentes-detalles/voltaje-max-entrada/12?page=0\u0026limit=100\u0026orderBy=id\u0026orderAt=asc' \\\n--header 'Content-Type: application/json' \\\n--data ''\n```\n\n##### Response (200 OK)\n\n```json\n[\n    {\n        \"id\": 1,\n        \"componente_id\": 1,\n        \"longitud\": 68.6,\n        \"ancho\": 53.4,\n        \"peso\": 25,\n        \"material\": \"FR4\",\n        \"voltaje_min_entrada\": 7,\n        \"voltaje_max_entrada\": 12,\n        \"voltaje_recomendado\": 9,\n        \"hoja_datos\": \"arduino-uno-datasheet.pdf\"\n    }\n]\n```\n\n## Error Handling\n\n### Common Error Responses\n\n#### 400 Bad Request\n```json\n{\n  \"status\": \"error\",\n  \"message\": \"Validation failed\",\n  \"errors\": [\n    {\n      \"field\": \"fieldName\",\n      \"message\": \"Validation error message\"\n    }\n  ]\n}\n```\n\n#### 404 Not Found\n```json\n{\n  \"status\": \"error\",\n  \"message\": \"Resource not found\"\n}\n```\n\n#### 409 Conflict\n```json\n{\n  \"status\": \"error\",\n  \"message\": \"Resource already exists or has dependencies\"\n}\n```\n\n#### 500 Internal Server Error\n```json\n{\n  \"status\": \"error\",\n  \"message\": \"Internal server error. Please try again later.\"\n}\n```\n\n## API Documentation\n\nInteractive API documentation is available at:\n```\nhttp://localhost:8082/api-docs\n```\n\nThis Swagger interface provides:\n- Interactive endpoint testing\n- Request/response examples\n- Schema definitions\n- Authentication information\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## Section 4) Functionality Testing and References.\n\n### 4.0) Postman Collection [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n#### Postman Collection Overview\n\nA comprehensive Postman collection is included in this project to facilitate API testing and development. The collection contains pre-configured requests for all API endpoints with proper headers, body examples, and environment variables.\n\n**Collection Location:**\n- **File**: `postman/collections/Api_DispElectr_Express.postman_collection.json`\n- **Size**: ~481KB with 11,000+ lines of configuration\n- **Coverage**: Complete API coverage for all endpoints\n\n#### Collection Features\n\n**📋 Complete API Coverage:**\n- **Components**: CRUD operations, search, and pagination\n- **MOSFET Transistors**: Technical specifications and parameters\n- **Bipolar Transistors**: BJT characteristics and ratings\n- **Electrolytic Capacitors**: Capacitor specifications\n- **Component Details**: Technical details and datasheets\n\n**🔧 Pre-configured Setup:**\n- **Environment Variables**: Base URL and common parameters\n- **Request Headers**: Proper Content-Type and authorization headers\n- **Body Examples**: Sample data for all POST/PATCH operations\n- **Response Validation**: Pre-configured tests for common scenarios\n- **Organized Structure**: Requests grouped by component type\n\n**📊 Testing Capabilities:**\n- **Request Examples**: Ready-to-use requests with sample data\n- **Response Validation**: Automatic validation of response status and structure\n- **Error Testing**: Pre-configured error scenarios\n- **Pagination Testing**: Examples with different page and limit parameters\n- **Search Testing**: Various search criteria and filters\n\n#### How to Use the Collection\n\n**Step 1: Import Collection**\n1. Open Postman application\n2. Click **File** → **Import** → **Upload Files**\n3. Select the file: `postman/collections/Api_DispElectr_Express.postman_collection.json`\n4. Click **Import**\n\n**Step 2: Set Up Environment**\n1. Create a new environment in Postman\n2. Add the following variable:\n   - **Variable**: `base_url`\n   - **Initial Value**: `http://localhost:8082`\n   - **Current Value**: `http://localhost:8082`\n3. Save the environment and select it\n\n**Step 3: Start Testing**\n1. Ensure your API server is running (`npm run start:dev`)\n2. Ensure your database is running (`docker-compose up -d`)\n3. Navigate through the collection folders\n4. Click on any request to see its configuration\n5. Modify request bodies or parameters as needed\n6. Click **Send** to execute the request\n\n#### Collection Structure\n\n```\nApi_DispElectr_Express Collection\n├── Components\n│   ├── GET All Components\n│   ├── GET Component by ID\n│   ├── POST Create Component\n│   ├── PATCH Update Component\n│   ├── DELETE Component\n│   └── Search Components\n├── MOSFET Transistors\n│   ├── GET All MOSFET Transistors\n│   ├── GET MOSFET by ID\n│   ├── POST Create MOSFET\n│   ├── PATCH Update MOSFET\n│   ├── DELETE MOSFET\n│   └── Search MOSFET Transistors\n├── Bipolar Transistors\n│   └── [Similar structure]\n├── Electrolytic Capacitors\n│   └── [Similar structure]\n└── Component Details\n    └── [Similar structure]\n```\n\n#### Customization Tips\n\n**Modifying Request Bodies:**\n- Update the JSON body in the request to match your test data\n- Use environment variables for dynamic values\n- Test different validation scenarios\n\n**Adding New Tests:**\n- Use the **Tests** tab in Postman to add custom validation\n- Test response status codes, response times, and data structure\n- Add assertions for specific business logic\n\n**Environment Variables:**\n- Create different environments for development, staging, and production\n- Use variables for base URLs, authentication tokens, and common parameters\n- Share environments with team members\n\n#### Troubleshooting\n\n**Common Issues:**\n1. **Connection Refused**: Ensure the API server is running on port 8082\n2. **Database Errors**: Verify PostgreSQL is running via Docker\n3. **Validation Errors**: Check request body format and required fields\n4. **Environment Issues**: Verify environment variables are set correctly\n\n**Best Practices:**\n- Always test with the latest collection version\n- Keep environment variables updated\n- Use descriptive test names and descriptions\n- Document any custom modifications made to requests\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 4.1) Functionality test [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n\u003cbr\u003e\n\n## Testing Overview\n\nThis section provides comprehensive guidance on testing the API functionality, including manual testing procedures, automated testing, and recommended testing tools.\n\n## Manual Testing\n\n### Prerequisites for Testing\n1. **Server Running**: Ensure the API server is running on `http://localhost:8082`\n2. **Database Active**: Verify PostgreSQL database is running via Docker\n3. **Test Data**: Ensure the database contains test data (automatically loaded via init scripts)\n\n### Testing Tools\n\n#### 1. Postman Collection\nA comprehensive Postman collection is included in the project:\n- **Location**: `postman/collections/Api_DispElectr_Express.postman_collection.json`\n- **Import**: Import this collection into Postman for easy API testing\n- **Environment**: Configure environment variables for different testing scenarios\n\n**Collection Features:**\n- **Complete API Coverage**: All endpoints for components, transistors, capacitors, and component details\n- **Pre-configured Requests**: Ready-to-use requests with proper headers and body examples\n- **Environment Variables**: Uses variables for base URL and common parameters\n- **Request Examples**: Includes sample data for all POST/PATCH operations\n- **Response Validation**: Pre-configured tests for common response scenarios\n- **Organized Structure**: Requests grouped by component type for easy navigation\n\n**How to Use:**\n1. **Import Collection**: In Postman, go to File → Import → Upload Files and select the collection file\n2. **Set Environment**: Create a new environment with variable `base_url` set to `http://localhost:8082`\n3. **Start Testing**: The collection will be ready to use with all endpoints configured\n4. **Modify as Needed**: Update request bodies and parameters according to your testing needs\n\n#### 2. Swagger UI\nInteractive API documentation and testing:\n- **URL**: `http://localhost:8082/api-docs`\n- **Features**: \n  - Interactive endpoint testing\n  - Request/response examples\n  - Schema validation\n  - Real-time API exploration\n\n#### 3. cURL Commands\nCommand-line testing examples:\n\n**Test Server Health:**\n```bash\ncurl -X GET http://localhost:8082/api/v1/health\n```\n\n**Get All Components:**\n```bash\ncurl -X GET \"http://localhost:8082/api/v1/componentes?page=1\u0026limit=5\"\n```\n\n**Create a Component:**\n```bash\ncurl -X POST http://localhost:8082/api/v1/componentes \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"codigo\": \"TEST001\",\n    \"descripcion\": \"Test Component\",\n    \"categoria\": \"Test Category\",\n    \"fabricante\": \"Test Manufacturer\",\n    \"precio\": 10.99,\n    \"stock\": 100\n  }'\n```\n\n## Automated Testing\n\n### Running Tests\n\n#### 1. All Tests\n```bash\nnpm test\n```\n\n#### 2. Specific Test Types\n```bash\n# Unit tests only\nnpm run test:unit\n\n# Integration tests only\nnpm run test:integration\n\n# Tests with coverage\nnpm run test:cov\n\n# Tests in watch mode\nnpm run test:watch\n```\n\n#### 3. Specific Test Categories\n```bash\n# Pagination helper tests\nnpm run test:pagination-helpers\n\n# Service layer tests\nnpm run test:services\n\n# Validation tests\nnpm run test:validations\n```\n\n### Test Structure\n\n#### Unit Tests (`src/test/unit-test/`)\n- **Helpers**: Pagination and validation logic\n- **Services**: Business logic and data processing\n- **Coverage**: \u003e90% code coverage\n\n#### Integration Tests (`src/test/integration-test/`)\n- **API Endpoints**: Complete request/response testing\n- **Database Operations**: CRUD operations with real database\n- **Error Handling**: Validation and error scenarios\n\n### Test Data Management\n\n#### Database Setup\n```bash\n# Start test database\ndocker-compose up -d\n\n# Reset database (if needed)\ndocker-compose down -v\ndocker-compose up -d\n```\n\n#### Test Environment Variables\n```env\n# Test database configuration\nTEST_DB_NAME=test_electronic_devices\nTEST_DB_USER=postgres\nTEST_DB_PASSWORD=postgres\nTEST_DB_HOST=localhost\nTEST_DB_PORT=5432\n```\n\n## Testing Scenarios\n\n### 1. Component Management\n\n#### Create Component\n```bash\nPOST /api/v1/componentes\nContent-Type: application/json\n\n{\n  \"codigo\": \"COMP001\",\n  \"descripcion\": \"Arduino Uno R3\",\n  \"categoria\": \"Development Board\",\n  \"fabricante\": \"Arduino\",\n  \"precio\": 25.99,\n  \"stock\": 50\n}\n```\n\n**Expected Response:**\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Component created successfully\",\n  \"data\": {\n    \"id\": 1,\n    \"codigo\": \"COMP001\",\n    \"descripcion\": \"Arduino Uno R3\",\n    // ... other fields\n  }\n}\n```\n\n#### Get Components with Pagination\n```bash\nGET /api/v1/componentes?page=1\u0026limit=5\u0026orderBy=codigo\u0026orderAt=ASC\n```\n\n#### Search Components\n```bash\nGET /api/v1/componentes/search/codigo/COMP001\nGET /api/v1/componentes/search/precio-min-max/10/50\n```\n\n### 2. MOSFET Transistor Testing\n\n#### Create MOSFET\n```bash\nPOST /api/v1/transistores-mosfet\nContent-Type: application/json\n\n{\n  \"componente_id\": 1,\n  \"tipo\": \"N-Channel\",\n  \"voltaje_drenaje_fuente\": 60,\n  \"corriente_cc_drenaje\": 3.2,\n  \"disip_max\": 1.4\n}\n```\n\n#### Search by Technical Parameters\n```bash\nGET /api/v1/transistores-mosfet/search/tipo/N-Channel\nGET /api/v1/transistores-mosfet/search/voltaje-drenaje-fuente/60\n```\n\n### 3. Error Handling Testing\n\n#### Invalid Data\n```bash\nPOST /api/v1/componentes\nContent-Type: application/json\n\n{\n  \"codigo\": \"\",  // Invalid: empty code\n  \"precio\": -10  // Invalid: negative price\n}\n```\n\n**Expected Response:**\n```json\n{\n  \"status\": \"error\",\n  \"message\": \"Validation failed\",\n  \"errors\": [\n    {\n      \"field\": \"codigo\",\n      \"message\": \"Code is required\"\n    },\n    {\n      \"field\": \"precio\",\n      \"message\": \"Price must be positive\"\n    }\n  ]\n}\n```\n\n#### Resource Not Found\n```bash\nGET /api/v1/componentes/999999\n```\n\n**Expected Response:**\n```json\n{\n  \"status\": \"error\",\n  \"message\": \"Component not found\"\n}\n```\n\n## Performance Testing\n\n### Load Testing with Artillery\n```bash\n# Install Artillery\nnpm install -g artillery\n\n# Run load test\nartillery run load-test.yml\n```\n\n### Example Load Test Configuration\n```yaml\n# load-test.yml\nconfig:\n  target: 'http://localhost:8082'\n  phases:\n    - duration: 60\n      arrivalRate: 10\n  defaults:\n    headers:\n      Content-Type: 'application/json'\n\nscenarios:\n  - name: \"Get Components\"\n    requests:\n      - get:\n          url: \"/api/v1/componentes\"\n```\n\n## Security Testing\n\n### Input Validation\n- Test with SQL injection attempts\n- Test with XSS payloads\n- Test with oversized payloads\n- Test with malformed JSON\n\n### Rate Limiting (Future)\n- Test API rate limits\n- Test concurrent requests\n- Test abuse scenarios\n\n## Monitoring and Logging\n\n### Application Logs\n```bash\n# View application logs\ndocker-compose logs -f app\n\n# View database logs\ndocker-compose logs -f postgres\n```\n\n### Test Reports\n```bash\n# Generate test coverage report\nnpm run test:cov\n\n# View coverage report\nopen coverage/lcov-report/index.html\n```\n\n## Continuous Integration\n\n### GitHub Actions (Recommended)\n```yaml\n# .github/workflows/test.yml\nname: Tests\non: [push, pull_request]\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v2\n        with:\n          node-version: '18'\n      - run: npm ci\n      - run: npm test\n      - run: npm run test:cov\n```\n\n## Testing Best Practices\n\n### 1. Test Data Isolation\n- Use separate test database\n- Clean up test data after each test\n- Use unique identifiers for test data\n\n### 2. Test Coverage\n- Aim for \u003e90% code coverage\n- Test both success and error scenarios\n- Test edge cases and boundary conditions\n\n### 3. Performance Testing\n- Test with realistic data volumes\n- Monitor response times\n- Test concurrent access\n\n### 4. Security Testing\n- Validate all inputs\n- Test authentication (when implemented)\n- Test authorization (when implemented)\n\n## Troubleshooting Tests\n\n### Common Issues\n\n#### Database Connection\n```bash\n# Check if database is running\ndocker-compose ps\n\n# Restart database\ndocker-compose restart postgres\n```\n\n#### Port Conflicts\n```bash\n# Check port usage\nnetstat -ano | findstr :8082\n\n# Kill conflicting processes\nnpx kill-port 8082\n```\n\n#### Test Environment\n```bash\n# Clear test cache\nnpm test -- --clearCache\n\n# Run tests with verbose output\nnpm test -- --verbose\n```\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n\n### 4.2) References [🔝](#index-)\n\n\u003cdetails\u003e\n   \u003csummary\u003eView details\u003c/summary\u003e\n  \u003cbr\u003e\n\n#### Docker and PostgreSQL\n\n*   [Docker Official PostgreSQL Image](https://hub.docker.com/_/postgres)\n*   [Docker Compose Documentation](https://docs.docker.com/compose/)\n*   [PostgreSQL with Docker Best Practices](https://docs.docker.com/samples/postgresql_service/)\n*   [Docker Compose Environment Variables](https://docs.docker.com/compose/environment-variables/)\n\n#### Sequelize with PostgreSQL\n\n*   [PostgreSQL with Sequelize](https://www.makeuseof.com/use-postgresql-with-sequelize-in-nodejs/)\n*   [Associations between tables](https://sequelize.org/docs/v6/core-concepts/assocs/)\n\n#### Swagger and Nodejs\n\n*   [Automatically Generate Swagger Docs With ExpressJS \u0026 NodeJS](https://www.youtube.com/watch?v=5aryMKiBEKY)\n*   [Example repository](https://github.com/TomDoesTech/REST-API-Tutorial-Updated/tree/main)\n\n#### Video tutorials\n\n*   [Playlist Example Creation of Rest Api](https://www.youtube.com/watch?v=tpso18ghda4)\n*   [Creation and config Api rest from scratch](https://www.youtube.com/watch?v=bK3AJfs7qNY\\\u0026t=1019s)\n\n#### Code Examples\n\n*   [Example of microservice using Sequelize, Mysql and NodeJS](https://github.com/andresWeitzel/ApiRest_Dispositivos_Electronicos_ExpressJS)\n\n#### Bookstores\n\n*   [Handling validations with express-validator](https://medium.com/dataseries/introduction-to-request-body-validation-in-express-apps-with-express-validator-7b9725ca780d)\n*   [express-validator official doc](https://express-validator.github.io/docs/guides/getting-started)\n\n#### Remark-lint\n\n*   [remark-lint-emphasis-marker](https://www.npmjs.com/package/remark-lint-emphasis-marker)\n*   [remark-preset-lint-recommended](https://www.npmjs.com/package/remark-preset-lint-recommended)\n*   [remark-reference-links](https://www.npmjs.com/package/remark-reference-links)\n\n#### Railway\n\n*   [Example Deploy with Nodejs and Mysql](https://www.youtube.com/watch?v=C3NhmT__Mn4\\\u0026ab_channel=Fazt)\n\n\u003cbr\u003e\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandresweitzel%2Fapirest_electronic_devices_expressjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandresweitzel%2Fapirest_electronic_devices_expressjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandresweitzel%2Fapirest_electronic_devices_expressjs/lists"}