amartha_coding_test

command module
v0.0.0-...-2ccb8c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 8 Imported by: 0

README

Amartha Coding Test - Example 1: Billing Engine (System Design and abstraction)

How To run

go mod tidy
go mod vendor
  1. Run docker-compose
docker compose up --build -d  

  1. Stop and remove docker-compose volume
docker compose down --volumes

Endpoint API

Create Customer POST /customer

curl --location 'http://localhost:8080/customer' \
--form 'fullname="fadli"' \
--form 'ktp_no="123456789"' \
--form 'address="jakarta"'

Screen Shot 2024-07-02 at 09 03 26

Create Loan POST /loans

curl --location 'http://localhost:8080/loans' \
--form 'cif_id="3"' \
--form 'total_amount="500000"' \
--form 'interest_rate="10"' \
--form 'total_weeks="50"'

Screen Shot 2024-07-01 at 16 15 57

Get Loan GET /loans

curl --location --request GET 'http://localhost:8080/loans?loan_id=4' 

Screen Shot 2024-07-01 at 16 16 26

Update Loan delinquent PUT /loans

curl --location --request PUT 'http://localhost:8080/loans' \
--form 'loan_id="4"' \
--form 'delinquent="2"'

Create Payment POST /payment


curl --location 'http://localhost:8080/payment' \
--form 'loan_id="4"' \
--form 'amount="11000"

Screen Shot 2024-07-01 at 16 16 40

Import Postman Collection

Amartha_postman_collection.json

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL