Giter VIP home page Giter VIP logo

supplierplusapp's Introduction

Test App

Feature: Invoice upload

As a customer, I would like to upload files and get them converted into Invoices with precalculation.

  1. A customer prepares a CSV file with invoices: the first column is internal invoice id, the second is invoice amount and third is the due on date
1,100,2019-05-20
2,200.5,2019-05-10
B,300,2019-05-01

The test file includes five thousand rows and includes invalid rows.

  1. Customer can upload invoice CSV to the system
  2. System processes file so that every invoice gets the selling price according to the next logic:

Invoice sell price depends on amount and days to the due date. The formula is amount - amount * discount. The discount is 0.5% when the invoice uploaded more than 30 days before the due date and 0.3% when less or equal to 30 days.

  1. Customer can check invoices uploaded to the system and check their selling price.
  2. Customer can see an upload report and understand errors related to CSV file row processing.


* Functional
  Basic description

For login Admin pre-setup user [email protected] / qwerty123 (after run rake db:seed)

User can see only own Invoices.
Admin have access to all invoices
Object Attachment for upload CSV invoices from User
At Model Invoice has process precalculate sell_price according amount and due_date

* Integrate coverage checks (Simplecov). Check Percent at folder [coverage] open index.html

* Prepare to run App 
In file .env can check and edit this ENV variables

* Prepare DB

Create, migrate, seed DB

rake db:create db:mirate db:seed


Create Service to generate random invoice 
(can set number of ROWS), use rake for generate incorrect invoices

Correct invoice

rake generate_csv_invoices:correct[5000]

Incorrect invoice

rake generate_csv_invoices:incorrect[5000]


Files can find on path [public/invoices/files/correct_rows_count.csv]


* Run application 

bin/dev

* use Rspec test

run test

rspec



supplierplusapp's People

Contributors

golfer 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.