application

package
v0.0.0-...-af6c1de Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCategoryPayload

type CreateCategoryPayload struct {
	Name        string
	Description string
	ImageUrl    string
}

type CreateProductPayload

type CreateProductPayload struct {
	Name        string
	Description string
	Price       float64
	CategotyID  uuid.UUID
}

type GetManyCategoryParams

type GetManyCategoryParams struct {
	Page           string
	PerPage        string
	OrderBy        string
	OrderDirection string
}

type GetManyProductParams

type GetManyProductParams struct {
	Page           string
	PerPage        string
	OrderBy        string
	OrderDirection string
}

type StoreService

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

func New

func New(repository *repository.StoreRepository, external *external.External) *StoreService

func (*StoreService) CreateCategory

func (s *StoreService) CreateCategory(ctx context.Context, data CreateCategoryPayload) (*int64, error)

func (*StoreService) CreateProduct

func (s *StoreService) CreateProduct(ctx context.Context, data CreateProductPayload) (*int64, error)

func (*StoreService) DeleteCategory

func (s *StoreService) DeleteCategory(ctx context.Context, id uuid.UUID) (*int64, error)

func (*StoreService) DeleteProduct

func (s *StoreService) DeleteProduct(ctx context.Context, id uuid.UUID) (*int64, error)

func (*StoreService) GetCategoryById

func (s *StoreService) GetCategoryById(ctx context.Context, id uuid.UUID) (*entity.Category, error)

func (*StoreService) GetManyCategory

func (s *StoreService) GetManyCategory(ctx context.Context, params GetManyCategoryParams) (*[]entity.Category, error)

func (*StoreService) GetManyCategoryNoDb

func (s *StoreService) GetManyCategoryNoDb(ctx context.Context) (*[]entity.Category, error)

func (*StoreService) GetManyProduct

func (s *StoreService) GetManyProduct(ctx context.Context, params GetManyProductParams) (*[]entity.Product, error)

func (*StoreService) GetProductById

func (s *StoreService) GetProductById(ctx context.Context, id uuid.UUID) (*entity.Product, error)

func (*StoreService) UpdateCategory

func (s *StoreService) UpdateCategory(ctx context.Context, id uuid.UUID, data UpdateCategoryPayload) (*int64, error)

func (*StoreService) UpdateProduct

func (s *StoreService) UpdateProduct(ctx context.Context, id uuid.UUID, data UpdateProductPayload) (*int64, error)

type UpdateCategoryPayload

type UpdateCategoryPayload struct {
	Name        string
	Description string
}

type UpdateProductPayload

type UpdateProductPayload struct {
	Name        string
	Description string
	Price       float64
	CategoryID  uuid.UUID
}

Jump to

Keyboard shortcuts

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