domain

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: OSL-3.0 Imports: 4 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// GenderMale for male customers
	GenderMale = "male"
	// GenderFemale for female customers
	GenderFemale = "female"
	// GenderOther for other customers
	GenderOther = "other"
	// GenderUnknown unknown
	GenderUnknown = ""
)

Variables

View Source
var (
	//ErrCustomerNotFoundError - semantic error returned if no customer was found
	ErrCustomerNotFoundError = errors.New("Customer not found")
)

Functions

This section is empty.

Types

type Address

type Address struct {
	RegionCode             string
	CountryCode            string
	Company                string
	Street                 string
	StreetNr               string
	AdditionalAddressLines []string
	Telephone              string
	PostCode               string
	City                   string
	Firstname              string
	Lastname               string
	Email                  string
}

Address data of a customer

type Customer

type Customer interface {
	GetId() string
	GetPersonalData() PersonData
	GetAddresses() []Address
	GetDefaultShippingAddress() *Address
	GetDefaultBillingAddress() *Address
}

Customer data interface

type CustomerService

type CustomerService interface {
	//GetByAuth - returns Customer by the provided Auth infos
	GetByAuth(ctx context.Context, auth domain.Auth) (Customer, error)
}

CustomerService to retrieve customers

type PersonData

type PersonData struct {
	//Gender male, female, other, unknown
	Gender     string
	FirstName  string
	LastName   string
	MiddleName string
	MainEmail  string
	//Prefix such as (mr, mrs, ms) string
	Prefix      string
	Birthday    time.Time
	Nationality string
}

PersonData contains personal data

Jump to

Keyboard shortcuts

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