Table of Contents
[TOCM]
[TOC]
Kruger Corporation requires an application to keep track of the inventory of the state of employee vaccination.
Coded by: Diego Salazar
email: [email protected]
github: https://github.com/diogosss
The application was build for gradle using SpringBoot 2.7.0 for Java 11.
The structure of the project is:
- Domain
- Services
- Respository
- Commons
- Web
- Controllers (Api rest)
- Config
- Persistence
- CrudRepository
- Entity
It is based in the Domain Driven Design
The server port used is
port:8081
To be able to run this program without complications it is necessary the next PostgreSQL characteristics
- PostgreSQL database name :
testemployees
- PostgreSQL table name :
empleados
To create a table empleados
with all the entities necessary, you can use this .sql file:
Or you can create a database table with the next specifications
Name | Data type | Length | Not NULL? |
---|---|---|---|
empleado_id | integer | YES | |
cedula | integer | YES | |
nombres | character varying | 100 | YES |
apellidos | character varying | 100 | YES |
correo | character varying | 100 | YES |
direccion | character varying | 200 | NO |
telefono | integer | NO | |
estadovac | boolean | NO | |
tipovac | character varying | 100 | NO |
nacimiento | date | NO | |
fechavacuna | date | NO | |
numdosis | integer | NO |
You can find example of data to insert by the application in this file:
Or you can send data in this format:
One employee:
{
"cedula":1787524596,
"nombres":"Diego Andres",
"apellidos":"Salazar Luna",
"correo":"[email protected]"
}
List employees:
[
{
"nombres": "Pepito Jose",
"apellidos": "Suarez Cespedes",
"correo": "[email protected]",
"cedula": 1714121510
},
{
"nombres": "Juanito Manuel",
"apellidos": "Flores Arias",
"correo": "[email protected]",
"cedula": 1714169501
}
]
The present code was compiled with:
- Java version 11
- openjdk version "11.0.15" 2022-04-19
- OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10)
- OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode)
- Spring Boot version : 2.7.0
- Swagger2 version : 2.9.2
- Postgre Sql version : 12
In the command line run the next line of code to start the server:
$> java -jar inventariovac-1.0.0.jar
The .jar file can be download from:
To test and see the documentation of this API you can with Swagger2 in the next address:
You can find a Postman collection to test this application in this file:
KruggerChallenge.postman_collection.json
- Implementation OAuth 2.0
- Creation of Users and Passwords for Administrators and Employees
- Authentication based in roles