Esta API es GET, POST, PUT Y DELETE y es necesario autenticación para acceder a ella
Está divida en 3 apartados: COMPONENTES, PROVEEDORES y PRODUCTOS (COMPONENTE CON STOCK Y PRECIO)
getAllComponents: 'https://localhost:8000/api/products',
getAllProviders: 'https://localhost:8000/api/providers',
getAllProducts: 'https://localhost:8000/api/products-providers'
{
"data": [
{
"id": 1,
"provider_name": "INTEL",
"provider_phone": null,
"provider_email": "dubuque.alessandro@example.net",
"provider_location": "SI",
"created_at": "2024-04-22T09:57:10.000000Z",
"updated_at": "2024-04-22T09:57:10.000000Z"
},
{
"id": 2,
"provider_name": "AMD",
"provider_phone": null,
"provider_email": "erin09@example.org",
"provider_location": "AI",
"created_at": "2024-04-22T09:57:10.000000Z",
"updated_at": "2024-04-22T09:57:10.000000Z"
}
...
]
}
getOneComponent: 'https://localhost:8000/api/products/{id}',
getOneProvider: 'https://localhost:8000/api/providers/{id}',
getOneProduct: 'https://localhost:8000/api/products-providers/{id}'
{
"data": {
"id": 4,
"product_name": "RTX 4060 Ti",
"product_code": "202422040957104",
"product_category": "Tarjeta gráfica",
"created_at": "2024-04-22T09:57:10.000000Z",
"updated_at": "2024-04-22T09:57:10.000000Z"
}
}
Componentes: Aceptan un "product_name" y "product_category"
addComponent: 'https://localhost:8000/api/products',
body:
{
"product_name": "RTX 4080",
"product_category": "Tarjeta gráfica"
}
result:
{
{
"data": "Producto insertado correctamente"
}
}
Proveedores: Aceptan un "provider_name", "provider_phone" (nullable), "provider_email" y "provider_email"
addProvider: 'https://localhost:8000/api/providers',
body:
{
"provider_name": "ASIX",
"provider_phone": "123456789",
"provider_email": "asix@example.com",
"provider_location": "ES"
}
result:
{
{
"data": "Proveedor insertado correctamente"
}
}
Productos: Aceptan un "product_id", "provider_id", "product_price" y "product_stock"
addProduct: 'https://localhost:8000/api/products-providers',
body:
{
"product_id": 1,
"provider_id": 1,
"product_price": 50,
"product_stock": 5
}
result:
{
{
"data": "Producto insertado correctamente"
}
}
updateComponent: 'https://localhost:8000/api/products/{id}',
body:
{
"product_name": "RTX 4080",
"product_category": "Tarjeta gráfica"
}
result:
{
{
"data": "Producto actualizado correctamente"
}
}
updateProvider: 'https://localhost:8000/api/providers/{id}',
body:
{
"provider_name": "ASIX",
"provider_phone": "123456789",
"provider_email": "asix@example.com",
"provider_location": "ES"
}
result:
{
{
"data": "Proveedor actualizado correctamente"
}
}
updateProduct: 'https://localhost:8000/api/products-providers/{id}',
body:
{
"product_id": 1,
"provider_id": 1,
"product_price": 50,
"product_stock": 5
}
result:
{
{
"data": "Producto actualizado correctamente"
}
}
deleteComponent: 'https://localhost:8000/api/products/{id}',
deleteProvider: 'https://localhost:8000/api/providers/{id}',
deleteProduct: 'https://localhost:8000/api/products-providers/{id}',