diff --git a/Perfil-Hardware.md b/Perfil-Hardware.md new file mode 100644 index 0000000..b79fa52 --- /dev/null +++ b/Perfil-Hardware.md @@ -0,0 +1,244 @@ +### Documentación - API ogCore + +## Select Language / Seleccionar Idioma + +- [English](#english) +- [Español](#español) + +--- + +## English + +### Table of Contents + +1. [Introduction](#introduction) +2. [Configuration](#configuration) +3. [Resource Definition](#resource-definition) +4. [API Operations](#api-operations) +5. [Entity Properties](#entity-properties) +6. [Hardware Profile Input DTO](#hardware-profile-input-dto) + +### Introduction + +This documentation describes the configuration of API Platform in a Symfony project. It details the resources, operations, and entity properties exposed through the API. + +### Configuration + +API configuration is done in Symfony configuration files, usually in the `config/packages/api_platform.yaml` file. + +```yaml +resources: + App\Entity\HardwareProfile: + processor: App\State\Processor\HardwareProfileProcessor + input: App\Dto\Input\HardwareProfileInput + output: App\Dto\Output\HardwareProfileOutput + normalizationContext: + groups: ['default', 'hardware-profile:read'] + denormalizationContext: + groups: ['hardware-profile:write'] + operations: + ApiPlatform\Metadata\GetCollection: + provider: App\State\Provider\HardwareProfileProvider + filters: + - 'api_platform.filter.hardware.order' + - 'api_platform.filter.hardware.search' + ApiPlatform\Metadata\Get: + provider: App\State\Provider\HardwareProfileProvider + ApiPlatform\Metadata\Put: + provider: App\State\Provider\HardwareProfileProvider + ApiPlatform\Metadata\Patch: + provider: App\State\Provider\HardwareProfileProvider + ApiPlatform\Metadata\Post: ~ + ApiPlatform\Metadata\Delete: ~ + +properties: + App\Entity\HardwareProfile: + id: + identifier: false + uuid: + identifier: true +``` + +### Resource Definition + +#### App\Entity\HardwareProfile + +- **Processor**: `App\State\Processor\HardwareProfileProcessor` +- **Input**: `App\Dto\Input\HardwareProfileInput` +- **Output**: `App\Dto\Output\HardwareProfileOutput` +- **Normalization Context**: `['default', 'hardware-profile:read']` +- **Denormalization Context**: `['hardware-profile:write']` + +### API Operations + +#### Hardware Profile Operations + +##### Get Hardware Profile Collection (GetCollection) +- **Provider**: `App\State\Provider\HardwareProfileProvider` +- **Filters**: + - Order hardware profiles: `api_platform.filter.hardware.order` + - Search hardware profiles: `api_platform.filter.hardware.search` + +##### Get Hardware Profile (Get) +- **Provider**: `App\State\Provider\HardwareProfileProvider` + +##### Update Hardware Profile (Put) +- **Provider**: `App\State\Provider\HardwareProfileProvider` + +##### Partially Update Hardware Profile (Patch) +- **Provider**: `App\State\Provider\HardwareProfileProvider` + +##### Create Hardware Profile (Post) +- **Default Operation**: ~ + +##### Delete Hardware Profile (Delete) +- **Default Operation**: ~ + +### Entity Properties + +#### App\Entity\HardwareProfile + +- **id**: + - **Identifier**: `false` + +- **uuid**: + - **Identifier**: `true` + +### Hardware Profile Input DTO + +#### Fields Required in Hardware Profile Endpoint Input + +1. **profileName** + - **Type**: string + - **Validation**: Not blank + - **Groups**: `hardware-profile:write` + +2. **specifications** + - **Type**: array + - **Validation**: Not blank + - **Groups**: `hardware-profile:write` + +3. **isActive** + - **Type**: boolean + - **Validation**: Not null + - **Groups**: `hardware-profile:write` + - **Default**: true + +--- + +## Español + +### Índice + +1. [Introducción](#introducción) +2. [Configuración](#configuración) +3. [Definición de Recursos](#definición-de-recursos) +4. [Operaciones de API](#operaciones-de-api) +5. [Propiedades de la Entidad](#propiedades-de-la-entidad) +6. [DTO de Entrada de Perfil de Hardware](#dto-de-entrada-de-perfil-de-hardware) + +### Introducción + +Esta documentación describe la configuración de API Platform en un proyecto Symfony. Se detallan los recursos, operaciones y propiedades de las entidades expuestas a través de la API. + +### Configuración + +La configuración de la API se realiza en los archivos de configuración de Symfony, generalmente en `config/packages/api_platform.yaml`. + +```yaml +resources: + App\Entity\HardwareProfile: + processor: App\State\Processor\HardwareProfileProcessor + input: App\Dto\Input\HardwareProfileInput + output: App\Dto\Output\HardwareProfileOutput + normalizationContext: + groups: ['default', 'hardware-profile:read'] + denormalizationContext: + groups: ['hardware-profile:write'] + operations: + ApiPlatform\Metadata\GetCollection: + provider: App\State\Provider\HardwareProfileProvider + filters: + - 'api_platform.filter.hardware.order' + - 'api_platform.filter.hardware.search' + ApiPlatform\Metadata\Get: + provider: App\State\Provider\HardwareProfileProvider + ApiPlatform\Metadata\Put: + provider: App\State\Provider\HardwareProfileProvider + ApiPlatform\Metadata\Patch: + provider: App\State\Provider\HardwareProfileProvider + ApiPlatform\Metadata\Post: ~ + ApiPlatform\Metadata\Delete: ~ + +properties: + App\Entity\HardwareProfile: + id: + identifier: false + uuid: + identifier: true +``` + +### Definición de Recursos + +#### App\Entity\HardwareProfile + +- **Processor**: `App\State\Processor\HardwareProfileProcessor` +- **Input**: `App\Dto\Input\HardwareProfileInput` +- **Output**: `App\Dto\Output\HardwareProfileOutput` +- **Contexto de Normalización**: `['default', 'hardware-profile:read']` +- **Contexto de Desnormalización**: `['hardware-profile:write']` + +### Operaciones de API + +#### Operaciones de Perfil de Hardware + +##### Obtener Colección de Perfiles de Hardware (GetCollection) +- **Provider**: `App\State\Provider\HardwareProfileProvider` +- **Filtros**: + - Ordenar perfiles de hardware: `api_platform.filter.hardware.order` + - Buscar perfiles de hardware: `api_platform.filter.hardware.search` + +##### Obtener Perfil de Hardware (Get) +- **Provider**: `App\State\Provider\HardwareProfileProvider` + +##### Actualizar Perfil de Hardware (Put) +- **Provider**: `App\State\Provider\HardwareProfileProvider` + +##### Actualización Parcial de Perfil de Hardware (Patch) +- **Provider**: `App\State\Provider\HardwareProfileProvider` + +##### Crear Perfil de Hardware (Post) +- **Operación Predeterminada**: ~ + +##### Eliminar Perfil de Hardware (Delete) +- **Operación Predeterminada**: ~ + +### Propiedades de la Entidad + +#### App\Entity\HardwareProfile + +- **id**: + - **Identificador**: `false` + +- **uuid**: + - **Identificador**: `true` + +### DTO de Entrada de Perfil de Hardware + +#### Campos Requeridos en la Entrada del Endpoint de Perfil de Hardware + +1. **profileName** + - **Tipo**: string + - **Validación**: No nulo + - **Groups**: `hardware-profile:write` + +2. **specifications** + - **Tipo**: array + - **Validación**: No nulo + - **Groups**: `hardware-profile:write` + +3. **isActive** + - **Tipo**: booleano + - **Validación**: No nulo + - **Groups**: `hardware-profile:write` + - **Predeterminado**: true \ No newline at end of file