-
This commit is contained in:
parent
18689ea124
commit
f6348576a2
|
|
@ -557,31 +557,31 @@ func (s *Service) DeductBetFromBranchWallet(ctx context.Context, amount float32,
|
||||||
|
|
||||||
// This is the amount that we take from a company/tenant when they
|
// This is the amount that we take from a company/tenant when they
|
||||||
// create a bet. I.e. if its 5% (0.05), then thats the percentage we take every
|
// create a bet. I.e. if its 5% (0.05), then thats the percentage we take every
|
||||||
// deductedAmount := amount * company.DeductedPercentage
|
deductedAmount := amount * company.DeductedPercentage
|
||||||
|
|
||||||
// if deductedAmount == 0 {
|
if deductedAmount == 0 {
|
||||||
// s.mongoLogger.Fatal("Amount",
|
s.mongoLogger.Fatal("Amount",
|
||||||
// zap.Int64("wallet_id", walletID),
|
zap.Int64("wallet_id", walletID),
|
||||||
// zap.Float32("amount", deductedAmount),
|
zap.Float32("amount", deductedAmount),
|
||||||
// zap.Error(err),
|
zap.Error(err),
|
||||||
// )
|
)
|
||||||
// return err
|
return err
|
||||||
// }
|
}
|
||||||
// _, err = s.walletSvc.DeductFromWallet(ctx,
|
_, err = s.walletSvc.DeductFromWallet(ctx,
|
||||||
// walletID, domain.ToCurrency(deductedAmount), domain.ValidInt64{
|
walletID, domain.ToCurrency(deductedAmount), domain.ValidInt64{
|
||||||
// Value: userID,
|
Value: userID,
|
||||||
// Valid: true,
|
Valid: true,
|
||||||
// }, domain.TRANSFER_DIRECT,
|
}, domain.TRANSFER_DIRECT,
|
||||||
// fmt.Sprintf("Deducted %v amount from wallet by system while placing bet", deductedAmount))
|
fmt.Sprintf("Deducted %v amount from wallet by system while placing bet", deductedAmount))
|
||||||
|
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// s.mongoLogger.Error("failed to deduct from wallet",
|
s.mongoLogger.Error("failed to deduct from wallet",
|
||||||
// zap.Int64("wallet_id", walletID),
|
zap.Int64("wallet_id", walletID),
|
||||||
// zap.Float32("amount", deductedAmount),
|
zap.Float32("amount", deductedAmount),
|
||||||
// zap.Error(err),
|
zap.Error(err),
|
||||||
// )
|
)
|
||||||
// return err
|
return err
|
||||||
// }
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user