first calculation logic

This commit is contained in:
Andreas Schröpfer
2020-12-23 21:27:12 +01:00
parent 6995f73627
commit d646a0d610
6 changed files with 160 additions and 53 deletions

17
stakeholder.go Normal file
View File

@@ -0,0 +1,17 @@
package goodcalc
// Stakeholder can define a weight, which is calculated to
// all containing themes.
// No is the id like in the excel
// For example A for Suppliers
type Stakeholder struct {
No string `json:"no"`
Weight float32 `json:"weight"`
Themes []*Theme `json:"themes"`
}
func (s *Stakeholder) calcWeight() {
for _, t := range s.Themes {
t.Calc.CalcWeight = s.Weight * t.Weight
}
}