Ledger Service
Ledger service is a write-only general ledger for tracking all accounting transactions that occur within the platform, so we have complete audit control of the financial aspects of the platform.
Goals
- Write-only general ledger for tracking all accounting transactions that occur within the platform.
- Complete and secure audit control of the financial aspects of the platform
dependencies
- Go version >= 1.13
- GNU Make
- PostgreSQL 9.5+
To install the go build tools, run the setup Makefile target.
This only needs to be done once or after a tool/version upgrade.
make setup
This will install:
- Swagger - A Swagger 2.0 implementation for Go
- Go Imports - A tool that updates your Go import lines, adding missing ones and removing unreferenced ones
- Dep - A Go dependency management tool
- DBMate - A lightweight, framework-agnostic database migration tool.
Database
Please see database doc.
Swagger
Documentation is available at /docs
.
Also see swagger doc.
Testing
Test's are run against a real database instance and is accessed through the DATABASE_URL
environment variable.
e.g. `DATABASE_URL="postgresql://$DATABASE_USERNAME:$DATABASE_PASSWORD@$DATABASE_HOST/ledger_test?sslmode=disable"
Set Up Local Dev Instance
in $GOPATH/src/github.com, git clone this package to /communitybridge/ledger. You must be working from $GOPATH/src/github.com/communitybridge/ledger
cp .env-example to .env and edit with the correct values
- source .env
- make setup_dev
- make up
- make build
- make run
Then go to: http://localhost:8080/v1/health to test the simplest endpoint.
Find more endpoints at http://localhost:8080/v1/docs created by swagger/ledger.yaml
License
Copyright The Linux Foundation and each contributor to CommunityBridge.
This project’s source code is licensed under the MIT License. A copy of the
license is available in LICENSE.
The project includes source code from keycloak, which is licensed under the
Apache License, version 2.0 (Apache-2.0), a copy of which is available in
LICENSE-keycloak.
This project’s documentation is licensed under the Creative Commons Attribution
4.0 International License (CC-BY-4.0). A copy of the license is available in
LICENSE-docs.