Customer Order

This commit is contained in:
aditya.siregar
2024-08-04 01:16:25 +07:00
parent 265dd9b6e8
commit bdf930445c
30 changed files with 832 additions and 43 deletions
+10
View File
@@ -55,6 +55,16 @@ func (b *ProductRepository) GetProductByPartnerIDAndSiteID(ctx context.Context,
return products, nil
}
func (b *ProductRepository) GetProductsBySiteID(ctx context.Context, siteID int64) (entity.ProductList, error) {
var products []*entity.ProductDB
if err := b.db.WithContext(ctx).Where("site_id = ?", siteID).Find(&products).Error; err != nil {
logger.ContextLogger(ctx).Error("error when finding product by partner ID and site id", zap.Error(err))
return nil, err
}
return products, nil
}
func (b *ProductRepository) GetAllProducts(ctx context.Context, req entity.ProductSearch) (entity.ProductList, int, error) {
var products []*entity.ProductDB
var total int64