https://github.com/datasektionen/gordian
https://en.wikipedia.org/wiki/Gordian_Knot
https://github.com/datasektionen/gordian
Last synced: 2 months ago
JSON representation
https://en.wikipedia.org/wiki/Gordian_Knot
- Host: GitHub
- URL: https://github.com/datasektionen/gordian
- Owner: datasektionen
- License: other
- Created: 2024-02-22T21:18:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-24T13:41:28.000Z (4 months ago)
- Last Synced: 2025-03-23T21:45:42.279Z (3 months ago)
- Language: Go
- Size: 1.34 MB
- Stars: 2
- Watchers: 7
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Budgetsystemet GOrdian
Fullstack Golang application that handles the budget of Datasektionen.
Live at [budget.datasektionen.se](https://budget.datasektionen.se).
# API
**API documentation** can be found here: **Look down**
## List all Cost Centres
GET
/api/CostCentres
(gets all CCs)
### Parameters
None
### Responses
```JSON
[
{
"CostCentreID":21,
"CostCentreName":"Ada",
"CostCentreType":"committee"
}
]
```## List all Secondary Cost Centres of a Cost Centre
GET
/api/SecondaryCostCentres?id={CCid}
(gets all SCC given CC id)
### Parameters
> | name | type | data type | description |
> | ------ | -------- | ------------ | -------------------------------- |
> | `CCid` | required | int ($int64) | The id of a specific Cost Centre |### Responses
```JSON
[
{
"CostCentreID":1,
"SecondaryCostCentreID":3,
"SecondaryCostCentreName":"Allmänt"
}
]
```## List all Budget Lines of a Secondary Cost Centre
GET
/api/BudgetLines?id={SCCid}
(gets all Budget Lines given SCC id)
### Parameters
> | name | type | data type | description |
> | ------- | -------- | ------------ | ------------------------------------------ |
> | `SCCid` | required | int ($int64) | The id of a specific Secondary Cost Centre |### Responses
```JSON
[
{"SecondaryCostCentreID":3,
"BudgetLineID":33,
"BudgetLineName":"Mat till planeringsmöten",
"BudgetLineAccount":"4029",
"BudgetLineIncome":0,
"BudgetLineExpense":-4400,
"BudgetLineComment":"Ny för i år, 4"
}
]
```# Entities
Each entry in the system consists of the following entities.
There are three elementary entities in the
system, Cost centres, Secondary cost centres and Budget lines.## Cost Centre
A _Cost Centre_ is called _Resultatställe_ in Swedish. It can be typed as a Project (Projekt), Committee (Nämnd) or Other (Övrigt).
They are the main budget divisions.## Secondary cost centre
A _Secondary cost centre_ is part of a Cost centre. It can be an event or otherwise differentiable part of the Cost centre.
Each Secondary cost centre contains the Cost centre it is connected to.## Budget line
A _Budget line_ is the smallest part of a budget, belonging to a Secondary cost centre.
Each Budget line centre contains the Secondary cost centre it is connected to.
A Budget Line also contains the following.### Income and Expense
The prediction of what someone expects to earn or spend.
A Budget Line never has an Income and an Expense at the same time.### Account
_Account_ is used to assist with the bookkeeping
### Comment
A _Comment_ is used to further clarify the use of a Budget line
# Running locally
- Clone repo
- Install docker
- Create dockerimage:```sh
docker compose up --build --watch
```- Run dockerimage
- Ask Kassör for an updated budget spreadsheet or use the sample one found under web > static > budgets
- Go to http://localhost:3000/admin and upload it
- To be able to see resultatrapport, you need to ask dsys for a database dump of cashflow and then write:```sh
docker compose exec -iT cashflow-db pg_restore --no-owner -U cashflow -d cashflow -h localhost < path/to/cashflow_dump.sql
```- ???
- Profit!## Troubleshooting
### Error getting credentials
If you get the following error:
```
error getting credentials - err: exec: "docker-credential-desktop": executable file not found in $PATH, out: ``
```Try renaming "credsStore" to "credStore" in ~/.docker/config.json
https://forums.docker.com/t/docker-credential-desktop-exe-executable-file-not-found-in-path-using-wsl2/100225/5
### Other problems
1. Ask Douglas
2. Ask dsys
3. Pray# Very nice money budget