diff --git a/README.md b/README.md index 99f8958..16cfa50 100644 --- a/README.md +++ b/README.md @@ -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. +
+Request Body JSON + ```json { "client": "BRIMON", // [EG] @@ -110,10 +113,15 @@ The frontend sends **no body fields** to erangel for this endpoint. All common f } ``` +
+ Struct: `usecase.OnboardingRequest` (`internal/interfaces/usecase/loa.go:51`) ### Response Body (200) +
+Response Body JSON + ```json { "code": "00", @@ -299,6 +307,8 @@ Struct: `usecase.OnboardingRequest` (`internal/interfaces/usecase/loa.go:51`) } ``` +
+ `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)"). @@ -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`: +
+Application item schema + ```json { "ticket_no": "...", @@ -346,6 +359,8 @@ Each item in `processing`/`rejected`/`approved.list` is `usecase.Application`: } ``` +
+ **`status` / `status_string` mapping:** | `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. +
+Request Body JSON + ```json { "client": "BRIMON", // [EG] @@ -393,10 +411,15 @@ The frontend sends **no body fields** to erangel for this endpoint. All common f } ``` +
+ Struct: `usecase.LoaListRequest` (`internal/interfaces/usecase/loa.go:186`) ### Response Body (200) +
+Response Body JSON + ```json { "code": "00", @@ -423,6 +446,8 @@ Struct: `usecase.LoaListRequest` (`internal/interfaces/usecase/loa.go:186`) } ``` +
+ `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 @@ -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` | | `request_id` | string | [DM] | no | overwritten by doom with process ID | +
+Frontend → Erangel + ```json -// Frontend → Erangel { "card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0" } +``` -// Erangel → Doom (constructed in Doom.php:81) +
+ +
+Erangel → Doom (constructed in Doom.php:81) + +```json { "client": "BRIMON", "request_refnum": "123456789154", @@ -474,10 +507,15 @@ Loads the loan form: source accounts, T&C text, product type, min/max loan range } ``` +
+ Struct: `usecase.LoaFormRequest` (`internal/interfaces/usecase/loa.go:20`) ### Response Body (200) +
+Response Body JSON + ```json { "code": "00", @@ -509,6 +547,8 @@ Struct: `usecase.LoaFormRequest` (`internal/interfaces/usecase/loa.go:20`) } ``` +
+ `data` is `usecase.LoaFormResponse` (`internal/interfaces/usecase/loa.go:30`). ### 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` | | `request_id` | string | [DM] | no | overwritten by doom with process ID | +
+Frontend → Erangel + ```json -// Frontend → Erangel { "card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0", "amount": 5000 } +``` -// Erangel → Doom (constructed in Doom.php:95) +
+ +
+Erangel → Doom (constructed in Doom.php:95) + +```json { "client": "BRIMON", "request_refnum": "123456789154", @@ -566,10 +614,15 @@ Returns a list of loan simulations (tenor / monthly payment / admin fee) for a g } ``` +
+ Struct: `usecase.LoaTermRequest` (`internal/interfaces/usecase/loa.go:104`) ### Response Body (200) +
+Response Body JSON + ```json { "code": "00", @@ -594,6 +647,8 @@ Struct: `usecase.LoaTermRequest` (`internal/interfaces/usecase/loa.go:104`) } ``` +
+ `data` is `usecase.LoaTermResponse` (`internal/interfaces/usecase/loa.go:115`). ### 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` | | `request_id` | string | [DM] | no | overwritten by doom with process ID | +
+Frontend → Erangel + ```json -// Frontend → Erangel { "otp_type": "WA" } +``` -// Erangel → Doom +
+ +
+Erangel → Doom + +```json { "client": "BRIMON", "request_refnum": "123456789154", @@ -643,10 +706,15 @@ Sends a one-time password to the user's registered phone number for the loan-on- } ``` +
+ Struct: `usecase.LoaSendOtpRequest` (`internal/interfaces/usecase/loa.go:177`) ### Response Body (200) +
+Response Body JSON + ```json { "code": "00", @@ -661,6 +729,8 @@ Struct: `usecase.LoaSendOtpRequest` (`internal/interfaces/usecase/loa.go:177`) } ``` +
+ 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 @@ -718,15 +788,23 @@ Validates the OTP the user received via `/send-otp`. On success the frontend pro | `channel_id` | string | [EG] | yes | `NBMB` | | `request_id` | string | [DM] | no | overwritten by doom with process ID | +
+Frontend → Erangel + ```json -// Frontend → Erangel { "server_id": "abc123", "otp": "123456", "otp_type": "WA" } +``` -// Erangel → Doom +
+ +
+Erangel → Doom + +```json { "client": "BRIMON", "request_refnum": "123456789154", @@ -740,10 +818,15 @@ Validates the OTP the user received via `/send-otp`. On success the frontend pro } ``` +
+ Struct: `usecase.LoaSubmitOtpRequest` (`internal/interfaces/usecase/loa.go:TBD`) ### Response Body (200) +
+Response Body JSON + ```json { "code": "00", @@ -754,6 +837,8 @@ Struct: `usecase.LoaSubmitOtpRequest` (`internal/interfaces/usecase/loa.go:TBD`) } ``` +
+ No data payload on success — frontend simply checks `code == "00"` before proceeding to `/submit`. ### 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` | | `request_id` | string | [DM] | no | overwritten by doom with process ID | +
+Frontend → Erangel + ```json -// Frontend → Erangel { "card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0", "amount": 5000000, @@ -838,8 +925,14 @@ Final step: submits the loan to Brigate, persists to DB, and returns the new app "admin_fee": 50000, "pin": "123456" } +``` -// Erangel → Doom (pin consumed by erangel, not forwarded) +
+ +
+Erangel → Doom (pin consumed by erangel, not forwarded) + +```json { "client": "BRIMON", "request_refnum": "123456789154", @@ -859,10 +952,15 @@ Final step: submits the loan to Brigate, persists to DB, and returns the new app } ``` +
+ Struct: `usecase.LoaSubmitRequest` (`internal/interfaces/usecase/loa.go:131`) ### Response Body (200) +
+Response Body JSON + ```json { "code": "00", @@ -908,6 +1006,8 @@ Struct: `usecase.LoaSubmitRequest` (`internal/interfaces/usecase/loa.go:131`) } ``` +
+ `data` is `usecase.LoaSubmitResponse` (`internal/interfaces/usecase/loa.go:151`). ### 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"`. +
+Response body + ```json "ok" ``` +
+ --- ## Source Code References