Fullstack Golang application that handles the budget of Datasektionen.
Live at budget.datasektionen.se.
API documentation can be found here: Look down
GET
/api/CostCentres
(gets all CCs)
None
[
{
"CostCentreID":21,
"CostCentreName":"Ada",
"CostCentreType":"committee"
}
]
GET
/api/SecondaryCostCentres?id={CCid}
(gets all SCC given CC id)
name type data type description CCid
required int ($int64) The id of a specific Cost Centre
[
{
"CostCentreID":1,
"SecondaryCostCentreID":3,
"SecondaryCostCentreName":"Allmänt"
}
]
GET
/api/BudgetLines?id={SCCid}
(gets all Budget Lines given SCC id)
name type data type description SCCid
required int ($int64) The id of a specific Secondary Cost Centre
[
{"SecondaryCostCentreID":3,
"BudgetLineID":33,
"BudgetLineName":"Mat till planeringsmöten",
"BudgetLineAccount":"4029",
"BudgetLineIncome":0,
"BudgetLineExpense":-4400,
"BudgetLineComment":"Ny för i år, 4"
}
]
- Clone repo
- Install docker
- Install PostgreSQL
- Create database and user in psql according to env.go
- Make user superuser
- Schemify database with .sql file
- Ask dsys for GOrdian token
- Ask dsys for pls access
- Create dockerimage
- Run dockerimage
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.
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.
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.
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.
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 is used to assist with the bookkeeping
A Comment is used to further clarify the use of a Budget line