store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	StoreID         entity.ID
	MeliAccessToken string
	MeliUserID      string
}

type RegisterMeliCredentialsDtoInput

type RegisterMeliCredentialsDtoInput struct {
	Code  string    `json:"code"`
	Store entity.ID `json:"store_id"`
}

type RegisterStoreDtoInput

type RegisterStoreDtoInput struct {
	Email string `json:"email"`
	Name  string `json:"name"`
}

type RepoReader

type RepoReader interface {
	Get(id string) (*entity.Store, error)
	RetrieveMeliCredentialsFromStoreID(id entity.ID) (*common.MeliCredential, error)
	RetrieveMeliCredentialsFromMeliUserID(id string) (*entity.ID, *common.MeliCredential, error)
}

Repository reader interface

type RepoWriter

type RepoWriter interface {
	Create(e *entity.Store) (entity.ID, error)
	RegisterMeliCredential(id entity.ID, c *common.MeliCredential) error
	UpdateMeliCredentials(id entity.ID, c *common.MeliCredential) error
	Update(e *entity.Store) error
	Delete(id entity.ID) error
}

Repository writer interface

type Repository

type Repository interface {
	RepoReader
	RepoWriter
}

Repository interface

type StoreService

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

func NewStoreService

func NewStoreService(repository Repository, mercadolivre common.MercadoLivre, logger metrics.Logger) *StoreService

func (*StoreService) RefreshMeliCredential

func (s *StoreService) RefreshMeliCredential(storeId entity.ID, refreshToken string) (*Credentials, error)

func (*StoreService) RegisterMeliCredentials

func (s *StoreService) RegisterMeliCredentials(input RegisterMeliCredentialsDtoInput) error

func (*StoreService) RegisterStore

func (s *StoreService) RegisterStore(input RegisterStoreDtoInput) (entity.ID, error)

func (*StoreService) RetrieveMeliCredentialsFromMeliUserID

func (s *StoreService) RetrieveMeliCredentialsFromMeliUserID(id string) (*Credentials, error)

func (*StoreService) RetrieveMeliCredentialsFromStoreID

func (s *StoreService) RetrieveMeliCredentialsFromStoreID(id entity.ID) (*Credentials, error)

type UseCase

type UseCase interface {
	RegisterStore(input RegisterStoreDtoInput) (entity.ID, error)
	RegisterMeliCredentials(input RegisterMeliCredentialsDtoInput) error
	RetrieveMeliCredentialsFromStoreID(id entity.ID) (*Credentials, error)
	RetrieveMeliCredentialsFromMeliUserID(id string) (*Credentials, error)
	RefreshMeliCredential(storeId entity.ID, refreshToken string) (*Credentials, error)
}

UseCase interface

Jump to

Keyboard shortcuts

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