177 lines
6.0 KiB
HTTP
177 lines
6.0 KiB
HTTP
# Entorno de demo exclusivamente. Sustituir tokens e IDs con respuestas reales.
|
|
@base = http://localhost:8080
|
|
@editor = REEMPLAZAR
|
|
@publisher = REEMPLAZAR
|
|
@manager = REEMPLAZAR
|
|
@analista = REEMPLAZAR
|
|
@creditoV1 = REEMPLAZAR_UUID
|
|
@creditoV2 = REEMPLAZAR_UUID
|
|
@compraV1 = REEMPLAZAR_UUID
|
|
@requestId = REEMPLAZAR_UUID
|
|
@executionId = REEMPLAZAR_UUID
|
|
@documentId = REEMPLAZAR_UUID
|
|
@revision = 0
|
|
@typeRevision = 0
|
|
@eventKey = REEMPLAZAR_CLAVE_UNICA
|
|
|
|
### Crear credito-v1; copiar id a creditoV1
|
|
POST {{base}}/api/v1/admin/flows
|
|
Authorization: Bearer {{editor}}
|
|
Content-Type: application/json
|
|
|
|
< ../flows/credito-v1.json
|
|
|
|
### Validar credito-v1
|
|
POST {{base}}/api/v1/admin/flows/{{creditoV1}}/validate
|
|
Authorization: Bearer {{editor}}
|
|
|
|
### Publicar credito-v1; revisión inicial 0, publicado 1
|
|
POST {{base}}/api/v1/admin/flows/{{creditoV1}}/publish
|
|
Authorization: Bearer {{publisher}}
|
|
If-Match: "0"
|
|
|
|
### Crear credito-v2-licencia; copiar id a creditoV2
|
|
POST {{base}}/api/v1/admin/flows
|
|
Authorization: Bearer {{editor}}
|
|
Content-Type: application/json
|
|
|
|
< ../flows/credito-v2-licencia.json
|
|
|
|
### Validar credito-v2-licencia
|
|
POST {{base}}/api/v1/admin/flows/{{creditoV2}}/validate
|
|
Authorization: Bearer {{editor}}
|
|
|
|
### Publicar credito-v2-licencia; revisión inicial 0, publicado 1
|
|
POST {{base}}/api/v1/admin/flows/{{creditoV2}}/publish
|
|
Authorization: Bearer {{publisher}}
|
|
If-Match: "0"
|
|
|
|
### Crear compra-v1; copiar id a compraV1
|
|
POST {{base}}/api/v1/admin/flows
|
|
Authorization: Bearer {{editor}}
|
|
Content-Type: application/json
|
|
|
|
< ../flows/compra-v1.json
|
|
|
|
### Validar compra-v1
|
|
POST {{base}}/api/v1/admin/flows/{{compraV1}}/validate
|
|
Authorization: Bearer {{editor}}
|
|
|
|
### Publicar compra-v1; revisión inicial 0, publicado 1
|
|
POST {{base}}/api/v1/admin/flows/{{compraV1}}/publish
|
|
Authorization: Bearer {{publisher}}
|
|
If-Match: "0"
|
|
|
|
### Activar creditoV1. Para v2: crear primero una solicitud v1; usar revisión actual del tipo.
|
|
PUT {{base}}/api/v1/admin/request-types/CREDITO/active-flow
|
|
Authorization: Bearer {{manager}}
|
|
Content-Type: application/json
|
|
If-Match: "{{typeRevision}}"
|
|
|
|
{"flowId":"{{creditoV1}}"}
|
|
|
|
### Activar compraV1. Para v2: crear primero una solicitud v1; usar revisión actual del tipo.
|
|
PUT {{base}}/api/v1/admin/request-types/COMPRA/active-flow
|
|
Authorization: Bearer {{manager}}
|
|
Content-Type: application/json
|
|
If-Match: "{{typeRevision}}"
|
|
|
|
{"flowId":"{{compraV1}}"}
|
|
|
|
### Activar creditoV2. Para v2: crear primero una solicitud v1; usar revisión actual del tipo.
|
|
PUT {{base}}/api/v1/admin/request-types/CREDITO/active-flow
|
|
Authorization: Bearer {{manager}}
|
|
Content-Type: application/json
|
|
If-Match: "{{typeRevision}}"
|
|
|
|
{"flowId":"{{creditoV2}}"}
|
|
|
|
### Crear crédito (ejecutar antes y después de activar v2, con claves distintas)
|
|
POST {{base}}/api/v1/requests
|
|
Authorization: Bearer {{analista}}
|
|
Content-Type: application/json
|
|
Idempotency-Key: {{eventKey}}
|
|
|
|
{"typeKey":"CREDITO","data":{"client":"synthetic-client","consentimientoId":"synthetic-consent"}}
|
|
|
|
### Crear compra
|
|
POST {{base}}/api/v1/requests
|
|
Authorization: Bearer {{analista}}
|
|
Content-Type: application/json
|
|
Idempotency-Key: {{eventKey}}
|
|
|
|
{"typeKey":"COMPRA","data":{"client":"synthetic-client","orderId":"synthetic-order","amount":100}}
|
|
|
|
### Consultar solicitud: copiar revisión a revision, comprobar flow.id y currentState
|
|
GET {{base}}/api/v1/requests/{{requestId}}
|
|
Authorization: Bearer {{analista}}
|
|
|
|
### Consultar tarea disponible y restricciones documentales
|
|
GET {{base}}/api/v1/requests/{{requestId}}/available-events
|
|
Authorization: Bearer {{analista}}
|
|
|
|
### Consultar ejecución hasta SUCCEEDED; FAILED/RETRY_WAIT requieren atender causa
|
|
GET {{base}}/api/v1/executions/{{executionId}}
|
|
Authorization: Bearer {{analista}}
|
|
|
|
### ASIGNAR_CLIENTE: revisar tarea, actualizar revision y eventKey; licencia solo v2, confirmar solo compra
|
|
POST {{base}}/api/v1/requests/{{requestId}}/events
|
|
Authorization: Bearer {{analista}}
|
|
Content-Type: application/json
|
|
If-Match: "{{revision}}"
|
|
Idempotency-Key: {{eventKey}}
|
|
|
|
{"event":"ASIGNAR_CLIENTE","data":{}}
|
|
|
|
### REGISTRAR_INE: revisar tarea, actualizar revision y eventKey; licencia solo v2, confirmar solo compra
|
|
POST {{base}}/api/v1/requests/{{requestId}}/events
|
|
Authorization: Bearer {{analista}}
|
|
Content-Type: application/json
|
|
If-Match: "{{revision}}"
|
|
Idempotency-Key: {{eventKey}}
|
|
|
|
{"event":"REGISTRAR_INE","data":{"documentId":"{{documentId}}"}}
|
|
|
|
### REGISTRAR_ESTADO_CUENTA: revisar tarea, actualizar revision y eventKey; licencia solo v2, confirmar solo compra
|
|
POST {{base}}/api/v1/requests/{{requestId}}/events
|
|
Authorization: Bearer {{analista}}
|
|
Content-Type: application/json
|
|
If-Match: "{{revision}}"
|
|
Idempotency-Key: {{eventKey}}
|
|
|
|
{"event":"REGISTRAR_ESTADO_CUENTA","data":{"documentId":"{{documentId}}"}}
|
|
|
|
### REGISTRAR_LICENCIA: revisar tarea, actualizar revision y eventKey; licencia solo v2, confirmar solo compra
|
|
POST {{base}}/api/v1/requests/{{requestId}}/events
|
|
Authorization: Bearer {{analista}}
|
|
Content-Type: application/json
|
|
If-Match: "{{revision}}"
|
|
Idempotency-Key: {{eventKey}}
|
|
|
|
{"event":"REGISTRAR_LICENCIA","data":{"documentId":"{{documentId}}"}}
|
|
|
|
### VALIDAR_BURO: revisar tarea, actualizar revision y eventKey; licencia solo v2, confirmar solo compra
|
|
POST {{base}}/api/v1/requests/{{requestId}}/events
|
|
Authorization: Bearer {{analista}}
|
|
Content-Type: application/json
|
|
If-Match: "{{revision}}"
|
|
Idempotency-Key: {{eventKey}}
|
|
|
|
{"event":"VALIDAR_BURO","data":{}}
|
|
|
|
### CONFIRMAR_COMPRA: revisar tarea, actualizar revision y eventKey; licencia solo v2, confirmar solo compra
|
|
POST {{base}}/api/v1/requests/{{requestId}}/events
|
|
Authorization: Bearer {{analista}}
|
|
Content-Type: application/json
|
|
If-Match: "{{revision}}"
|
|
Idempotency-Key: {{eventKey}}
|
|
|
|
{"event":"CONFIRMAR_COMPRA","data":{"confirmada":true}}
|
|
|
|
# Probar confirmada:false en otra compra para COMPRA_CANCELADA.
|
|
# Configurar proveedor mock con score 71/70/61/60 para N/M/M/REVISION_MANUAL.
|
|
# INVALID + reasonCodes:["EXPIRED"] conserva LICENCIA_PENDIENTE; nuevo evento VALID avanza.
|
|
# Cada ensayo de score usa otra solicitud y documentos propios. No enviar score desde el cliente.
|
|
# DemoFlowsIT automatiza estas variantes sin editar rutas ni contactar proveedores reales.
|
|
|