Giter Site home page Giter Site logo

javainvoicemapper's Introduction

Invoice Mapper

This is an educational "Legacy" Java app, based on a real world business scenario. It has purposefully been created in a messy state in order to provide students an opportunity to refactor and fix bugs in an existing "Legacy" codebase.

About the Invoice Mapper

The first purpose of this application is to map invoice in a variety of formats into a standardized sales database. The second purpose of this application is to calculate commissions to be paid per sale to salespersons who are also stored in the database. The end goal is to have an automatic process, for multiple formats, for multiple clients, for multiple agents with different commission rates per client.

Business Entities

  • Client: A client is a business that we have salespersons (agents) selling products on behalf of.

  • Invoice: An invoice is an excel spreadsheet (csv format) of data sent to us each week that has all the raw data bout the sales our agents made this week. Along with each invoice, we also get the amount of money we've been paid by a client for the sales our agents have made.

  • Agent:: An agent is a person who sells products on behalf of a client. Agents are paid commissions per successful sale. Commission rates vary by client.

  • Sale:: A sale is a record of a product that was sold to a customer. Sales have several statues:

    • Payable: The sale is a good sale, the agent will make a commission on it
    • Non payable: The sale fell through, the agent will make no commission on it
    • Chargeback: The sale was payable at one time, but resulted in a return of some kind, the agent owes us their original commission back.
  • FormatMap: A format map tells us what columns from the invoice spreadsheet we will import into which fields of a sale. The format map also tells us What commission rate (e.g. 0.05 - 5%) we will pay on each sale that is brought in.

Key concepts:

  • Invoice Revenue: As stated above, each invoice comes with a certain amount of money that we have been paid by the client for thes sales made. Our total revenue for that invoice is that amount - the commissions paid to agents for the sales on the invoice.

  • Commission Rates: Commission rates are set per client in the format map. Commission rates are stored as decimals, e.g. 0.05 = 5% commission. See below for some commission scenarios:

    • if a $50 sale is payable at 5% commission rate, commission = $2.50
    • if a $50 sale is non payable at 5% commission rate, commission = $0
    • if a $50 sale is charged back at 5% commission rate, commission = -$2.50

Project Structure

  • Root: primarily business logic classes
    • dal: Data access layer classes
    • lib: Core business entities
    • ui: Swing interfaces

Connecting to database

Before you can run the project, you have to connect to add a config file to be able to connect to the db:

  • Create a "app.properties" file in InvoiceMapper/src/main/resources
  • File should have the following format (you will receive the values of these items in class):
db.host=xxx
db.name=xxx
db.user=xxx
db.password=xxx

javainvoicemapper's People

Contributors

johnkuefler avatar dakotacromwell avatar

Stargazers

 avatar

Watchers

 avatar

javainvoicemapper's Issues

Add exception logger to method in Client.Java

The setName in Client.Java needs an exception logger added to it for when the user enters invalid inputs. The logger should keep record of when the error occurred, and what was entered to cause the error.

Create a global logger

We should have a global logger that can log to either the console or a text file. Implement this logger where it makes sense.

Create sales csv report generator

Add the ability to export all sales from the system into a CSV (comma separated values) file when a button is clicked. There is a button on the main page of the app that does nothing that could be used for this.

Add more choices to Utilities.ParseBool

Right now the Utilities.ParseBool function turns "Yes" or "yes" into true, and everything else into false. It should be updated to be more specific, error proof, and take more options.

It should have a spsecific else check for "No","no", and then throw an exception if the value is something we don't understand as convertable to a bool.

Also, we should check fore more "bool" values like "true", "false", "1", "0", etc.

Redesign main ui

main ui is a mess - needs redesign to look cleaner. All pages should be the same size as well.

Better excel date parsing

If the invoice date comes in as an excel date format instead of text, e.g. "12321" or something like that, invoice will not import. It would be nice to be able to import these dates.

Add formatter to mappings

Work with instructor to add a "formatter" column to mappings table, and then implement it on the invoice mappings screen

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.