add order and payment

This commit is contained in:
aditya.siregar
2024-06-04 02:59:31 +07:00
parent 8a23e72230
commit 4ae9079ff9
34 changed files with 810 additions and 1172 deletions
+9
View File
@@ -105,3 +105,12 @@ func (b *ProductRepository) DeleteProduct(ctx context.Context, id int64) error {
}
return nil
}
func (b *ProductRepository) GetProductsByIDs(ctx context.Context, ids []int64, partnerID int64) ([]*entity.ProductDB, error) {
var products []*entity.ProductDB
if err := b.db.Where("partner_id = ? AND id IN ?", partnerID, ids).Find(&products).Error; err != nil {
logger.ContextLogger(ctx).Error("error when getting products by IDs and partner ID", zap.Error(err))
return nil, err
}
return products, nil
}