prospect

package
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 7 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")
	ErrInvalidUUID                = errors.New("invalid syntax of uuid")
)

Functions

This section is empty.

Types

type ListProspects added in v0.51.0

type ListProspects struct {
	Prospects []Prospect   `json:"prospects"`
	Group     *utils.Group `json:"group,omitempty"`
	Page      utils.Page   `json:"pagination"`
}

type Prospect

type Prospect struct {
	ID        string    `rql:"name=id,type=string"`
	Name      string    `rql:"name=name,type=string"`
	Email     string    `rql:"name=email,type=string"`
	Phone     string    `rql:"name=phone,type=string"`
	Activity  string    `rql:"name=activity,type=string"`
	Status    Status    `rql:"name=status,type=string"` // subscription status
	ChangedAt time.Time `rql:"name=changed_at,type=datetime"`
	Source    string    `rql:"name=source,type=string"`
	Verified  bool      `rql:"name=verified,type=bool"`
	CreatedAt time.Time `rql:"name=created_at,type=datetime"`
	UpdatedAt time.Time `rql:"name=updated_at,type=datetime"`
	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, query *rql.Query) (ListProspects, 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, query *rql.Query) (ListProspects, 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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