paymails

package
v1.0.0-beta.43 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PaymailRepo

type PaymailRepo interface {
	Create(ctx context.Context, newPaymail *paymailsmodels.NewPaymail) (*paymailsmodels.Paymail, error)
	Find(ctx context.Context, alias, domain string) (*paymailsmodels.Paymail, error)
	// FindForUser returns a paymail by alias and domain for given user.
	FindForUser(ctx context.Context, alias, domain, userID string) (*paymailsmodels.Paymail, error)
	// GetDefault returns a default paymail for user.
	GetDefault(ctx context.Context, userID string) (*paymailsmodels.Paymail, error)
}

PaymailRepo is a paymail repository

type Service

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

Service for paymails

func NewService

func NewService(paymails PaymailRepo, users UsersService, cfg *config.AppConfig) *Service

NewService creates a new paymails service

func (*Service) Create

func (s *Service) Create(ctx context.Context, newPaymail *paymailsmodels.NewPaymail) (*paymailsmodels.Paymail, error)

Create creates a new paymail attached to a user

func (*Service) Find

func (s *Service) Find(ctx context.Context, alias, domain string) (*paymailsmodels.Paymail, error)

Find returns a paymail by alias and domain

func (*Service) GetDefaultPaymailAddress

func (s *Service) GetDefaultPaymailAddress(ctx context.Context, xPubID string) (string, error)

GetDefaultPaymailAddress returns the default paymail address for the given xPubId.

func (*Service) HasPaymailAddress

func (s *Service) HasPaymailAddress(ctx context.Context, userID string, address string) (bool, error)

HasPaymailAddress checks if the given address belongs to a given User.

type UsersService

type UsersService interface {
	Exists(ctx context.Context, userID string) (bool, error)
}

UsersService is a user domain service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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