Documentation ¶
Overview ¶
Package positions has been introduced because the domain model has become to large, so we break into smaller and more independent parts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectionID ¶
type CollectionID string
func (CollectionID) Undefined ¶
func (id CollectionID) Undefined() bool
type InfrastructureError ¶
type InfrastructureError struct {
Cause error
}
func (InfrastructureError) Error ¶
func (e InfrastructureError) Error() string
func (InfrastructureError) InvoiceDraft ¶
func (e InfrastructureError) InvoiceDraft() bool
func (InfrastructureError) LoadingError ¶
func (e InfrastructureError) LoadingError() bool
func (InfrastructureError) SavingError ¶
func (e InfrastructureError) SavingError() bool
type Loader ¶
type Loader func(id CollectionID) (Positions, LoadingError)
Loader is an alternative but more functional approach for modelling a kind of repository. The advantage is, that dependency requirements are absolutely exact and testing requires no mocks. It allows easy currying and avoids structs for modelling behavior.
type LoadingError ¶
type NotFoundError ¶
type NotFoundError CollectionID
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
func (NotFoundError) ID ¶
func (e NotFoundError) ID() CollectionID
func (NotFoundError) LoadingError ¶
func (e NotFoundError) LoadingError() bool
func (NotFoundError) String ¶
func (e NotFoundError) String() string
type Positions ¶
type Positions struct {
// contains filtered or unexported fields
}
Positions is the aggregate root, for our positions.
func NewPositions ¶
func NewPositions(id CollectionID, pos []Position) *Positions
type Repository ¶
type Repository interface { Load(id CollectionID) (Positions, LoadingError) Save(positions Positions) SavingError }
Repository models logical transaction states (the aggregate root) for different (typically I/O based) implementations.
type Saver ¶
type Saver func(positions Positions) SavingError
Saver is an alternative but more functional approach for modelling a kind of repository. The advantage is, that dependency requirements are perfectly exact and testing requires no mocks. It allows easy currying and avoids structs for modelling behavior.