ding

package
v0.0.0-...-f34e32e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name         = "name"
	Gruppe       = "gruppe"
	Anzahl       = "anzahl"
	Code         = "code"
	Beschreibung = "beschreibung"
	Aktualisiert = "aktualisiert"
)

Variables

View Source
var CreateScript string
View Source
var ErrConstraintViolation = errors.New("constraint violation")
View Source
var ErrDataAccess = errors.New("data access error")

ErrDataAccess beschreibt einen Fehler während des Zugriffs auf die Daten des Repositories.

Es handelt sich dabei um einen nicht näher bezeichneten technischen Fehler. Üblicherweise verursachen context.Canceled oder sql.ErrConnDone, sql.ErrNoRows oder sql.ErrTxDone diesen Fehler.

View Source
var ErrInsertEvent = errors.New("event cannot be logged")

ErrInsertEvent beschreibt einen Fehler, der beim Protokollieren eines Eregnisses auftritt.

View Source
var ErrInvalidParameter = errors.New("invalid paramater")
View Source
var ErrItemsCanNotBeRemoved = errors.New("no items can be removed during an inventory")
View Source
var ErrItemsCanNotBeStored = errors.New("no items can be stored during an inventory")
View Source
var (
	ErrMissingProductCode = errors.New("product code is required")
)
View Source
var ErrNoRecord = errors.New("no record found")
View Source
var FixtureScript string

Functions

func DingEinlagern

func DingEinlagern(kommando LagereDingEin, zustand DingeEinlagernZustand) ([]any, error)

Command Handler h: e = h(c, z) Command Handler erzeugt events (zustandsänderung) aus einem Command und dem aktuellen Zustand.

func DingEntnehmen

func DingEntnehmen(kommando EntnehmeDing, zustand DingEntnehmenZustand) ([]any, error)

func EigenschaftenÄndern

func EigenschaftenÄndern(kommando ÄndereEigenschaften, zustand EigenschaftenÄndernZustand) ([]any, error)

Types

type AktualisierenHandler

type AktualisierenHandler struct {
	// contains filtered or unexported fields
}

Bearbeitet ein Ding

func (AktualisierenHandler) ProcessRequest

func (h AktualisierenHandler) ProcessRequest(fragment string, r *http.Request) webx.HandlerResult

type Aktualisierungsanfrage

type Aktualisierungsanfrage struct {
	Id           int64
	Name         string
	Beschreibung string
	Allgemein    string
}

type BearbeitenHandler

type BearbeitenHandler struct {
	// contains filtered or unexported fields
}

Edit zeigt eine Form zum Bearbeiten eines spezifischen Dings

func (BearbeitenHandler) ServeData

func (h BearbeitenHandler) ServeData(fragment string, r *http.Request) webx.HandlerResult

type BekanntesDingEingelagert

type BekanntesDingEingelagert struct {
	Code      string
	Anzahl    int
	Zeitpunkt time.Time
}

type CommandBus

type CommandBus struct {
	EventBus esx.MessageBus
}

func (CommandBus) KommandoVerarbeiten

func (cb CommandBus) KommandoVerarbeiten(ctx context.Context, fragment string, events []any, err error) webx.HandlerResult

type DestroyFormHandler

type DestroyFormHandler struct {
	// contains filtered or unexported fields
}

Zeigt eine Form an, um Dinge zu entnehmen.

func (DestroyFormHandler) ServeData

func (receiver DestroyFormHandler) ServeData(fragment string, r *http.Request) webx.HandlerResult

type DestroyFormHeader

type DestroyFormHeader struct {
}

func (DestroyFormHeader) ServeData

func (h DestroyFormHeader) ServeData(fragment string, r *http.Request) webx.HandlerResult

type Ding

type Ding struct {
	DingRef
	Beschreibung string
	Allgemein    string
	Aktualisiert time.Time
}

type DingEntnehmenZustand

type DingEntnehmenZustand struct {
	Bestand          int
	InventurBegonnen bool
}

type DingEntnommen

type DingEntnommen struct {
	Produktcode string
	Anzahl      int
	Zeitpunkt   time.Time
}

type DingRef

type DingRef struct {
	Id       int64
	Name     string
	Code     string
	Anzahl   int
	PhotoUrl string
}

DingRef repräsentiert ein Ding in der Übersicht.

func (DingRef) Equal

func (d DingRef) Equal(other DingRef) bool

type DingeEinlagernZustand

type DingeEinlagernZustand struct {
	Benannt          bool
	InventurBegonnen bool
}

Zustand: Ergebnis einer Projektion von Ereignissen.

type EigenschaftenGeändert

type EigenschaftenGeändert struct {
	Produktcode  string
	Name         string
	Gruppe       string
	Beschreibung string
}

