domain

package
v0.0.0-...-ac85cd4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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 Address

type Address string

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 CheckProductCodeExists = func(productCode string) bool

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 EmptyCart

type EmptyCart struct {
}

func (*EmptyCart) Items

func (a *EmptyCart) Items() []Item

type GetCheckedAddress

type GetCheckedAddress = func(v UnvalidatedAddress) CheckedAddress

type GetProductPrice

type GetProductPrice = func(productCode string) float64

type HtmlString

type HtmlString string

type Item

type Item struct {
	Price float64
}

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 PaidCart

type PaidCart struct {
	PaidItems []Item
	Payment   float64
}

func (*PaidCart) Items

func (a *PaidCart) Items() []Item

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

Jump to

Keyboard shortcuts

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