helper

package
v0.0.0-...-91324cc Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildQueryReduceStocks

func BuildQueryReduceStocks(data []*dto.ReduceStocksReq) (query string, args []any)

func BuildQueryRollbackStocks

func BuildQueryRollbackStocks(data []*dto.RollbackStoksReq) (query string, args []any)

func CheckExistDir

func CheckExistDir(path string) error

func CheckStockProducts

func CheckStockProducts(orders []*dto.ReduceStocksReq, products []*entity.Product) error

func CreateLimitAndOffset

func CreateLimitAndOffset(page int) (limit, offset int)

func CreateUnixFileName

func CreateUnixFileName(filename string) string

func DeleteFile

func DeleteFile(path string)

func FormatPagedData

func FormatPagedData[T any](data T, totalData int, page int, limit int) *dto.DataWithPaging[T]

func GetMetadata

func GetMetadata(ctx context.Context) *entity.Metadata

func GetProductIds

func GetProductIds(products any) (ids []uint, err error)

func LogJSON

func LogJSON(value any)

func MapProductQueryToEntities

func MapProductQueryToEntities(data []*entity.ProductQueryRes) (products []*entity.Product, totalProducts int)

Types

This section is empty.

Jump to

Keyboard shortcuts

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