Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscountApplied ¶
DiscountApplied when a discount was applied
type Order ¶
type Order struct {
aggregate.Root
Status Status
Total uint
Discount uint
Outstanding uint
Paid uint
}
Order is the aggregate protecting the state
func (*Order) AddDiscount ¶
AddDiscount adds discount to the order
func (*Order) Pay ¶
Pay creates a payment on the order. If the outstanding amount is zero the order is paid.
func (*Order) Register ¶
func (o *Order) Register(r aggregate.RegisterFunc)
Register is a eventsouring helper function that must be defined on the aggregate.
func (*Order) RemoveDiscount ¶
func (o *Order) RemoveDiscount()
RemoveDiscount removes the discount if any otherwise ignore
func (*Order) Transition ¶
func (o *Order) Transition(event eventsourcing.Event)
Transition builds the aggregate state based on the events
Click to show internal directories.
Click to hide internal directories.