|
|
@@ -7,6 +7,7 @@ cd /home/uriri/Projetos/tooeasy/backend/too-easy-genesis
|
|
|
```bash
|
|
|
./mvnw -DskipTests spring-boot:run
|
|
|
```
|
|
|
+
|
|
|
```bash
|
|
|
java -jar target/too-easy-trader-genesis-0.0.1-SNAPSHOT.jar --server.port=8080
|
|
|
```
|
|
|
@@ -25,6 +26,8 @@ Default headers for protected routes:
|
|
|
- Authorization: Bearer {{token}}
|
|
|
- Content-Type: application/json
|
|
|
|
|
|
+# IMPORTANTE: JWT ATUALMENTE ESTÁ SEM LIMITE DE TEMPO POR QUESTÃO DE TESTES!
|
|
|
+
|
|
|
## Register
|
|
|
|
|
|
#### Create a Default user with:
|
|
|
@@ -131,136 +134,160 @@ Notes:
|
|
|
Notes:
|
|
|
- Protected by JWT (Authorization: Bearer {{token}}).
|
|
|
|
|
|
+## Company API (`com.platform2easy.genesis.web.controller.CompanyController`)
|
|
|
+#### Base path: {{baseUrl}}/api/company
|
|
|
|
|
|
-## Compra API (`com.platform2easy.genesis.web.controller.CompraController`)
|
|
|
-#### Base path: {{baseUrl}}/api/compra
|
|
|
-
|
|
|
-#### - GET {{baseUrl}}/api/compra
|
|
|
+- GET {{baseUrl}}/api/company
|
|
|
+ - List all companies.
|
|
|
|
|
|
-#### - GET {{baseUrl}}/api/compra/{id}
|
|
|
+- GET {{baseUrl}}/api/company/{id}
|
|
|
- Path params: id (Long)
|
|
|
|
|
|
-#### - POST {{baseUrl}}/api/compra
|
|
|
- - Body — entity `Compra` with nested `ItemCompra` list:
|
|
|
+- POST {{baseUrl}}/api/company
|
|
|
+ - Body — entity `Company` (`domain/model/Company.java`):
|
|
|
```json
|
|
|
{
|
|
|
- "fornecedor": "Fornecedor XYZ",
|
|
|
- "itens": [
|
|
|
- { "quantidade": 10, "valor": 35.5, "descricao": "Item A" },
|
|
|
- { "quantidade": 5, "valor": 100.0, "descricao": "Item B" }
|
|
|
- ]
|
|
|
+ "name": "Minha Empresa",
|
|
|
+ "flag": "ACTIVE"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-#### - PUT {{baseUrl}}/api/compra/{id}
|
|
|
+- PUT {{baseUrl}}/api/company/{id}
|
|
|
- Body: same as POST
|
|
|
|
|
|
-#### - DELETE {{baseUrl}}/api/compra/{id}
|
|
|
+- DELETE {{baseUrl}}/api/company/{id}
|
|
|
|
|
|
Notes:
|
|
|
-- `Compra` and `ItemCompra` live in `domain/model/Compra.java` and `domain/model/ItemCompra.java`.
|
|
|
-- IDs are generated; omit `id` in POST bodies.
|
|
|
-
|
|
|
+- Protected by JWT (Authorization: Bearer {{token}}).
|
|
|
+- Fields: `name` (String), `flag` (String).
|
|
|
|
|
|
-## CPR - Emissão (`com.platform2easy.genesis.web.controller.cerc.EmissaoCprController`)
|
|
|
-#### Base path: {{baseUrl}}/api/cpr/emission
|
|
|
+## Wallet API (`com.platform2easy.genesis.web.controller.WalletController`)
|
|
|
+#### Base path: {{baseUrl}}/api/wallet
|
|
|
|
|
|
-#### - GET {{baseUrl}}/api/cpr/emission
|
|
|
+- GET {{baseUrl}}/api/wallet
|
|
|
+ - List all wallets.
|
|
|
|
|
|
-#### - GET {{baseUrl}}/api/cpr/emission/{id}
|
|
|
+- GET {{baseUrl}}/api/wallet/{id}
|
|
|
+ - Path params: id (Long)
|
|
|
|
|
|
-#### - POST {{baseUrl}}/api/cpr/emission
|
|
|
- - Body — entity `EmissaoCpr`:
|
|
|
+- POST {{baseUrl}}/api/wallet
|
|
|
+ - Body — entity `Wallet` (`domain/model/Wallet.java`):
|
|
|
```json
|
|
|
{
|
|
|
- "dataEntrega": "2025-11-01",
|
|
|
- "localEmissao": "São Paulo",
|
|
|
- "razaoSocialEmissor": "Empresa Emissora SA",
|
|
|
- "tipoCpr": "FISICO"
|
|
|
+ "companyId": 1,
|
|
|
+ "publicKey": "WALLET_PUBLIC_KEY",
|
|
|
+ "privateKey": "WALLET_PRIVATE_KEY",
|
|
|
+ "flag": "ACTIVE",
|
|
|
+ "chainId": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-#### - PUT {{baseUrl}}/api/cpr/emission/{id}
|
|
|
+- PUT {{baseUrl}}/api/wallet/{id}
|
|
|
- Body: same as POST
|
|
|
|
|
|
-#### - DELETE {{baseUrl}}/api/cpr/emission/{id}
|
|
|
+- DELETE {{baseUrl}}/api/wallet/{id}
|
|
|
|
|
|
Notes:
|
|
|
-- `tipoCpr` enum values: `FISICO`, `FINANCEIRO` (`domain/model/cerc/TipoCpr.java`).
|
|
|
-- `dataEntrega` is ISO LocalDate.
|
|
|
-
|
|
|
+- Protected by JWT (Authorization: Bearer {{token}}).
|
|
|
+- Fields: `companyId` (Long), `publicKey` (String), `privateKey` (String), `flag` (String), `chainId` (Long).
|
|
|
|
|
|
-## CPR - Contrato de Valor (`com.platform2easy.genesis.web.controller.cerc.ContratoValorCprController`)
|
|
|
-Base path: {{baseUrl}}/api/cpr/contract
|
|
|
+## Token API (`com.platform2easy.genesis.web.controller.TokenController`)
|
|
|
+#### Base path: {{baseUrl}}/api/token
|
|
|
|
|
|
-#### - GET {{baseUrl}}/api/cpr/contract
|
|
|
+- GET {{baseUrl}}/api/token
|
|
|
+ - List all tokens.
|
|
|
|
|
|
-#### - GET {{baseUrl}}/api/cpr/contract/{id}
|
|
|
+- GET {{baseUrl}}/api/token/{id}
|
|
|
+ - Path params: id (Long)
|
|
|
|
|
|
-#### - POST {{baseUrl}}/api/cpr/contract
|
|
|
- - Body — entity `ContratoValorCpr` (all fields optional except as required by business rules):
|
|
|
+- POST {{baseUrl}}/api/token
|
|
|
+ - Body — entity `Token` (`domain/model/Token.java`):
|
|
|
```json
|
|
|
{
|
|
|
- "autorizoRegistroEDeclaroQueFoiDadoBaixaNoRegistroEmQuaisquerOutrasIf": true,
|
|
|
- "codigoContratoOperacaoCredito": "OP123",
|
|
|
- "codigoContratoScr": "SCR-456",
|
|
|
- "codigoMoeda": "BRL",
|
|
|
- "dataBaixaOutraIf": "2025-10-01T10:00:00",
|
|
|
- "dataContratoSistemaIF": "2025-09-15T09:30:00",
|
|
|
- "dataRegistroOriginal": "2025-09-01T08:00:00",
|
|
|
- "dataTransacao": "2025-10-02",
|
|
|
- "identificacaoPadronizadaOperacaoCredito": "ID-789",
|
|
|
- "indexacao": "CDI",
|
|
|
- "naturezaOperacao": "CREDITO_RURAL",
|
|
|
- "percentualIndexador": 0.12,
|
|
|
- "quantidadeParcelaContratada": 12,
|
|
|
- "referenciaExterna": "REF-2025",
|
|
|
- "taxaJurosOperacao": 0.15,
|
|
|
- "tipoAtivo": "CPR",
|
|
|
- "valorFinanciadoContrato": 100000.00,
|
|
|
- "valorLiquidoCredito": 95000.00,
|
|
|
- "valorTotalCredito": 110000.00
|
|
|
+ "externalId": "1",
|
|
|
+ "commoditiesAmount": 100,
|
|
|
+ "flag": "ACTIVE",
|
|
|
+ "commoditiesValue": 5000,
|
|
|
+ "walletId": 1,
|
|
|
+ "chainId": 1,
|
|
|
+ "commoditiesId": 1,
|
|
|
+ "cprId": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-#### - PUT {{baseUrl}}/api/cpr/contract/{id}
|
|
|
+- PUT {{baseUrl}}/api/token/{id}
|
|
|
- Body: same as POST
|
|
|
|
|
|
-#### - DELETE {{baseUrl}}/api/cpr/contract/{id}
|
|
|
+- DELETE {{baseUrl}}/api/token/{id}
|
|
|
|
|
|
Notes:
|
|
|
-- Date/time fields use ISO-8601: LocalDate `yyyy-MM-dd`, LocalDateTime `yyyy-MM-dd'T'HH:mm:ss`.
|
|
|
-
|
|
|
+- Protected by JWT (Authorization: Bearer {{token}}).
|
|
|
+- Fields: `externalId` (String), `commoditiesAmount` (Integer), `flag` (String), `commoditiesValue` (Integer), `walletId` (Long), `chainId` (Long), `commoditiesId` (Long), `cprId` (Long).
|
|
|
|
|
|
-## CPR - Solicitação de Registro (`com.platform2easy.genesis.web.controller.cerc.SolicitacaoRegistroCprController`)
|
|
|
-Base path: {{baseUrl}}/api/cpr/register
|
|
|
+## TxCoin API (`com.platform2easy.genesis.web.controller.TxCoinController`)
|
|
|
+#### Base path: {{baseUrl}}/api/tx_coin
|
|
|
|
|
|
-#### - GET {{baseUrl}}/api/cpr/register
|
|
|
+- GET {{baseUrl}}/api/tx_coin
|
|
|
+ - List all tx_coin entries.
|
|
|
|
|
|
-#### - GET {{baseUrl}}/api/cpr/register/{id}
|
|
|
+- GET {{baseUrl}}/api/tx_coin/{id}
|
|
|
+ - Path params: id (String)
|
|
|
|
|
|
-#### - POST {{baseUrl}}/api/cpr/register
|
|
|
- - Body — entity `SolicitacaoRegistroCpr` (references other entities by id):
|
|
|
+- POST {{baseUrl}}/api/tx_coin
|
|
|
+ - Body — entity `TxCoin` (`domain/model/TxCoin.java`):
|
|
|
```json
|
|
|
{
|
|
|
- "aditivo": "Aditivo 1",
|
|
|
- "contratoValorCpr": { "id": 1 },
|
|
|
- "emissaoCpr": { "id": 1 },
|
|
|
- "status": "NOVO"
|
|
|
+ "id": "1",
|
|
|
+ "value": "1000.00",
|
|
|
+ "flag": "ACTIVE",
|
|
|
+ "ts": 1696200000,
|
|
|
+ "fromAddress": "",
|
|
|
+ "toAddress": "",
|
|
|
+ "currencyId": 1,
|
|
|
+ "chainId": 1
|
|
|
}
|
|
|
```
|
|
|
|
|
|
-#### - PUT {{baseUrl}}/api/cpr/register/{id}
|
|
|
+- PUT {{baseUrl}}/api/tx_coin/{id}
|
|
|
- Body: same as POST
|
|
|
|
|
|
-#### - POST {{baseUrl}}/api/cpr/register/{id}/send
|
|
|
- - Effect: loads record by id and sets `status` to `ACEITO`.
|
|
|
-
|
|
|
-#### - DELETE {{baseUrl}}/api/cpr/register/{id}
|
|
|
+- DELETE {{baseUrl}}/api/tx_coin/{id}
|
|
|
|
|
|
Notes:
|
|
|
-- `status` enum values: `NOVO`, `ACEITO`, `LIQUIDADO`, `RECUSADO`, `CANCELADO`.
|
|
|
+- Protected by JWT (Authorization: Bearer {{token}}).
|
|
|
+- Fields: `id` (String), `value` (String), `flag` (String), `ts` (Integer), `fromAddress` (String), `toAddress` (String), `currencyId` (Long), `chainId` (Long).
|
|
|
+
|
|
|
+## TxToken API (`com.platform2easy.genesis.web.controller.TxTokenController`)
|
|
|
+#### Base path: {{baseUrl}}/api/tx_token
|
|
|
+
|
|
|
+- GET {{baseUrl}}/api/tx_token
|
|
|
+ - List all tx_token entries.
|
|
|
+
|
|
|
+- GET {{baseUrl}}/api/tx_token/{id}
|
|
|
+ - Path params: id (String)
|
|
|
+
|
|
|
+- POST {{baseUrl}}/api/tx_token
|
|
|
+ - Body — entity `TxToken` (`domain/model/TxToken.java`):
|
|
|
+```json
|
|
|
+{
|
|
|
+ "id": "0xTXTOKEN123",
|
|
|
+ "flag": "ACTIVE",
|
|
|
+ "ts": 1696200000,
|
|
|
+ "fromAddress": "0xFROM",
|
|
|
+ "toAddress": "0xTO",
|
|
|
+ "tokenId": 1,
|
|
|
+ "chainId": 1
|
|
|
+}
|
|
|
+```
|
|
|
|
|
|
+- PUT {{baseUrl}}/api/tx_token/{id}
|
|
|
+ - Body: same as POST
|
|
|
+
|
|
|
+- DELETE {{baseUrl}}/api/tx_token/{id}
|
|
|
+
|
|
|
+Notes:
|
|
|
+- Protected by JWT (Authorization: Bearer {{token}}).
|
|
|
+- Fields: `id` (String), `flag` (String), `ts` (Integer), `fromAddress` (String), `toAddress` (String), `tokenId` (Long), `chainId` (Long).
|
|
|
|
|
|
## Quick Postman steps
|
|
|
1. Choose a login:
|