Skip to content

Commit

Permalink
adding the seed file and the readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
maysam committed Mar 8, 2020
1 parent 07f3834 commit e10dfc6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# README
# Coding Challenge

This README would normally document whatever steps are necessary to get the
application up and running.
### Implementation of simple banking operations

Things you may want to cover:
Rails application `VisableBank` performs basic banking operations like money transfers and showing of current account balance.

* Ruby version
run `rake db:setup & db:migrate & db:seed` to have the databse ready

* System dependencies
you can run `rake` to run the tests

* Configuration
or

* Database creation
run `rails s` for the server to start up

* Database initialization
then calling `/account/111-222-333/overview` would show the json results for the account overview API which shows the balance of the account and its 10 latest transactions.

* How to run the test suite
posting to `transaction/transfer` with parameters `from`, `to`, and `amount` would transfer `amount` cents from `from` account number to `to` account number.

* Services (job queues, cache servers, search engines, etc.)
I did not implement the code in the order specified in the specs. I didn't create user and auth models and this is only according to the requirements.

* Deployment instructions
here is the link to the git repository: https://github.com/maysam/VisableBank

* ...
Thanks
7 changes: 7 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)

checking = Account.create! balance_cents: 60_00, account_number: '111-222-333', account_type: 'Checking', status: 'Active'
saving = Account.create! balance_cents: 40_00, account_number: '111-415-333', account_type: 'Saving', status: 'Active'

checking.transactions.create sent_cents: 40_00, balance_cents: 60_00
saving.transactions.create received_cents: 40_00, balance_cents: 40_00

0 comments on commit e10dfc6

Please sign in to comment.