Documentation ¶
Index ¶
- func BieterCSVHeader() []string
- type Bieter
- type Event
- type Gebot
- type Model
- func (m Model) BieterCreate() (int, Event)
- func (m Model) BieterDelete(id int) Event
- func (m Model) BieterSetAnwesend(id int, anwesend bool) Event
- func (m Model) BieterSetCanSelfEdit(id int, canEdit bool) Event
- func (m Model) BieterUpdate(bieter Bieter) Event
- func (m Model) ResetGebot() Event
- func (m Model) SetGebot(bietID int, gebot Gebot) Event
- func (m Model) SetState(state ServiceState) Event
- type ServiceState
- type Verteilstelle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BieterCSVHeader ¶
func BieterCSVHeader() []string
BieterCSVHeader returns the header coresponding to Bieter.CSVRecord().
Types ¶
type Bieter ¶
type Bieter struct { ID int `json:"id"` Vorname string `json:"vorname"` Nachname string `json:"nachname"` Mail string `json:"mail"` Adresse string `json:"adresse"` Mitglied bool `json:"mitglied"` Verteilstelle Verteilstelle `json:"verteilstelle"` Teilpartner string `json:"teilpartner"` IBAN string `json:"iban"` Kontoinhaber string `json:"kontoinhaber"` Jaehrlich bool `json:"jaehrlich"` Gebot Gebot `json:"gebot"` Anwesend bool `json:"anwesend"` CanSelfEdit bool `json:"can_edit"` }
Bieter is a person that makes an offer.
func (Bieter) InvalidFields ¶
InvalidFields returns a map from invalid fields to an error message.
func (Bieter) ShowKontoinhaber ¶
ShowKontoinhaber the kontoinhaber
type Gebot ¶
type Gebot int
Gebot is an offer.
func GebotFromString ¶
GebotFromString parses a string into an gebot.
func (Gebot) NumberString ¶
NumberString returns a number for the form field.
type Model ¶
type Model struct { Bieter map[int]Bieter State ServiceState }
Model of the service.
func (Model) BieterCreate ¶
BieterCreate creates a new bieter with empty data.
func (Model) BieterDelete ¶
BieterDelete deletes a bieter.
func (Model) BieterSetAnwesend ¶
BieterSetAnwesend deletes a bieter.
func (Model) BieterSetCanSelfEdit ¶
BieterSetCanSelfEdit sets the attribute CanSelfEdit.
func (Model) BieterUpdate ¶
BieterUpdate updates all fields of a bieter.
func (Model) SetState ¶
func (m Model) SetState(state ServiceState) Event
SetState sets the service state.
type ServiceState ¶
type ServiceState int
ServiceState is the state of the service.
const ( StateInvalid ServiceState = iota StateRegistration StateValidation StateOffer StateFinish )
States of the service.
func StateFromAttr ¶
func StateFromAttr(attr string) ServiceState
StateFromAttr converts a attribute string representation to ServiceState.
func (ServiceState) String ¶
func (s ServiceState) String() string
func (ServiceState) ToAttr ¶
func (s ServiceState) ToAttr() string
ToAttr converts to a attribute for select elements
type Verteilstelle ¶
type Verteilstelle int
Verteilstelle is an enum type
const ( VerteilstelleNone Verteilstelle = iota VerteilstelleVillingen VerteilstelleSchwenningen VerteilstelleUeberauchen )
Different enum values
func VerteilstelleFromAttr ¶
func VerteilstelleFromAttr(attr string) Verteilstelle
VerteilstelleFromAttr converts a attribute string representation to Verteilstelle.
func (Verteilstelle) String ¶
func (v Verteilstelle) String() string
func (Verteilstelle) ToAttr ¶
func (v Verteilstelle) ToAttr() string
ToAttr converts the Verteilstelle to a simple string that can be used in select statements.