Giter VIP home page Giter VIP logo

devi's Introduction

Devi

Devi is a double-entry accounting system. It allows projects to leverage a mature ledger and standard statements and reporting.

This is currently intended as a simple proof of concept for a library that could be of value to projects such as retail platforms - however we may eventually mature this in to a package which could be available through hex for your projects.

Why do we need this?

Most retail platforms leave accouning practices as an afterthought. This works fine so long as financial transactions remain simple - but eventually a point is reached where features such as reporting, refunds, or payment splitting cause extremely complex logic.

A common riddle to illustrate.

Three people split a $30 hotel room evently three ways. The hotel asks an employee to deliver a refund of $5. The guests tip the employee $2 and then each receive a dollar. This means that their original payment of $10 each is now $9. $9 * 3 is $27... plus the $2 tip is $29... so where did the other dollar go?

The riddle illustrates the dangers of mixing accounting logic. The $2 value only exists on one side of an equation:

25 + 3 + 2 == (9 + 1) + (9 + 1) + (9 + 1)

... so trying to assess it on the incorrect side causes hard-to-understand bugs. We've seen those kinds of bugs in production on dozens of retail libraries -- with massive amounts of code used to prevent them.

This library looks to remove those kinds of errors using standard accouning practices.

Installation

Lint the project with mix credo --strict

Run tests with mix test

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/devi.

devi's People

Contributors

mcelaney avatar

Watchers

 avatar James Cloos avatar

devi's Issues

Devi.Core.SubledgerTest is flaky

In haste I wrote tests for this which make WAY too many assumptions about the relationship between the test and the test fixture. This functionality gets proved out by the tests on statements - however it would be best if a better test set up was created for this module.

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.