manufacturer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

 import (
	"github.com/gin-gonic/gin"

)

type ExampleManufacturerRequests struct { }

func (m ExampleManufacturerRequests) RegisterItem(ctx *gin.Context) error {
	return nil
}

func (m ExampleManufacturerRequests) UpdateItem(ctx *gin.Context) error {
	return nil
}

func (m ExampleManufacturerRequests) DeleteItem(ctx *gin.Context) error {
	return nil
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IInspectPayloadUtils

type IInspectPayloadUtils interface {
	Register(RegisterPayload) error
	Update(UpdatePayload) (map[string]interface{}, error)
}

type IItemRepository

type IItemRepository interface {
	Register(itemId string, i RegisterPayload, userId string) error
	Update(i map[string]interface{}, itemId string) error
	Delete(itemId string) error
}

type IItemRequests

type IItemRequests interface {
	Register(registerPayload RegisterPayload, userId string, itemId string) error
	Update(updatePayload UpdatePayload, userId string, itemId string) error
	Delete(itemId string, userId string) error
}

type ItemRegisterDetailsPayload

type ItemRegisterDetailsPayload struct {
	Stock       int      `json:"stock" binding:"required"`
	Size        int      `json:"size" binding:"required"`
	Description string   `json:"description" binding:"required"`
	Tags        []string `json:"tags" binding:"required" `
}

type ManufacturerUtils

type ManufacturerUtils struct {
}

func (ManufacturerUtils) Register

func (m ManufacturerUtils) Register(i RegisterPayload) error

func (ManufacturerUtils) Update

func (m ManufacturerUtils) Update(updatePayload UpdatePayload) (map[string]interface{}, error)

type RegisterPayload

type RegisterPayload struct {
	Name    string                     `json:"name" binding:"required"`
	Price   int                        `json:"price" binding:"required"`
	Details ItemRegisterDetailsPayload `json:"details" binding:"required"`
}

type Repository

type Repository struct {
	DB   *gorm.DB
	Crud images.R2Conns
}

func (Repository) Delete

func (r Repository) Delete(itemId string) error

func (Repository) Register

func (r Repository) Register(itemId string, i RegisterPayload, userId string) error

func (Repository) Update

func (r Repository) Update(i map[string]interface{}, itemId string) error

type Requests

type Requests struct {
	ManufacturerItemRepository      IItemRepository
	ManufacturerInspectPayloadUtils IInspectPayloadUtils
	ItemRepository                  items.IRepository
}

func (Requests) Delete

func (r Requests) Delete(itemId string, userId string) error

func (Requests) Register

func (r Requests) Register(itemRegisterPayload RegisterPayload, userId string, itemId string) error

func (Requests) Update

func (r Requests) Update(updatePayload UpdatePayload, userId string, itemId string) error

type TestRepository

type TestRepository struct {
	DB *gorm.DB
}

func (TestRepository) Delete

func (r TestRepository) Delete(itemId string) error

func (TestRepository) Register

func (r TestRepository) Register(itemId string, i RegisterPayload, userId string) error

func (TestRepository) Update

func (r TestRepository) Update(i map[string]interface{}, itemId string) error

type UpdatePayload

type UpdatePayload struct {
	Name        string       `json:"name"`
	Price       int          `json:"price"`
	Status      items.Status `json:"status"`
	Stock       int          `json:"stock"`
	Size        int          `json:"size"`
	Description string       `json:"description" `
	Tags        []string     `json:"tags"`
}

Jump to

Keyboard shortcuts

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