GithubHelp home page GithubHelp logo

bank-tech-test-ruby's Introduction

Maintainability

Template

Overview: - description and intent of the project - what its for what I did. - description of what the code does

Setup instructions/guide (how to setup or install)

  • How to run it

  • How to run tests

  • Dependencies information

  • demo of how to use program (gif)

Planning and Approach:

  • User stories
  • The domain model
  • CRC cards
  • Process

Other:

  • Build passing (travis/circle CI)
  • Test coverage (auto generated)
  • Code style and code conventions (linting)
  • code climate

Overview

Solo project to solve a technical challenge with a focus on clean well crafted code. Program allows user to manage finances through a simple command line interface.

Setup

$ git clone [email protected]:fwill22/bank-tech-test-ruby.git
$ cd bank-tech-test-ruby
$ bundle install
$ irb

How to use

In IRB:

> require ‘./lib/account’
> account = Account.new
> account.deposit(250)
> account.withdraw(150)
> account.print_statement

Testing and Linting

Run Tests

rspec

Results: (to be added)

Run Linting

rubocop

Results: 0 offenses - (to be added)

 

Planning and Approach:

User Stories

As a user
So I can be part of a cashless economy
I want to be able to open an empty bank account
As a user
So I can store my money securely
I want to be able to deposit it into my account
As a user
So I can buy things untracked 
I want to be able to withdraw money from my account
As a user
So I can check how much money I have saved
I want to be able to see my current account balance and transaction history on a printed statement.
As a user
So I can keep on top of my money habits
I want my account statement to display the date, transaction amount, type, and updated balance.
As a user
So I can see an up to date history of my transactions
I want to be able to see my account statement listed in reverse chronology by date created

Edge cases:

As a user
So I can stay in the black
I want my account to prevent withdrawal if I have insufficient funds

As a bank manager
So I can ensure the efficient operation of my business
I want to be able to notify customers if they are depositing or withdrawing amounts ≤ £0. 

Acceptance Criteria

Given a client makes a deposit of 1000 on 10-01-2012
And a deposit of 2000 on 13-01-2012
And a withdrawal of 500 on 14-01-2012
When she prints her bank statement she would see:

|    date     ||  credit  ||  debit  || balance  |
 ------------------------------------------------
|  14/01/2012 ||          || 500.00  || 2500.00  |
|  13/01/2012 || 2000.00  ||         || 3000.00  |
|  10/01/2012 || 1000.00  ||         || 1000.00  |

CRC Cards

CRC Cards [Draft]

Account:
Responsibilities:
Knows about:
Starting balance of 0
Current balance
History of transactions
Can add deposited money to CB
Can subtract withdrawn money from CB

Collaborators:
Transaction
Statement

Transaction:
Responsibilities:
Knows about:
Credit amount transaction is for
Debit amount transaction is for
Date created
Format for printing line on statement

Collaborators: Statement

Statement:
Responsibilities:
Knows about:
Transaction history
Current balance

Collaborators: -

CLASS:

Responsibilities: Collaborators:
Knows about:

Dependecies

  • Ruby
  • Rspec
  • Rubocop
  • Simplecov

JavaScript Version

I have also written this test in JS - you can find the repo here.

bank-tech-test-ruby's People

Contributors

fwill22 avatar

Watchers

 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.