type EigenschaftenÄndernZustand

type EigenschaftenÄndernZustand struct {
	Name         string
	Gruppe       string
	Beschreibung string
}

type EntnehmeDing

type EntnehmeDing struct {
	Produktcode string
	Anzahl      int
	Zeitpunkt   time.Time
}

type Ereignis

type Ereignis struct {
	Operation   int
	Anzahl      int
	Created     time.Time
	Produktcode string
}

func GetAllEvents

func GetAllEvents(eventstore esx.EventBus, limit int) ([]Ereignis, error)

func ProductHistory

func ProductHistory(eventstore esx.EventBus, produktcode string, limit int) ([]Ereignis, error)

func (Ereignis) String

func (e Ereignis) String() string

type EreignisModel

type EreignisModel struct {
	Url       string
	Code      string
	Name      string
	Operation string
	Created   time.Time
}

type FehlbestandErkannt

type FehlbestandErkannt struct {
	Produktcode string
	Bestand     int
	Zeitpunkt   time.Time
}

type InsertResult

type InsertResult struct {
	Created bool
	Id      int64
}

type LagereDingEin

type LagereDingEin struct {
	Code      string
	Anzahl    int
	Zeitpunkt time.Time
}

Command: c

type Module

type Module struct {
	EventBus   esx.EventBus
	Repository *Repository
	Templates  fs.FS
}

func (*Module) InitDatabase

func (m *Module) InitDatabase(ctx context.Context) error

func (*Module) Mount

func (m *Module) Mount(mux *http.ServeMux, prefix string, middleware ...webx.Middleware)

type NewFormHandler

type NewFormHandler struct {
	// contains filtered or unexported fields
}

Liefert eine HTML Form zum Einlagern eines neuen Dings.

func (NewFormHandler) ServeData

func (h NewFormHandler) ServeData(fragment string, r *http.Request) webx.HandlerResult

type NewFormHeader

type NewFormHeader struct{}

func (NewFormHeader) ServeData

func (h NewFormHeader) ServeData(fragment string, r *http.Request) webx.HandlerResult

type PostCreateHandler

type PostCreateHandler struct {
	// contains filtered or unexported fields
}

Lagert Dinge ein.

Ziel der Form von NewForm.

Wenn ein Fehler auftritt, wird die Form von [NewForm] mit den übertragenen Werte erneut angezeigt. Zusätzlich werden die Validierungsfehler ausgegeben.

Wenn die Erzeugung eine neuen Dings erfolgreich war, wird nach /new weitergeleitet, wenn das Ding bekannt ist, so dass der Workflow fortgesetzt werden kann und weitere Dinge hinzugefügt werden können. Wenn es sich um ein neues Ding handelt, wird nach /:id/edit weitergeleitet, um weitere Daten über das Ding anzufordern.

func (PostCreateHandler) ProcessRequest

func (h PostCreateHandler) ProcessRequest(fragment string, r *http.Request) webx.HandlerResult

type PostDestroyHandler

type PostDestroyHandler struct {
	// contains filtered or unexported fields
}

func (PostDestroyHandler) ProcessRequest

func (h PostDestroyHandler) ProcessRequest(fragment string, r *http.Request) webx.HandlerResult

type Repository

type Repository struct {
	Clock system.Clock
	Tm    sqlx.TransactionManager
}

func (Repository) GetByCode

func (r Repository) GetByCode(ctx context.Context, code string) (Ding, error)

func (Repository) GetById

func (r Repository) GetById(ctx context.Context, id int64) (Ding, error)

func (Repository) Subscribe

func (r Repository) Subscribe(eventbus esx.MessageBus)

func (Repository) WennEigenschaftenGeändert

func (r Repository) WennEigenschaftenGeändert(ctx context.Context, ereignis EigenschaftenGeändert) error

type ScannerFormData

type ScannerFormData struct {
	// Title     string
	ActionUrl string

	Code    string
	Anzahl  int
	History []EreignisModel
}

type ShowDingHandler

type ShowDingHandler struct {
	// contains filtered or unexported fields
}

Zeigt ein spezifisches Ding an

func (ShowDingHandler) ServeData

func (h ShowDingHandler) ServeData(fragment string, r *http.Request) webx.HandlerResult

type ShowResponseData

type ShowResponseData struct {
	Ding
	History []Ereignis
}

type UnbekanntesDingEingelagert

type UnbekanntesDingEingelagert struct {
	Code      string
	Anzahl    int
	Zeitpunkt time.Time
}

type ÄndereEigenschaften

type ÄndereEigenschaften struct {
	Produktcode  string
	Name         string
	Gruppe       string
	Beschreibung string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL