Giter Club home page Giter Club logo

balanceapp's Introduction

Запуск контейнеров: docker-compose up -d

ВАЖНО Обновление миграций на бд:

$ docker-compose exec web python manage.py migrate
$ docker-compose exec web architect partition --module balanceapp.transactions.models

Запуск тестов на запущенном контейнере: docker-compose exec web pytest -v

Запросы API:

Создание счета:

$ curl localhost:8000/api/0.1/accounts -H "Content-Type: application/json" -X POST -d "{\"title\": \"my account\"}"
{ "data": [{"model": "transactions.account", "pk": 103, "fields": {"title": "my account", "balance": 0}}]}

Получение счета:

$ curl localhost:8000/api/0.1/accounts/103 
{ "data": [{"model": "transactions.account", "pk": 103, "fields": {"title": "my account", "balance": 0}}]}

Получение баланса счета:

$ curl localhost:8000/api/0.1/accounts/10/balance\?from_date=2017-01-25\&to_date=2017-01-26
{"data": [["2017-01-25", -181019], ["2017-01-26", -190008]]}

Создание транзакции:

$ curl localhost:8000/api/0.1/transactions -H "Content-Type: application/json" -X POST -d "{\"description\": \"my transaction\", \"amount\": 100, \"account\": 10, \"date\": \"2016-11-01\"}"
{ "data": [{"model": "transactions.transaction", "pk": 510001, "fields": {"description": "my transaction", "amount": 100, "date": "2016-11-01", "account": 10}}]}%

Получение транзакции:

$ curl localhost:8000/api/0.1/transactions/50001
{ "data": [{"model": "transactions.transaction", "pk": 50001, "fields": {"description": "Watson Inc", "amount": -2119, "date": "2017-01-28", "account": 11}}]}

balanceapp's People

Contributors

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