createProduct

package
v0.0.0-...-9de6353 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRepositoryCreate

func NewRepositoryCreate(db *gorm.DB) *repository

func NewServiceCreate

func NewServiceCreate(repository Repository) *service

Types

type CreateProductError

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

func (*CreateProductError) Error

func (e *CreateProductError) Error() string

type InputCreateProduct

type InputCreateProduct struct {
	UserID           string          `json:"user_id" validate:"required"`
	ParentID         string          `json:"parent_id" validate:""`
	ProductImages    string          `json:"productImages" validate:""`
	Categories       string          `json:"categories" validate:""`
	Sku              string          `json:"sku" validate:"required"`
	Name             string          `json:"name" validate:"required"`
	Slug             string          `json:"slug" validate:"required"`
	Price            decimal.Decimal `json:"price" validate:"required"`
	Stock            int             `json:"stock" validate:""`
	Weight           decimal.Decimal `json:"weight" validate:""`
	ShortDescription string          `json:"shortDescription" validate:""`
	Description      string          `json:"description" validate:""`
	Status           int             `json:"status"`
}

type ProductCategoryCreationError

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

func (*ProductCategoryCreationError) Error

type Repository

type Repository interface {
	CreateProductRepository(input *model.Product) (*model.Product, error)
}

type Service

type Service interface {
	CreateProductService(input *InputCreateProduct) (*model.Product, error)
}

type UserNotFoundError

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

Define custom error types

func (*UserNotFoundError) Error

func (e *UserNotFoundError) Error() string

Jump to

Keyboard shortcuts

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