prospect

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidEmail               = errors.New("invalid email")
	ErrEmailActivityAlreadyExists = errors.New("email and activity combination already exists")
	ErrNotExist                   = errors.New("prospect does not exist")
)

Functions

This section is empty.

Types

type Filter

type Filter struct {
}

type Prospect

type Prospect struct {
	ID        string
	Name      string
	Email     string
	Phone     string
	Activity  string
	Status    Status // subscription status
	ChangedAt time.Time
	Source    string
	Verified  bool
	CreatedAt time.Time
	UpdatedAt time.Time
	Metadata  metadata.Metadata
}

type Repository

type Repository interface {
	Create(ctx context.Context, prospect Prospect) (Prospect, error)
	Get(ctx context.Context, id string) (Prospect, error)
	List(ctx context.Context, filter Filter) ([]Prospect, error)
	Update(ctx context.Context, prospect Prospect) (Prospect, error)
	Delete(ctx context.Context, id string) error
}

type Service

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

func NewService

func NewService(repository Repository) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, prospect Prospect) (Prospect, error)

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, prospectId string) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, prospectId string) (Prospect, error)

func (*Service) List

func (s *Service) List(ctx context.Context, filters Filter) ([]Prospect, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, prospect Prospect) (Prospect, error)

type Status

type Status string
const (
	Unsubscribed Status = "unsubscribed"
	Subscribed   Status = "subscribed"
)

func StringToStatus

func StringToStatus(s string) Status

func (Status) String

func (s Status) String() string

func (Status) ToDB

func (s Status) ToDB() Status

Jump to

Keyboard shortcuts

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