예제 #1
0
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)
}
예제 #2
0
func (customer *Customer) GetDefaultShippingAddressID() (string, error) {
	address, err := customer.GetDefaultShippingAddress()
	if err != nil {
		return "", err
	}
	return address.GetID(), nil

}