Giter Club home page Giter Club logo

tallerjpa's Introduction

TallerJPA

alt text

Description

Your task as a developer of the account system of ICESI University is to create a service that will handle the creation of users and accounts.

You have a simple model as a base, a user with basic information, the account entity with details about the number and balance also a type which can be a normal account or a deposit only account.

Model

  • A user can have multiple accounts, and an account belongs to only one user.
  • A user can have only one role but multiple users can have the same role.

Requirements

Users

  • Users should have unique email and phoneNumber, if an user with an existing phone or email is tried to be created it should throw an error with the message description indicating which one of the fields is repeated. if both are in use the message should said that both are in use.
  • The user role can't be null.
  • User Id is generated by the service

Roles

  • Role name should be unique
  • Role Id is generated by the service

Account

  • Accounts marked as deposit only can't transfer or be transferred money, only withdrawal and deposit.
  • Accounts balance can't be below 0.
  • Accounts number should be unique.
  • Accounts number should have the format xxx-xxxxxx-xx where x are numbers [0-9].
  • Account number is generated by the service.
  • Account Id is generated by the service.
  • Account can only be disabled if the balance is 0.

Requirements

Besides creation of the user, role and account you'll implement the following functions.

  • A function in AccountService to enable/disable the account.
  • A function in AccountService to withdrawal money.
  • A function in AccountService to deposit money.
  • A function in AccountService to transfer money to another account.

For testing keep in mind edge cases they can be considered to increase the note. The basic ones are expected to be tested.

Score

Note that we don't need the controllers right now.

  • Is expected that the project runs with the postgres connection if this requirement is not met a penalization of 1.0 will be applied.
  • Is expected that the project runs without issues. if this requirement is not met a penalization of 1.0 will be applied.
  • Names of variables are IMPORTANT for each name that doesn't makes sense a penalization of 0.1 will be applied.

alt text

PART 2

Requirements

  • Add the necesary controllers.
  • Add security to te application.
  • A normal user can only update the state of it's own accounts
  • An admin user should be able to create roles, users and assing roles.
  • A bank user should be able to create users. but no admin users
  • A user can create and update accounts for himself.

The aplication should handle it's custom exceptions and show a JSON response when an error appears:

  • Add a custom exception.
  • Add a controller advice.
  • Handle the custom exception.
  • Return the expected exception.
  • Login exceptions should be handled too.

The application should handle the input validations by using the @Valid @Validated anotations:

  • Use custom anotation if needed.
  • The exception for the validations should be handled by the controller advice.

Testing

  • Add a integration test for transfering money.
  • Add a integration test for user creation.

The integration test should include the happy path and possible errors throw by the application

PART 3

Interface implementation:

  • Implement the loggin interface using react and axios.
  • Implement a home page showing the current user accounts. Number + Balance
  • Implement a logout feature.

Calification:

  • The interface works as expected
  • Uses Boostrap to add css styles to the home page
  • The logout function redirects the user to the login page and deletes the token from the local store.

tallerjpa's People

Contributors

juseprada96 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.