agreement

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAgreementNotFound        = errors.New("agreement not found")
	ErrAgreementAlreadyAccepted = errors.New("agreement already accepted")
)

Functions

This section is empty.

Types

type Agreement

type Agreement = models.Agreement

type Repository

type Repository interface {
	Get(ctx context.Context, codename string) (*models.Agreement, error)
	List(ctx context.Context) ([]*models.Agreement, error)
	NextAwailable(ctx context.Context) (*models.Agreement, error)
	Accept(ctx context.Context, codename string, signature string) (*models.Agreement, error)
}

type RepositoryOptionsImpl

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

func NewRepositoryOptions

func NewRepositoryOptions(opts option.Usecase, agreements []*models.Agreement) *RepositoryOptionsImpl

func (*RepositoryOptionsImpl) Accept

func (r *RepositoryOptionsImpl) Accept(ctx context.Context, codename string, signature string) (*models.Agreement, error)

Accept accepts an agreement for the current user and account.

func (*RepositoryOptionsImpl) Get

func (r *RepositoryOptionsImpl) Get(ctx context.Context, codename string) (*models.Agreement, error)

Get retrieves an agreement by its codename and fills acceptance details for the current user and account.

func (*RepositoryOptionsImpl) List

List returns all agreements with acceptance details for the current user and account.

func (*RepositoryOptionsImpl) NextAwailable

func (r *RepositoryOptionsImpl) NextAwailable(ctx context.Context) (*models.Agreement, error)

NextAwailable returns the next available agreement for the current user and account.

type UsecaseImpl

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

func NewUsecase

func NewUsecase(repo Repository) *UsecaseImpl

func (*UsecaseImpl) Accept

func (u *UsecaseImpl) Accept(ctx context.Context, codename string, signature string) (*models.Agreement, error)

func (*UsecaseImpl) Get

func (u *UsecaseImpl) Get(ctx context.Context, codename string) (*models.Agreement, error)

func (*UsecaseImpl) List

func (u *UsecaseImpl) List(ctx context.Context) ([]*models.Agreement, error)

func (*UsecaseImpl) NextAwailable

func (u *UsecaseImpl) NextAwailable(ctx context.Context) (*models.Agreement, error)

Directories

Path Synopsis
delivery

Jump to

Keyboard shortcuts

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