address

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader interface {
	Load(ctx context.Context, id valueobject.Identifier) (*addressEntity.Address, error)
	GetAddressIds(ctx context.Context, includeDeleted bool) ([]valueobject.Identifier, error)
}

type Repository

type Repository interface {
	Reader
	Writer
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

implements Repository interface

func NewService

func NewService(r Repository) *Service

NewService creates new address service

func (*Service) CreateAddress

func (s *Service) CreateAddress(ctx context.Context, street valueobject.Street, postalCode valueobject.PostalCode, locality valueobject.Locality, country valueobject.Country, canton valueobject.Canton, additional valueobject.Additional) (valueobject.Identifier, error)

CreateAddress creates new address

func (*Service) DeleteAddress

func (s *Service) DeleteAddress(ctx context.Context, id valueobject.Identifier) (*addressEntity.Address, error)

DeleteAddress deletes address of provided ID

func (*Service) GetAddress

GetAddress gets address of provided ID

func (*Service) GetAddresses

func (s *Service) GetAddresses(ctx context.Context, includeDeleted bool) ([]addressEntity.Address, error)

GetAddresses get existing addresses, setting includeDeleted returns also addresses marked as deleted

func (*Service) UpdateAddress

UpdateAddress updates existing address with provided values

type Writer

type Writer interface {
	Save(ctx context.Context, e *addressEntity.Address) (valueobject.Identifier, error)
}

Jump to

Keyboard shortcuts

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