ok
This commit is contained in:
@@ -4,7 +4,7 @@ Test harness mínimo para probar el adapter `kumare-adapter-spring-visma-time` v
|
|||||||
|
|
||||||
## Qué hace
|
## Qué hace
|
||||||
|
|
||||||
Expone 6 endpoints que son passthroughs directos al API de VismaTime (GeoVictoria), usados
|
Expone 7 endpoints que son passthroughs directos al API de VismaTime (GeoVictoria), usados
|
||||||
para ejercitar el adapter durante desarrollo:
|
para ejercitar el adapter durante desarrollo:
|
||||||
|
|
||||||
| Método | Path | Acción |
|
| Método | Path | Acción |
|
||||||
@@ -18,6 +18,7 @@ para ejercitar el adapter durante desarrollo:
|
|||||||
| POST | `/time/api/clientele/clients/attendance/book` | Libro de asistencia (rango de fechas + usuarios) |
|
| POST | `/time/api/clientele/clients/attendance/book` | Libro de asistencia (rango de fechas + usuarios) |
|
||||||
|
|
||||||
La colección Postman está en [`postman/visma-time.postman_collection.json`](postman/visma-time.postman_collection.json).
|
La colección Postman está en [`postman/visma-time.postman_collection.json`](postman/visma-time.postman_collection.json).
|
||||||
|
Una traza de ejemplo (credenciales/tokens redactados) está en [`traces/visma-endpoints-trace.log`](traces/visma-endpoints-trace.log).
|
||||||
|
|
||||||
## Correr
|
## Correr
|
||||||
|
|
||||||
@@ -25,8 +26,10 @@ La colección Postman está en [`postman/visma-time.postman_collection.json`](po
|
|||||||
mvn spring-boot:run
|
mvn spring-boot:run
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Clase main: `io.kumare.iqr.TimeApplication`.
|
||||||
|
|
||||||
No requiere Postgres ni ninguna otra base de datos — el autoconfig de JPA/DataSource está
|
No requiere Postgres ni ninguna otra base de datos — el autoconfig de JPA/DataSource está
|
||||||
excluido explícitamente en `IqrApplication` porque `kumare-base-server-spring` trae
|
excluido explícitamente en `TimeApplication` porque `kumare-base-server-spring` trae
|
||||||
`spring-boot-starter-data-jpa` transitivamente aunque no haya entidades locales.
|
`spring-boot-starter-data-jpa` transitivamente aunque no haya entidades locales.
|
||||||
|
|
||||||
Credenciales de Visma (`visma.server`, `visma.user`, `visma.password`) en
|
Credenciales de Visma (`visma.server`, `visma.user`, `visma.password`) en
|
||||||
@@ -42,7 +45,18 @@ Con `logging.level.io.kumare=DEBUG` (ya configurado) se ven en el log:
|
|||||||
|
|
||||||
## Estructura
|
## Estructura
|
||||||
|
|
||||||
Este proyecto se clonó de otra app IQR y se recortó: solo queda `io.kumare.iqr.mod.clientele.action.client`
|
Este proyecto se clonó de otra app IQR y se recortó a lo mínimo: solo queda el módulo `visma`
|
||||||
(las acciones Visma) más el framework base (`io.kumare.iqr.app.*`). Los módulos de negocio
|
(`io.kumare.iqr.mod.visma`, antes `clientele`) con las acciones y endpoints de VismaTime, más
|
||||||
originales (authentication, biz, loyalty, pocket, taxonomy) y el CRUD local de Client/ClientRelation
|
el framework base (`io.kumare.iqr.app.*`). Los módulos de negocio originales (authentication,
|
||||||
se eliminaron por no tener relación con probar el adapter.
|
biz, loyalty, pocket, taxonomy) y el CRUD local de Client/ClientRelation se eliminaron por no
|
||||||
|
tener relación con probar el adapter.
|
||||||
|
|
||||||
|
```
|
||||||
|
io.kumare.iqr.mod.visma/
|
||||||
|
VismaConstants.java, VismaModule.java, VismaController.java
|
||||||
|
action/ — GvTime, PunchType, y las 7 acciones Visma*Action/Argument
|
||||||
|
endpoint/rest/ — AbstractVismaRest, VismaRest
|
||||||
|
```
|
||||||
|
|
||||||
|
Nota: los paths REST (`/clientele/clients/...`) se dejaron igual — solo se renombraron las
|
||||||
|
clases y el paquete Java — para no romper la colección Postman ni la traza ya compartidas.
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ import io.kumare.iqr.app.App;
|
|||||||
HibernateJpaAutoConfiguration.class
|
HibernateJpaAutoConfiguration.class
|
||||||
})
|
})
|
||||||
@EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO)
|
@EnableSpringDataWebSupport(pageSerializationMode = EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO)
|
||||||
public class IqrApplication {
|
public class TimeApplication {
|
||||||
|
|
||||||
// ::: cons
|
// ::: cons
|
||||||
//
|
//
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
var innerContext = SpringApplication.run(IqrApplication.class, args);
|
var innerContext = SpringApplication.run(TimeApplication.class, args);
|
||||||
|
|
||||||
// app
|
// app
|
||||||
App.getEngine().getBase().setInnerContext(innerContext);
|
App.getEngine().getBase().setInnerContext(innerContext);
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ public class AppConstants {
|
|||||||
|
|
||||||
// ::: modules
|
// ::: modules
|
||||||
//
|
//
|
||||||
public static final int CLIENTELE_CODE = 5;
|
public static final int VISMA_CODE = 5;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package io.kumare.iqr.app.module;
|
|||||||
// base
|
// base
|
||||||
import io.kumare.lib.base.server.spring.module.BaseModules;
|
import io.kumare.lib.base.server.spring.module.BaseModules;
|
||||||
// app
|
// app
|
||||||
import io.kumare.iqr.mod.clientele.ClienteleModule;
|
import io.kumare.iqr.mod.visma.VismaModule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -16,17 +16,17 @@ public class AppModules extends BaseModules {
|
|||||||
|
|
||||||
// ::: constants
|
// ::: constants
|
||||||
//
|
//
|
||||||
public static final ClienteleModule clientele = new ClienteleModule();
|
public static final VismaModule visma = new VismaModule();
|
||||||
|
|
||||||
// ::: modules
|
// ::: modules
|
||||||
//
|
//
|
||||||
public ClienteleModule getClientele() {
|
public VismaModule getVisma() {
|
||||||
return clientele;
|
return visma;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ::: init
|
// ::: init
|
||||||
//
|
//
|
||||||
public void init() {
|
public void init() {
|
||||||
add(clientele);
|
add(visma);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package io.kumare.iqr.mod.clientele;
|
|
||||||
|
|
||||||
// base
|
|
||||||
import io.kumare.iqr.app.AppConstants;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author afatecha
|
|
||||||
*/
|
|
||||||
public class ClienteleConstants {
|
|
||||||
|
|
||||||
// ::: codes
|
|
||||||
//
|
|
||||||
public static final int CODE = AppConstants.CLIENTELE_CODE;
|
|
||||||
public static final String NAME = "clientele";
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package io.kumare.iqr.mod.clientele;
|
|
||||||
|
|
||||||
// java
|
|
||||||
import io.kumare.lib.base.server.spring.module.BaseModule;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author afatecha
|
|
||||||
*/
|
|
||||||
public class ClienteleModule extends BaseModule {
|
|
||||||
|
|
||||||
// :::
|
|
||||||
//
|
|
||||||
public static final ClienteleController controller = new ClienteleController();
|
|
||||||
|
|
||||||
// ::: api
|
|
||||||
//
|
|
||||||
@Override
|
|
||||||
public int getId() {
|
|
||||||
return ClienteleConstants.CODE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return ClienteleConstants.NAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ClienteleController getController() {
|
|
||||||
return controller;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package io.kumare.iqr.mod.visma;
|
||||||
|
|
||||||
|
// base
|
||||||
|
import io.kumare.iqr.app.AppConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author afatecha
|
||||||
|
*/
|
||||||
|
public class VismaConstants {
|
||||||
|
|
||||||
|
// ::: codes
|
||||||
|
//
|
||||||
|
public static final int CODE = AppConstants.VISMA_CODE;
|
||||||
|
public static final String NAME = "visma";
|
||||||
|
|
||||||
|
}
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele;
|
package io.kumare.iqr.mod.visma;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -17,7 +17,7 @@ import io.kumare.iqr.app.module.AppModuleController;
|
|||||||
*
|
*
|
||||||
* @author afatecha
|
* @author afatecha
|
||||||
*/
|
*/
|
||||||
public class ClienteleController extends AppModuleController {
|
public class VismaController extends AppModuleController {
|
||||||
|
|
||||||
// ::: api
|
// ::: api
|
||||||
//
|
//
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package io.kumare.iqr.mod.visma;
|
||||||
|
|
||||||
|
// java
|
||||||
|
import io.kumare.lib.base.server.spring.module.BaseModule;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author afatecha
|
||||||
|
*/
|
||||||
|
public class VismaModule extends BaseModule {
|
||||||
|
|
||||||
|
// :::
|
||||||
|
//
|
||||||
|
public static final VismaController controller = new VismaController();
|
||||||
|
|
||||||
|
// ::: api
|
||||||
|
//
|
||||||
|
@Override
|
||||||
|
public int getId() {
|
||||||
|
return VismaConstants.CODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return VismaConstants.NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VismaController getController() {
|
||||||
|
return controller;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
import java.time.*;
|
import java.time.*;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Enum.java to edit this template
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Enum.java to edit this template
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import io.kumare.adapter.spring.vismatime.message.punch.model.AddArtificialRequest;
|
import io.kumare.adapter.spring.vismatime.message.punch.model.AddArtificialRequest;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// app
|
// app
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import io.kumare.adapter.spring.vismatime.message.punch.model.AddMultipleItemRequest;
|
import io.kumare.adapter.spring.vismatime.message.punch.model.AddMultipleItemRequest;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// app
|
// app
|
||||||
import io.kumare.adapter.spring.vismatime.message.punch.model.AddMultipleRequest;
|
import io.kumare.adapter.spring.vismatime.message.punch.model.AddMultipleRequest;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import io.kumare.adapter.spring.vismatime.message.attendance.model.AttendanceBookRequest;
|
import io.kumare.adapter.spring.vismatime.message.attendance.model.AttendanceBookRequest;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import io.kumare.adapter.spring.vismatime.message.punch.model.AddArtificialRequest;
|
import io.kumare.adapter.spring.vismatime.message.punch.model.AddArtificialRequest;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// app
|
// app
|
||||||
/**
|
/**
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import io.kumare.adapter.spring.vismatime.message.user.model.UserItemResponse;
|
import io.kumare.adapter.spring.vismatime.message.user.model.UserItemResponse;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import io.kumare.adapter.spring.vismatime.message.punch.model.PaginatedListByDateRequest;
|
import io.kumare.adapter.spring.vismatime.message.punch.model.PaginatedListByDateRequest;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// app
|
// app
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.action.client;
|
package io.kumare.iqr.mod.visma.action;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import io.kumare.adapter.spring.vismatime.message.punch.model.PaginatedListByDateRequest;
|
import io.kumare.adapter.spring.vismatime.message.punch.model.PaginatedListByDateRequest;
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.endpoint.rest;
|
package io.kumare.iqr.mod.visma.endpoint.rest;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import io.kumare.iqr.app.action.AppActionArgument;
|
import io.kumare.iqr.app.action.AppActionArgument;
|
||||||
import io.kumare.iqr.app.endpoint.rest.AppEndpointRest;
|
import io.kumare.iqr.app.endpoint.rest.AppEndpointRest;
|
||||||
// module
|
// module
|
||||||
import io.kumare.iqr.mod.clientele.action.client.*;
|
import io.kumare.iqr.mod.visma.action.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stateless passthrough endpoints to the VismaTime adapter — no local
|
* Stateless passthrough endpoints to the VismaTime adapter — no local
|
||||||
@@ -25,7 +25,7 @@ import io.kumare.iqr.mod.clientele.action.client.*;
|
|||||||
*
|
*
|
||||||
* @author afatecha
|
* @author afatecha
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractClientRest extends AppEndpointRest {
|
public abstract class AbstractVismaRest extends AppEndpointRest {
|
||||||
|
|
||||||
// ::: EMPLOYEE LIST
|
// ::: EMPLOYEE LIST
|
||||||
//
|
//
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package io.kumare.iqr.mod.clientele.endpoint.rest;
|
package io.kumare.iqr.mod.visma.endpoint.rest;
|
||||||
|
|
||||||
// java
|
// java
|
||||||
import io.swagger.v3.oas.annotations.tags.*;
|
import io.swagger.v3.oas.annotations.tags.*;
|
||||||
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
//
|
//
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/clientele/clients")
|
@RequestMapping("/clientele/clients")
|
||||||
public class ClientRest extends AbstractClientRest {
|
public class VismaRest extends AbstractVismaRest {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user