Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
fatemeh-i committed Apr 18, 2024
1 parent 3afd5ca commit 7be1e96
Showing 1 changed file with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,46 +226,46 @@ class TransferService(
)
}

@Transactional
suspend fun depositManually(
symbol: String,
receiverUuid: String,
senderUuid: String,
amount: BigDecimal,
request: ManualTransferRequest
): TransferResult {
logger.info("deposit manually: $senderUuid to $receiverUuid on $symbol at ${LocalDateTime.now()}")
val systemUuid = "1"
//todo customize error message
val senderLevel = walletOwnerManager.findWalletOwner(senderUuid)?.let { it.level }
?: throw OpexError.WalletOwnerNotFound.exception()
val receiverLevel = walletOwnerManager.findWalletOwner(receiverUuid)?.let { it.level }

if (senderLevel !in arrayListOf<String>(preferences.admin.walletLevel, preferences.system.walletLevel))
throw OpexError.Forbidden.exception()

if (senderLevel == preferences.system.walletLevel && receiverLevel != preferences.admin.walletLevel)
throw OpexError.Forbidden.exception()

// if (walletOwnerManager.findWalletOwner(receiverUuid)?.level !in arrayListOf<String>(preferences.admin.walletLevel,preferences.system.walletLevel))
// @Transactional
// suspend fun depositManually(
// symbol: String,
// receiverUuid: String,
// senderUuid: String,
// amount: BigDecimal,
// request: ManualTransferRequest
// ): TransferResult {
// logger.info("deposit manually: $senderUuid to $receiverUuid on $symbol at ${LocalDateTime.now()}")
// val systemUuid = "1"
// //todo customize error message
// val senderLevel = walletOwnerManager.findWalletOwner(senderUuid)?.let { it.level }
// ?: throw OpexError.WalletOwnerNotFound.exception()
// val receiverLevel = walletOwnerManager.findWalletOwner(receiverUuid)?.let { it.level }
//
// if (senderLevel !in arrayListOf<String>(preferences.admin.walletLevel, preferences.system.walletLevel))
// throw OpexError.Forbidden.exception()

return _transfer(
symbol,
"main",
senderUuid,
"main",
receiverUuid,
amount,
request.description,
request.ref,
"DEPOSIT_MANUALLY",
null,
symbol,
amount

)
}
//
// if (senderLevel == preferences.system.walletLevel && receiverLevel != preferences.admin.walletLevel)
// throw OpexError.Forbidden.exception()
//
//// if (walletOwnerManager.findWalletOwner(receiverUuid)?.level !in arrayListOf<String>(preferences.admin.walletLevel,preferences.system.walletLevel))
//// throw OpexError.Forbidden.exception()
//
// return _transfer(
// symbol,
// "main",
// senderUuid,
// "main",
// receiverUuid,
// amount,
// request.description,
// request.ref,
// "DEPOSIT_MANUALLY",
// null,
// symbol,
// amount
//
// )
// }

@Transactional
suspend fun depositManually(
Expand Down

0 comments on commit 7be1e96

Please sign in to comment.