domain

package
v0.0.0-...-3a9fddd Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNameCannotBeBlank       = errors.Wrap(errors.ErrBadRequest, "the customer name cannot be blank")
	ErrCustomerIDCannotBeBlank = errors.Wrap(errors.ErrBadRequest, "the customer id cannot be blank")
	ErrSmsNumberCannotBeBlank  = errors.Wrap(errors.ErrBadRequest, "the SMS number cannot be blank")
	ErrCustomerAlreadyEnabled  = errors.Wrap(errors.ErrBadRequest, "the customer is already enabled")
	ErrCustomerAlreadyDisabled = errors.Wrap(errors.ErrBadRequest, "the customer is already disabled")
)

Functions

This section is empty.

Types

type Customer

type Customer struct {
	ID        string
	Name      string
	SmsNumber string
	Enabled   bool
}

func RegisterCustomer

func RegisterCustomer(id, name, smsNumber string) (*Customer, error)

func (*Customer) Disable

func (c *Customer) Disable() error

func (*Customer) Enable

func (c *Customer) Enable() error

type CustomerRepository

type CustomerRepository interface {
	Save(ctx context.Context, customer *Customer) error
	Find(ctx context.Context, customerID string) (*Customer, error)
	Update(ctx context.Context, customer *Customer) error
}

Jump to

Keyboard shortcuts

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