Codat
A simple wrapper for the Codat API. Please refer to Codat's documentation to complement any information you need:
- Codat API reference
- Codat API explorer (to use this you need to have access to the UAT portal).
Installation
Add this line to your application's Gemfile:
gem 'codat'
And then execute:
$ bundle
Or install it yourself as:
$ gem install codat
Usage
Bank bankAccounts
To get a list of bank accounts:
BankAccount.all(company_id: 'a49b891d-a593-43aa-bb82-0d8b108eb3ac')
# => []
Financial reports
To get a financial report - profit & loss:
ProfitAndLoss.find(
company_id: 'a49b891d-a593-43aa-bb82-0d8b108eb3ac',
period_length: 12,
periods_to_compare: 2
)
# => []
To get a financial report - balance sheet:
BalanceSheet.find(
company_id: 'a49b891d-a593-43aa-bb82-0d8b108eb3ac',
period_length: 12,
periods_to_compare: 2
)
Companies
To get a list of companies (paginated):
Company.all(page: 1)
# => []
To create a company:
Company.create(name: 'company name')
# => {}
Report
To get a list of reports for aged debtor:
list = Report.all(company_id: 'a49b891d-a593-43aa-bb82-0d8b108eb3ac')
# => []
BankStatement
To get a list of bank statements:
list = BankStatement.all(company_id: 'a49b891d-a593-43aa-bb82-0d8b108eb3ac')
# => []
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run
the tests. You can also run bin/console
for an interactive prompt that will allow you to
experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new
version, update the version number in version.rb
, and then run bundle exec rake release
, which
will create a git tag for the version, push git commits and tags, and push the .gem
file to
rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://gitlab.com/finpoint/codat.
License
The gem is available as open source under the terms of the MIT License.