Add Balance Api
This commit is contained in:
@@ -37,6 +37,10 @@ func (r *WalletRepository) Update(ctx context.Context, db *gorm.DB, wallet *enti
|
||||
}
|
||||
|
||||
func (r *WalletRepository) GetByPartnerID(ctx context.Context, db *gorm.DB, partnerID int64) (*entity.Wallet, error) {
|
||||
if db == nil {
|
||||
db = r.db
|
||||
}
|
||||
|
||||
wallet := new(entity.Wallet)
|
||||
if err := db.WithContext(ctx).Where("partner_id = ?", partnerID).First(wallet).Error; err != nil {
|
||||
logger.ContextLogger(ctx).Error("error when finding wallet by partner ID", zap.Error(err))
|
||||
|
||||
Reference in New Issue
Block a user