variants as a single product

This commit is contained in:
2026-09-03 10:43:05 +05:30
parent 2401158190
commit da0e9d987e
7 changed files with 205 additions and 4 deletions

View File

@@ -20,6 +20,7 @@ type ProductService interface {
UpdateProductVariant(productid, variantid int) error
AddProductVariant(v models.Productvariant) (models.Productvariant, error)
RemoveProductVariant(tenantid, variantid int) error
VariantChildIDs(tenantid int) (map[int]bool, error)
CreateProductStock(stocks []models.Productstock) error
CreateProduct(product models.Products) error
UpdateProduct(product models.Products) error
@@ -156,6 +157,12 @@ func (s *productService) RemoveProductVariant(tenantid, variantid int) error {
return s.repo.RemoveProductVariant(tenantid, variantid)
}
// VariantChildIDs lists the products that are a size of another, so a caller
// that lists products for a SHOPPER can leave them out.
func (s *productService) VariantChildIDs(tenantid int) (map[int]bool, error) {
return s.repo.VariantChildIDs(tenantid)
}
func (s *productService) UpdateProductStatus(productIDs []int, status string) error {
return s.repo.UpdateProductStatus(productIDs, status)
}