Skip to content

n11-TalentHub-Java-Bootcamp/n11-talenthub-bootcamp-graduation-project-fatihari

Repository files navigation

n11 talenthub bootcamp graduation project - fatihari

Homework done in Java using Spring Boot and using PostgreSQL.

According to the layered architecture in the project, interfaces (abstract classes) and implemented classes (concrete classes) are used on both Service side.

Sample script file containing the data inserted into the PostgreSQL database have been added under the "resource" folder.

PostgreSQL connection information has been added as "application.properties" file under the name of "resource" folder.

The SMS API used was created by logging in from Twilio.

Below is the required dependency for Maven.

<dependency>
  <groupId>com.twilio.sdk</groupId>
  <artifactId>twilio</artifactId>
  <version>8.25.1</version>
</dependency>

Twilio generates a local but different number each time on the trial account in regions other than the USA and Canada. In trial mode, a message is sent to only one number.

image

The account information in the image above is kept in the file named "application.yml" under the resources folder.


IMPORTANT NOTE1: When the program is run, the user is created first. Then, a credit application is made with only the "user_account_id" of the registered user in the system.

IMPORTANT NOTE2: For security reasons, user numbers and ID numbers will be shared as fake numbers in the script file. But to send sms to the phone, a real number must be entered! In the screenshot, these parts are censored.

IMPORTANT NOTE3: The credit score, which is thought to have been written before, is calculated as follows in CreditScoreService:
    // if age of user is equal to 20, so Credit Score is 20 x 25 = 500.
    @Override
    public int findCreditScore(Long userId)
    {
        return (Calendar.getInstance().get(Calendar.YEAR) - 
            Integer.parseInt(findByUserId(userId).getDateOfBirth().toString().substring(0,4))) * 25;
    }

In short, the Credit Score is calculated to be 25 times the age.

1-Entities

1.1 user_account entity

image

1.2 credit_application entity

image

2-UserRestController

2.1 save user

image image

2.2 update user

image image

2.3 delete user

image image

Credit applications will now be made for existing users registered in the system.

3-CreditRestController

3.1 save credit application

  • If the credit score is below 500, the user will be rejected. (Credit result: Rejection)

image


credit_application table

image


reference user_account table

image


image

  • If the credit score is between 500 points and 1000 points and the monthly income is below 5000 TL, the loan application of the user is approved and a limit of 10.000 TL is assigned to the user. (Credit Result: Approval)

image


credit_application table

image


reference user_account table

image


image

  • If the credit score is between 500 points and 1000 points and the monthly income is between 5000 TL and 10,000 TL, the credit application of the user is approved and a 20,000 TL limit is assigned to the user. (Credit Result: Approval)

image


credit_application table

image


reference user_account table

image


image

  • If the credit score is between 500 points and 1000 points and the monthly income is over 10,000 TL, the user's credit application is approved and the user is assigned a limit of MONTHLY INCOME INFORMATION * CREDIT LIMIT MULTIPLIER / 2. (Credit Result: Approval)

    CREDIT LIMIT MULTIPLIER = 4

image


credit_application table

image


reference user_account table

image


image

  • If the credit score is equal to or above 1000 points, the user is assigned a limit equal to MONTHLY INCOME * CREDIT LIMIT MULTIPLIER. (Credit Result: Approval)

    CREDIT LIMIT MULTIPLIER = 4

image


credit_application table

image


reference user_account table

image


image

3.2 Find credit application with identification number and date of birth

  • If an incorrect identification number or date of birth is entered, image

  • If the correct identification number and date of birth is entered, image

  • One another user's query (me) image

About

n11-talenthub-bootcamp-graduation-project-fatihari created by GitHub Classroom

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages