From e1dcf9b7406891c112111d2fc243b2bce1d4bc46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Schr=C3=B6pfer?= Date: Sun, 13 Dec 2020 08:26:15 +0100 Subject: [PATCH] initial commit --- balance/balance.go | 57 ++++++++++++++++++++++++++++++++++++++++++ go.mod | 3 +++ valuation/valuation.go | 31 +++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 balance/balance.go create mode 100644 go.mod create mode 100644 valuation/valuation.go diff --git a/balance/balance.go b/balance/balance.go new file mode 100644 index 0000000..dc3c0e6 --- /dev/null +++ b/balance/balance.go @@ -0,0 +1,57 @@ +package bil + +// Folgende Strukturen sind für eine Abbildung der Bilanz in +// Textform. Hierüber könnte das Arbeitsbuch erzeugt werden + +// Offene Punkte +// Alle Strukturen mit ID beinhalten auch die Version. Die Abstraktion +// des Models könnte hier aber auch anders gewählt werden. +// Beispielsweise über UUIDs. + +// Matrix defines the structure of the Gemeinwohl-Matrix +type Matrix struct { + Version string // Semantic Version of the matrix 5.0.0 + Target string // Unternehmen oder Gemeinde + Groups []string // Berührungsgruppen + Values []string // Wert + Subjects [][]string // Themen +} + +// Subject is a Gemeinwohl-Thema of the matrix +type Subject struct { + Version string // Semantic Version of the matrix 5.0.0 + Target string // Unternehmen oder Gemeinde + ID string // A1 + Title string // Menschenwürde in der Zulieferkette + Description string // Anfangsbeschreibung + GoodCompany []string // Ein GWÖ-Unternehmen - Liste + WarmUpQuestions []string // Einstiegsfragen - Liste + Aspects []Aspect // Auflistung der einzelnen Aspekte + NegativeAspects []NegativeAspect // Negativaspekte +} + +// Aspect defines the questions to the valuation +type Aspect struct { + Version string // Semantic Version of the matrix 5.0.0 + Target string // Unternehmen oder Gemeinde + ID string // A1.1 + Title string // Arbeitsbed. u gesellschaftl. Ausw. ... + Description string // Anfangsbeschreibung + Questions []string // Berichtsfragen + MustHaves []string // verpflichtende Indikatoren + EvaluationSteps []EvaluationStep // Bewertungsstufen + EvaluationHelp string // Bewertungshilfen/Interpretation +} + +// NegativeAspect defines negative points to the balance +type NegativeAspect struct { + Aspect +} + +// EvaluationStep defines how to valuate the company +type EvaluationStep struct { + Title string // Basislinie + Description string // Beschreibung + MinVal int // minimale Punkte 3 + MaxVal int // maximale Punkte 5 -> 3 bis 5 Punkte +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..904f3d5 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.ecogood.org/andreas.schroepfer/gobalance + +go 1.15 diff --git a/valuation/valuation.go b/valuation/valuation.go new file mode 100644 index 0000000..43e2c9b --- /dev/null +++ b/valuation/valuation.go @@ -0,0 +1,31 @@ +package valuation + +type Matrix struct { + Version string // Semantic Version of the matrix 5.0.0 + Target string // Unternehmen oder Gemeinde + Subjects [][]Subject +} + +type Subject struct { + Version string // Semantic Version of the matrix 5.0.0 + Target string // Unternehmen oder Gemeinde + ID string // A1 + Weight Weight // 1.5 + Aspects []Aspect // Auflistung der einzelnen Aspekte + NegativeAspects []Aspect // Negativaspekte +} + +type Aspect struct { + Version string // Semantic Version of the matrix 5.0.0 + Target string // Unternehmen oder Gemeinde + ID string // A1.1 + Weight Weight // 1.5 + Explanation string // ausführliche Begründung + EvaluationStepTitle string // Basislinie + Value int // Punkte +} + +// Weight is used +type Weight struct { + w float32 // kann bei float-Problemen umgestellt werden +}