bugs on variant id

This commit is contained in:
2026-08-29 16:45:47 +05:30
parent c5109bf216
commit 76554d26e5
8 changed files with 204 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ type CatalogueService interface {
GetProducts(brand, category, keyword string, pageno, pagesize int) ([]models.CatalogueProduct, int64, error)
GetProductBySKU(brand, sku string) (*models.CatalogueProduct, error)
GetProductByID(brand string, id int64) (*models.CatalogueProduct, error)
GetProductByImageID(brand, imageID string) (*models.CatalogueProduct, error)
}
type catalogueService struct {
@@ -37,6 +38,13 @@ func (s *catalogueService) GetProductBySKU(brand, sku string) (*models.Catalogue
return s.repo.GetProductBySKU(brand, sku)
}
// GetProductByImageID is the join the ingest manifest needs: the pipeline
// reports what it wrote as image_id values, and importing into a shop needs
// the row id.
func (s *catalogueService) GetProductByImageID(brand, imageID string) (*models.CatalogueProduct, error) {
return s.repo.GetProductByImageID(brand, imageID)
}
func (s *catalogueService) GetProductByID(brand string, id int64) (*models.CatalogueProduct, error) {
return s.repo.GetProductByID(brand, id)
}