Skip to content

alansartor/kardex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kardex Api

Documentacion de los metodos expuesto por la Api

(IDE: Eclipse - Import as Existing Maven Projects)

Endpoints

Datos de prueba:
Username Password Rol

empleado

123456

EMPLEADO

cliente

123456

CLIENTE

POST /login

Devuleve token de seguridad para consumir los demas endpoints

Request

Table 1. Request Body:
Path Type Description

username

String

Username

password

String

Password

Response

Table 2. Response fields:
Path Type Description

status

Number

Siempre 200

token

String

Token de seguridad para consumir los demas metodos, expira dentre de 60 minutos

Examples

Curl Request:
$ curl 'http://localhost:8080/login' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -H 'Accept: application/json' \
    -d '{"username":"empleado","password":"123456"}'
HTTP Request:
GET /items HTTP/1.1
Authorization: Bearer Token...
Host: localhost:8080
HTTP Response:
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 209

{"status":200,"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJlbXBsZWFkbyIsInJvbCI6IlJPTEVfRU1QTEVBRE8iLCJleHAiOjE2MzA5ODEwMTV9.cQeVkRNSAPRR85nRthHGy2oTg96CubOIUFW-mvHEk0LquN8-H0i3Q-HSHfjsIOd51ccyZ0hWnYcA3YNz6ph07w"}

POST /entrada

Registra ingreso de articulos al stock (solo puede ser ejecutado por usuario con rol EMPLEADO)

Examples

Curl Request:
$ curl 'http://localhost:8080/entrada' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -H 'Accept: application/json' \
	-H 'Authorization: Bearer Token...' \
    -d '{"itemCodigo": "CAM_0001","valorUnitario": 134 ,"cantidad": 18}'

POST /salida

Registra salida de articulos del stock (solo puede ser ejecutado por usuario con rol CLIENTE)

Examples

Curl Request:
$ curl 'http://localhost:8080/salida' -i -X POST \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -H 'Accept: application/json' \
	-H 'Authorization: Bearer Token...' \
    -d '{"itemCodigo": "CAM_0001","valorUnitario": 134 ,"cantidad": 18}'

GET /items

Devuelve todos los Articulos

Accesible para Roles:
 EMPLEADO
 CLIENTE

Request

Table 3. Request Header:
Name Description

Authorization

Bearer Token…​

Request Body:

Response

Table 4. Response fields:
Path Type Description

[].id

Number

El identificador unico del articulo

[].codigo

String

El codigo del articulo (es unico)

[].tipo

String

Tipo de articulo

[].descripcion

String

Descripcion del articulo

Examples

Curl Request:
$ curl 'http://localhost:8080/items' -i -X GET \
    -H 'Authorization: Bearer Token...'
HTTP Request:
GET /items HTTP/1.1
Authorization: Bearer Token...
Host: localhost:8080
HTTP Response:
HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 162

[{"id":1,"codigo":"CAM_0001","tipo":"Camiseta","descripcion":"Camiseta Marvel"},{"id":2,"codigo":"CAM_0002","tipo":"Camiseta","descripcion":"Camiseta DC comics"}]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages