func (customer *Customer) GetAddressById(id string) (*address.Address, error) { for _, address := range customer.GetAddresses() { if address.GetID() == id { return address, nil } } return nil, errors.New(shop_error.ErrorNotFound) }
func (customer *Customer) GetDefaultShippingAddressID() (string, error) { address, err := customer.GetDefaultShippingAddress() if err != nil { return "", err } return address.GetID(), nil }