console categories

This commit is contained in:
2026-09-07 17:53:35 +05:30
parent c699a400c3
commit e87f09c4f2
5 changed files with 107 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ type ProductService interface {
RelinkCatalogue(tenantid int, dryRun bool) (*RelinkReport, error)
GetTenantCategories(tenantid int) ([]models.TenantCategory, error)
EnsureTenantCategories(tenantid int, names []string) (map[string]int, error)
RecategoriseProducts(tenantid int, updates []models.ProductCategoryUpdate) (int64, error)
PublishProduct(tenantID, productID int, price, taxPercent float64) (int, error)
UnpublishProduct(tenantID, productID int) (int, error)
}
@@ -511,6 +512,11 @@ func (s *productService) EnsureTenantCategories(tenantid int, names []string) (m
return s.repo.EnsureTenantCategories(tenantid, names)
}
// RecategoriseProducts moves a tenant's products into different categories.
func (s *productService) RecategoriseProducts(tenantid int, updates []models.ProductCategoryUpdate) (int64, error) {
return s.repo.RecategoriseProducts(tenantid, updates)
}
// PublishProduct releases a product to every outlet the tenant runs.
//
// The price check lives in the repository rather than here, so it holds for any