Skip to content

oguzhanulusoy/credit-module-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Module Challenge


Multi-language Support

  • This application supports multi-language. Default is English (EN).
  • If Accept-Language exists, while empty, it is default (English)
  • If Accept-Language exists, while EN, it is English
  • If Accept-Language exists, while TR, it is Turkish
  • messages_x.properties can be created to multiply keys in messages.properties (where x is language code such as IT, ES, FR).

User

POST / To create user
Example cURL
 curl --location 'localhost:8080/user/create' --header 'Content-Type: application/json' --header 'Accept-Language: tr' --data-raw '{"username": "user1_tc","password": "password","email": "user1@email.com"}'
POST / To authentication
Example cURL
curl --location 'localhost:8080/user/auth' --header 'Content-Type: application/json' --header 'Accept-Language;' --data '{ "username": "user1_tc", "password": "password" }'
> ```
GET / To list users
Example cURL
curl --location 'localhost:8080/user/list' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg'
GET / To get specific user
Example cURL
curl --location --request GET 'localhost:8080/user/get' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"id": 1 }'
PUT / To set rule
Example cURL
curl --location --request PUT 'localhost:8080/user/set-role' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"id": "2"}'
PUT / To update specific user
Example cURL
curl --location --request PUT 'localhost:8080/user/update' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data-raw '{"id": "1","username": "user1_tc_update","email": "user1@email.com"}'
DELETE / To delete logically
Example cURL
curl --location --request DELETE 'localhost:8080/user/delete-logical' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMl90YyIsImlhdCI6MTczNzgyODg5MCwiZXhwIjoxNzY5MzY0ODkwfQ.jlM-9VaQZjTD9dSZA_aTS_REo4cXjKztkNfS0Y_mLaM' --data '{"id": "1"}'
DELETE / To delete hard
Example cURL
curl --location --request DELETE 'localhost:8080/user/delete-hard' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMl90YyIsImlhdCI6MTczNzgyODg5MCwiZXhwIjoxNzY5MzY0ODkwfQ.jlM-9VaQZjTD9dSZA_aTS_REo4cXjKztkNfS0Y_mLaM' --data '{"id": "2"}'

Customer

POST / To create customer
Example cURL
curl --location 'localhost:8080/customer/create' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"name": "customer1_name","surname": "customer1_surname","userId": "1","creditLimit": "10000","usedCreditLimit": "1500"}'
GET / To list customers
Example cURL
curl --location 'localhost:8080/customer/list' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg'
PUT / To update specific customer
Example cURL
curl --location --request PUT 'localhost:8080/customer/update' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"id": 1,"name": "customer1_name","surname": "customer1_surname","creditLimit": "20000","usedCreditLimit": "1500"}'

Loan

POST / To create loan - Create a new loan for a given customer, amount, interest rate and number of installments
Example cURL
curl --location 'localhost:8080/loan/create' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90YyIsImlhdCI6MTczNzgyODg4NCwiZXhwIjoxNzY5MzY0ODg0fQ.d89CdxEy4b4Ux2XJTPSpiBC1hDAau2MbZK5tpU49crg' --data '{"customerId": 1,"amount": 1000,"interestRate": 0.2,"numberOfInstallment": 6 }'
GET / To list loan of specific customer
Example cURL
curl --location --request GET 'localhost:8080/loan/list' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90Y191cGRhdGUiLCJpYXQiOjE3Mzc4MzE0NzEsImV4cCI6MTc2OTM2NzQ3MX0.e3hgaKhN1JoveEUs-YE-RKtVx9XPUuMRJgCjyGtBZ38' --data '{"customerId": 1 }'
GET / To list loan installment of specific loan
Example cURL
curl --location --request GET 'localhost:8080/loan/list-installments' --header 'Content-Type: application/json' --header 'Accept-Language;' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiQURNSU4iLCJzdWIiOiJ1c2VyMV90Y191cGRhdGUiLCJpYXQiOjE3Mzc4MzE0NzEsImV4cCI6MTc2OTM2NzQ3MX0.e3hgaKhN1JoveEUs-YE-RKtVx9XPUuMRJgCjyGtBZ38' --data '{"loanId": 1 }'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published