Update README
This commit is contained in:
@@ -99,6 +99,9 @@ Loads the onboarding screen: scheme/slider text configuration and the user's exi
|
|||||||
|
|
||||||
The frontend sends **no body fields** to erangel for this endpoint. All common fields below are injected by erangel.
|
The frontend sends **no body fields** to erangel for this endpoint. All common fields below are injected by erangel.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"client": "BRIMON", // [EG]
|
"client": "BRIMON", // [EG]
|
||||||
@@ -110,10 +113,15 @@ The frontend sends **no body fields** to erangel for this endpoint. All common f
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Struct: `usecase.OnboardingRequest` (`internal/interfaces/usecase/loa.go:51`)
|
Struct: `usecase.OnboardingRequest` (`internal/interfaces/usecase/loa.go:51`)
|
||||||
|
|
||||||
### Response Body (200)
|
### Response Body (200)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Response Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"code": "00",
|
"code": "00",
|
||||||
@@ -299,6 +307,8 @@ Struct: `usecase.OnboardingRequest` (`internal/interfaces/usecase/loa.go:51`)
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
`data` is `usecase.OnboardingResponse`.
|
`data` is `usecase.OnboardingResponse`.
|
||||||
|
|
||||||
`admin_fee_note` carries the admin fee info banner shown in the scheme bottom sheet (title: "Ketentuan Biaya Admin", content: "1% dari total pinjaman (min. Rp200.000)").
|
`admin_fee_note` carries the admin fee info banner shown in the scheme bottom sheet (title: "Ketentuan Biaya Admin", content: "1% dari total pinjaman (min. Rp200.000)").
|
||||||
@@ -307,6 +317,9 @@ Each `scheme` item now only contains `tenor` and `bunga` (removed `nominal_trans
|
|||||||
|
|
||||||
Each item in `processing`/`rejected`/`approved.list` is `usecase.Application`:
|
Each item in `processing`/`rejected`/`approved.list` is `usecase.Application`:
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Application item schema</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"ticket_no": "...",
|
"ticket_no": "...",
|
||||||
@@ -346,6 +359,8 @@ Each item in `processing`/`rejected`/`approved.list` is `usecase.Application`:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
**`status` / `status_string` mapping:**
|
**`status` / `status_string` mapping:**
|
||||||
|
|
||||||
| `status` | `status_string` | Description |
|
| `status` | `status_string` | Description |
|
||||||
@@ -382,6 +397,9 @@ Lists all the credit cards the user owns that are eligible for loan-on-app.
|
|||||||
|
|
||||||
The frontend sends **no body fields** to erangel for this endpoint. All common fields below are injected by erangel.
|
The frontend sends **no body fields** to erangel for this endpoint. All common fields below are injected by erangel.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Request Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"client": "BRIMON", // [EG]
|
"client": "BRIMON", // [EG]
|
||||||
@@ -393,10 +411,15 @@ The frontend sends **no body fields** to erangel for this endpoint. All common f
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Struct: `usecase.LoaListRequest` (`internal/interfaces/usecase/loa.go:186`)
|
Struct: `usecase.LoaListRequest` (`internal/interfaces/usecase/loa.go:186`)
|
||||||
|
|
||||||
### Response Body (200)
|
### Response Body (200)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Response Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"code": "00",
|
"code": "00",
|
||||||
@@ -423,6 +446,8 @@ Struct: `usecase.LoaListRequest` (`internal/interfaces/usecase/loa.go:186`)
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
`data` is `usecase.LoaListResponse`. When the user has no eligible cards, `code` is `01` and `account` is an empty array (see `list.go:83-86`).
|
`data` is `usecase.LoaListResponse`. When the user has no eligible cards, `code` is `01` and `account` is an empty array (see `list.go:83-86`).
|
||||||
|
|
||||||
### Error Codes
|
### Error Codes
|
||||||
@@ -456,13 +481,21 @@ Loads the loan form: source accounts, T&C text, product type, min/max loan range
|
|||||||
| `channel_id` | string | [EG] | yes | `NBMB` |
|
| `channel_id` | string | [EG] | yes | `NBMB` |
|
||||||
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Frontend → Erangel</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// Frontend → Erangel
|
|
||||||
{
|
{
|
||||||
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0"
|
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0"
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
// Erangel → Doom (constructed in Doom.php:81)
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Erangel → Doom (constructed in Doom.php:81)</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"client": "BRIMON",
|
"client": "BRIMON",
|
||||||
"request_refnum": "123456789154",
|
"request_refnum": "123456789154",
|
||||||
@@ -474,10 +507,15 @@ Loads the loan form: source accounts, T&C text, product type, min/max loan range
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Struct: `usecase.LoaFormRequest` (`internal/interfaces/usecase/loa.go:20`)
|
Struct: `usecase.LoaFormRequest` (`internal/interfaces/usecase/loa.go:20`)
|
||||||
|
|
||||||
### Response Body (200)
|
### Response Body (200)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Response Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"code": "00",
|
"code": "00",
|
||||||
@@ -509,6 +547,8 @@ Struct: `usecase.LoaFormRequest` (`internal/interfaces/usecase/loa.go:20`)
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
`data` is `usecase.LoaFormResponse` (`internal/interfaces/usecase/loa.go:30`).
|
`data` is `usecase.LoaFormResponse` (`internal/interfaces/usecase/loa.go:30`).
|
||||||
|
|
||||||
### Error Codes
|
### Error Codes
|
||||||
@@ -546,14 +586,22 @@ Returns a list of loan simulations (tenor / monthly payment / admin fee) for a g
|
|||||||
| `channel_id` | string | [EG] | yes | `NBMB` |
|
| `channel_id` | string | [EG] | yes | `NBMB` |
|
||||||
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Frontend → Erangel</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// Frontend → Erangel
|
|
||||||
{
|
{
|
||||||
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0",
|
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0",
|
||||||
"amount": 5000
|
"amount": 5000
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
// Erangel → Doom (constructed in Doom.php:95)
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Erangel → Doom (constructed in Doom.php:95)</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"client": "BRIMON",
|
"client": "BRIMON",
|
||||||
"request_refnum": "123456789154",
|
"request_refnum": "123456789154",
|
||||||
@@ -566,10 +614,15 @@ Returns a list of loan simulations (tenor / monthly payment / admin fee) for a g
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Struct: `usecase.LoaTermRequest` (`internal/interfaces/usecase/loa.go:104`)
|
Struct: `usecase.LoaTermRequest` (`internal/interfaces/usecase/loa.go:104`)
|
||||||
|
|
||||||
### Response Body (200)
|
### Response Body (200)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Response Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"code": "00",
|
"code": "00",
|
||||||
@@ -594,6 +647,8 @@ Struct: `usecase.LoaTermRequest` (`internal/interfaces/usecase/loa.go:104`)
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
`data` is `usecase.LoaTermResponse` (`internal/interfaces/usecase/loa.go:115`).
|
`data` is `usecase.LoaTermResponse` (`internal/interfaces/usecase/loa.go:115`).
|
||||||
|
|
||||||
### Error Codes
|
### Error Codes
|
||||||
@@ -625,13 +680,21 @@ Sends a one-time password to the user's registered phone number for the loan-on-
|
|||||||
| `channel_id` | string | [EG] | yes | `NBMB` |
|
| `channel_id` | string | [EG] | yes | `NBMB` |
|
||||||
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Frontend → Erangel</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// Frontend → Erangel
|
|
||||||
{
|
{
|
||||||
"otp_type": "WA"
|
"otp_type": "WA"
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
// Erangel → Doom
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Erangel → Doom</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"client": "BRIMON",
|
"client": "BRIMON",
|
||||||
"request_refnum": "123456789154",
|
"request_refnum": "123456789154",
|
||||||
@@ -643,10 +706,15 @@ Sends a one-time password to the user's registered phone number for the loan-on-
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Struct: `usecase.LoaSendOtpRequest` (`internal/interfaces/usecase/loa.go:177`)
|
Struct: `usecase.LoaSendOtpRequest` (`internal/interfaces/usecase/loa.go:177`)
|
||||||
|
|
||||||
### Response Body (200)
|
### Response Body (200)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Response Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"code": "00",
|
"code": "00",
|
||||||
@@ -661,6 +729,8 @@ Struct: `usecase.LoaSendOtpRequest` (`internal/interfaces/usecase/loa.go:177`)
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
If `otp_type=loanInApp` is disabled in cipher config, doom returns `code: "00"` with `data: { "skip": true }` — frontend skips OTP entry and proceeds to `/submit-otp` without an OTP code.
|
If `otp_type=loanInApp` is disabled in cipher config, doom returns `code: "00"` with `data: { "skip": true }` — frontend skips OTP entry and proceeds to `/submit-otp` without an OTP code.
|
||||||
|
|
||||||
### Error Codes
|
### Error Codes
|
||||||
@@ -718,15 +788,23 @@ Validates the OTP the user received via `/send-otp`. On success the frontend pro
|
|||||||
| `channel_id` | string | [EG] | yes | `NBMB` |
|
| `channel_id` | string | [EG] | yes | `NBMB` |
|
||||||
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Frontend → Erangel</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// Frontend → Erangel
|
|
||||||
{
|
{
|
||||||
"server_id": "abc123",
|
"server_id": "abc123",
|
||||||
"otp": "123456",
|
"otp": "123456",
|
||||||
"otp_type": "WA"
|
"otp_type": "WA"
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
// Erangel → Doom
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Erangel → Doom</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"client": "BRIMON",
|
"client": "BRIMON",
|
||||||
"request_refnum": "123456789154",
|
"request_refnum": "123456789154",
|
||||||
@@ -740,10 +818,15 @@ Validates the OTP the user received via `/send-otp`. On success the frontend pro
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Struct: `usecase.LoaSubmitOtpRequest` (`internal/interfaces/usecase/loa.go:TBD`)
|
Struct: `usecase.LoaSubmitOtpRequest` (`internal/interfaces/usecase/loa.go:TBD`)
|
||||||
|
|
||||||
### Response Body (200)
|
### Response Body (200)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Response Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"code": "00",
|
"code": "00",
|
||||||
@@ -754,6 +837,8 @@ Struct: `usecase.LoaSubmitOtpRequest` (`internal/interfaces/usecase/loa.go:TBD`)
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
No data payload on success — frontend simply checks `code == "00"` before proceeding to `/submit`.
|
No data payload on success — frontend simply checks `code == "00"` before proceeding to `/submit`.
|
||||||
|
|
||||||
### Error Codes
|
### Error Codes
|
||||||
@@ -824,8 +909,10 @@ Final step: submits the loan to Brigate, persists to DB, and returns the new app
|
|||||||
| `channel_id` | string | [EG] | yes | `NBMB` |
|
| `channel_id` | string | [EG] | yes | `NBMB` |
|
||||||
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
| `request_id` | string | [DM] | no | overwritten by doom with process ID |
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Frontend → Erangel</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
// Frontend → Erangel
|
|
||||||
{
|
{
|
||||||
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0",
|
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0",
|
||||||
"amount": 5000000,
|
"amount": 5000000,
|
||||||
@@ -838,8 +925,14 @@ Final step: submits the loan to Brigate, persists to DB, and returns the new app
|
|||||||
"admin_fee": 50000,
|
"admin_fee": 50000,
|
||||||
"pin": "123456"
|
"pin": "123456"
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
// Erangel → Doom (pin consumed by erangel, not forwarded)
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Erangel → Doom (pin consumed by erangel, not forwarded)</summary>
|
||||||
|
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"client": "BRIMON",
|
"client": "BRIMON",
|
||||||
"request_refnum": "123456789154",
|
"request_refnum": "123456789154",
|
||||||
@@ -859,10 +952,15 @@ Final step: submits the loan to Brigate, persists to DB, and returns the new app
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
Struct: `usecase.LoaSubmitRequest` (`internal/interfaces/usecase/loa.go:131`)
|
Struct: `usecase.LoaSubmitRequest` (`internal/interfaces/usecase/loa.go:131`)
|
||||||
|
|
||||||
### Response Body (200)
|
### Response Body (200)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Response Body JSON</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"code": "00",
|
"code": "00",
|
||||||
@@ -908,6 +1006,8 @@ Struct: `usecase.LoaSubmitRequest` (`internal/interfaces/usecase/loa.go:131`)
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
`data` is `usecase.LoaSubmitResponse` (`internal/interfaces/usecase/loa.go:151`).
|
`data` is `usecase.LoaSubmitResponse` (`internal/interfaces/usecase/loa.go:151`).
|
||||||
|
|
||||||
### Error Codes
|
### Error Codes
|
||||||
@@ -925,10 +1025,15 @@ Struct: `usecase.LoaSubmitRequest` (`internal/interfaces/usecase/loa.go:131`)
|
|||||||
|
|
||||||
Health check. Defined in `internal/delivery/http/http.go:47`. Returns literal `"ok"`.
|
Health check. Defined in `internal/delivery/http/http.go:47`. Returns literal `"ok"`.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Response body</summary>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
"ok"
|
"ok"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Source Code References
|
## Source Code References
|
||||||
|
|||||||
Reference in New Issue
Block a user