Documentation ¶
Index ¶
- type AcknowledgmentOrder
- type ActiveCart
- type Address
- type BillableOrderPlaced
- type BillingAmount
- type CheckProductCodeExists
- type CheckedAddress
- type CheckedAddressExists
- type CreateEvents
- type CreateOrderAcknowledgmentLetter
- type Customer
- type CustomerEmail
- type EmailAddress
- type EmptyCart
- type GetCheckedAddress
- type GetProductPrice
- type HtmlString
- type Item
- type OrderAcknowledgment
- type OrderAcknowledgmentSent
- type OrderPlaced
- type PaidCart
- type PlaceOrder
- type PlaceOrderEvent
- type PlaceOrderEvents
- type PlaceOrderWorkFlow
- type PriceOrder
- type PricedOrder
- type SendOrderAcknowledgment
- type ShoppingCart
- type UnvalidatedAddress
- type UnvalidatedOrder
- type UnverifiedEmail
- type ValidateOrder
- type ValidatedOrder
- type VerifiedEmail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcknowledgmentOrder ¶
type AcknowledgmentOrder = func( input PricedOrder, createOrderAcknowledgmentLetterFn CreateOrderAcknowledgmentLetter, sendOrderAcknowledgmentFn SendOrderAcknowledgment, ) (OrderAcknowledgmentSent, error)
type ActiveCart ¶
type ActiveCart struct {
UnpaidItems []Item
}
func (*ActiveCart) Items ¶
func (a *ActiveCart) Items() []Item
type BillableOrderPlaced ¶
type BillableOrderPlaced struct { OrderID string BillingAddress Address AmountToBill BillingAmount }
請求用
func (BillableOrderPlaced) Event ¶
func (a BillableOrderPlaced) Event()
type BillingAmount ¶
type BillingAmount float64
type CheckProductCodeExists ¶
type CheckedAddress ¶
type CheckedAddress string
type CheckedAddressExists ¶
type CheckedAddressExists = func(v UnvalidatedAddress) (CheckedAddress, error)
type CreateEvents ¶
type CreateEvents = func(input PricedOrder) []PlaceOrderEvent
type CreateOrderAcknowledgmentLetter ¶
type CreateOrderAcknowledgmentLetter = func(input PricedOrder) HtmlString
type Customer ¶
type Customer struct {
Email CustomerEmail
}
func NewCustomer ¶
func NewCustomer(e EmailAddress) Customer
type CustomerEmail ¶
type CustomerEmail interface {
String() EmailAddress
}
func NewUnverifiedEmail ¶
func NewUnverifiedEmail(v EmailAddress) CustomerEmail
func NewVerifiedEmail ¶
func NewVerifiedEmail(v EmailAddress) CustomerEmail
type EmailAddress ¶
type EmailAddress string
func NewEmailAddress ¶
func NewEmailAddress(v string) (EmailAddress, error)
func (EmailAddress) String ¶
func (a EmailAddress) String() string
func (EmailAddress) Validate ¶
func (a EmailAddress) Validate() error
type GetCheckedAddress ¶
type GetCheckedAddress = func(v UnvalidatedAddress) CheckedAddress
type GetProductPrice ¶
type HtmlString ¶
type HtmlString string
type OrderAcknowledgment ¶
type OrderAcknowledgment struct { EmailAddress EmailAddress Letter HtmlString }
type OrderAcknowledgmentSent ¶
type OrderAcknowledgmentSent struct { OrderID string EmailAddress EmailAddress }
func (OrderAcknowledgmentSent) Event ¶
func (a OrderAcknowledgmentSent) Event()
type OrderPlaced ¶
type OrderPlaced PricedOrder
配送用
func (OrderPlaced) Event ¶
func (a OrderPlaced) Event()
type PlaceOrder ¶
type PlaceOrder = func(input UnvalidatedOrder) PlaceOrderEvents
type PlaceOrderEvent ¶
type PlaceOrderEvent interface {
Event()
}
type PlaceOrderEvents ¶
type PlaceOrderEvents struct{}
type PlaceOrderWorkFlow ¶
type PlaceOrderWorkFlow = func(input PlaceOrder) (PlaceOrderEvents, error)
type PriceOrder ¶
type PriceOrder = func(input ValidateOrder, GetProductPriceFn GetProductPrice) (PricedOrder, error)
type PricedOrder ¶
type PricedOrder struct{}
type SendOrderAcknowledgment ¶
type SendOrderAcknowledgment = func(input OrderAcknowledgment) (OrderAcknowledgmentSent, error)
type ShoppingCart ¶
type ShoppingCart interface {
Items() []Item
}
func AddItem ¶
func AddItem(cart ShoppingCart, item Item) ShoppingCart
func MakePayment ¶
func MakePayment(cart ShoppingCart, payment float64) ShoppingCart
type UnvalidatedAddress ¶
type UnvalidatedAddress string
type UnvalidatedOrder ¶
type UnvalidatedOrder struct{}
type UnverifiedEmail ¶
type UnverifiedEmail EmailAddress
func (*UnverifiedEmail) String ¶
func (a *UnverifiedEmail) String() EmailAddress
type ValidateOrder ¶
type ValidateOrder = func(input UnvalidatedOrder, checkProductCodeExistsFn CheckProductCodeExists, checkedAddressExistsFn CheckedAddressExists, ) (ValidatedOrder, error)
type ValidatedOrder ¶
type ValidatedOrder struct{}
type VerifiedEmail ¶
type VerifiedEmail EmailAddress
func (*VerifiedEmail) String ¶
func (a *VerifiedEmail) String() EmailAddress
Click to show internal directories.
Click to hide internal directories.