Skip to content

MiguelErenJagger/test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛠 EJECUCIÓN DEL PROYECTO

Requisitos: Java 17+, Maven.

Construir todo:

mvn -T 1C clean install

Correr test unitarios:

mvn test 

Correr módulos individualmente (desde cada carpeta):

mvn spring-boot:run

📊 ACCESO A BASE DE DATOS

ORDER BD

PRODUCT BD

📚 DOCUMENTACIÓN DE APIS

Para ambiente productivo debe estar desactivado

PRODUCT-SERVICE http://localhost:8081/swagger-ui/index.html

ORDER-SERVICE http://localhost:8082/swagger-ui/index.html

PROBAR LOS SERVICIOS

  • PARA PROBAR LOS CURLS SE PUEDE USAR POSTMAN E IRLOS IMPORTANDO.
  • TAMBIEN SE PUEDE USAR LA INTERFAZ GRAFICA DE SWAGGER EN LA SECCION DE DOCUMENTACION DE APIS ESTAN LOS LINKS DE ACCESO
  • EN CASO DE NO USAR SWAGGER DEJO LOS PASOS Y CURLS A SEGUIR 1-crear uno o varios productos con la siguiente curl , en caso contrario utilizar la interfaz grafica que provee Swagger para probar los servicios:

CURL PARA CREAR PRODUCTOS

curl -X 'POST'
'http://localhost:8081/api/products'
-H 'accept: /'
-H 'Content-Type: application/json'
-d '{ "id": 1, "name": "REDBULL", "price": 23.09, "stock": 12, "active": true }'

2-cONSULTAR EL QUE EL PRODUCTO SE ALMACENO EN LA BASE DE DATOS CON LA CURL QUE OBTIENE TODOS LOS PRODUCTOS

curl -X 'GET'
'http://localhost:8081/api/products'
-H 'accept: /'

2.1 Y SI SE SABE EL ID PUEDES BUSCAR POR ID, REEMPLAZAR POR EL ID QUE QUIERES ENCONTRAR

curl -X 'GET'
'http://localhost:8081/api/products/1'
-H 'accept: /'

3-para verificar disponibilidad de un producto se debe incluir el id del producto,precio unitario y cantidad de productos que se quieren para saber si hay stock ,

curl -X 'POST'
'http://localhost:8081/api/products/check-availability'
-H 'accept: /'
-H 'Content-Type: application/json'
-d '[ {

    "productId": 1,
    "quantity": 2,
    "unitPrice": 23.09
  },

]'

//CREACION DE PEDIDOS

4-PARA CREAR UNA ORDEN DE UN PRODUCTO EN ESPECIFICO SE UTILIZA LA CURLS

curl -X 'POST'
'http://localhost:8082/api/orders'
-H 'accept: /'
-H 'Content-Type: application/json'
-d '{ "customerName": "MIGUELSTACK", "customerEmail": "SASKE.MADARA@GMAIL.COM", "orderDate": "2025-10-11T05:27:15.553", "status": "CONFIRMED", "totalAmount": 46.18, "items": [ { "productId": 1, "quantity": 2, "unitPrice": 23.09 } ]

}'

SI LA ORDEN PROCEDE PORQUE HAY DISPONIBILIDAD SE ESPERA UNA RESPUESTA COMO POR EJEMPLO:

{ "id": 1, "customerName": "MIGUELSTACK", "customerEmail": "SASKE.MADARA@GMAIL.COM", "orderDate": "2025-10-11T05:27:15.553", "status": "CONFIRMED", "totalAmount": 46.18, "items": [ { "id": 1, "productId": 1, "quantity": 2, "unitPrice": 23.09 } ] }

5 - PARA CONSULTAR UNA ORDEN POR ID SE USA :

curl -X 'GET'
'http://localhost:8082/api/orders/1'
-H 'accept: /'

6- TAMBIEN PODEMOS CONSULTAR TODOS LOS PEDIDOS curl -X 'GET'
'http://localhost:8082/api/orders'
-H 'accept: /'

About

Test de prueba para grupokabat

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published