Skip to content

jdegand/origin-spring-boot-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Origin Financial Backend Assessment

This is a Spring Boot Conversion of my past repo solution to origin financial's backend take home assignment.

The backend works with this frontend.

Screenshots

Built With

  • Java 17
  • Spring Boot 3.1
  • VS Code

How to Use

The Express application runs by default on http://localhost:4000 and has the following endpoints:

  • http://localhost:4000/api/score - post endpoint that expects the form object below

Expected Payload JSON

{
  "personal": {
    "age": 35,
    "income": 0,
    "marital_status": "married"
  },
  "house": {
    "ownership_status": "owned",
    "dependents": 2
  },
  "vehicle": {
    "year": 2018
  },
  "questions": {
    "question1": "false",
    "question2": "true",
    "question3": "false"
  }
}

Running the Spring Boot Application

git clone https://github.com/jdegand/origin-spring-boot-backend.git

# need java jdk installed 

# cd into directory & run directly with maven or open in ide - click run button

Running the Angular Application

Run the backend application first.

git clone https://github.com/jdegand/origin-angular-frontend.git

# cd into the directory
npm install 

npm start

Thoughts

  • Have to add @Valid in ApplicantData because properties are nested
  • The only standard annotations which can be applied to enum's are @NotNull and @Null.
  • Adding custom validation for question to ensure question answers are only 'true' or 'false' requires an implementation similar to this
  • Don't think using an entity makes sense since data is not saved to a database
  • Using DTO vs entity - not much practical difference - although I think it was a bigger issue in the past
  • Didn't add setters to DTOs - necessary for more complicated testing logic ?
  • I gitignored the maven-wrapper.jar - debatable if it should be ignored or not - The mvnw / mvnw.cmd scripts will download a maven wrapper if it is missing

Improvements

  • Code Coverage plugin
  • More tests
  • Custom Validator for questions
  • Error route

Useful Resources

About

Origin Financial Take Home Assignment Solution

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages