// 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 }
// 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 }