예제 #1
0
// NewOrder instantiates a new Order for a specific Customer.
func NewOrder(customer *models.Customer) *models.Order {
	var order models.Order

	order.ID = newID()
	order.OrderCustomer = customer
	order.Items = make([]*models.OrderItem, 0)

	return &order
}
예제 #2
0
// GetOrder reads an Order identified by id from database.
func GetOrder(id uuid.UUID) *models.Order {
	order := new(models.Order)
	order.Read(id)
	return order
}