added mobile number to the transaction fields
This commit is contained in:
parent
9252b2fee5
commit
92186d932a
@ -1,6 +1,6 @@
|
||||
package net.ipksindia
|
||||
|
||||
import model.TransactionRequest
|
||||
import net.ipksindia.model.TransactionRequest
|
||||
import net.ipksindia.config.AppConfig
|
||||
import net.ipksindia.dao.TellerDao
|
||||
import net.ipksindia.dao.TransactionDao
|
||||
|
@ -3,7 +3,7 @@ package net.ipksindia
|
||||
import enums.TransactionType
|
||||
import net.ipksindia.model.NeftTransaction
|
||||
import model.Teller
|
||||
import model.TransactionRequest
|
||||
import net.ipksindia.model.TransactionRequest
|
||||
import net.ipksindia.model.TransferTransaction
|
||||
import java.time.format.DateTimeFormatter
|
||||
|
||||
@ -29,13 +29,14 @@ class TransactionFactory(private val transactionRequest: TransactionRequest, pri
|
||||
sourceAcctNo = transactionRequest.pacsCurrentAccountNumber,
|
||||
cbsSbAcctNo = "",
|
||||
destinationAcctNo = transactionRequest.linkedCBSAccountNumber,
|
||||
narration = "TRF to member A/C for NEFT RTGS",
|
||||
narration = "TRF for NEFT/RTGS",
|
||||
sourceTxnNo = TransactionType.TRANSFER.code,
|
||||
sourceStat = "A/P",
|
||||
apiType = "OUTWARD_QUEUE_POSTING",
|
||||
remitterName = transactionRequest.remitterName,
|
||||
ifscCode = "ABCD0000000",
|
||||
rrn = rrn + "1"
|
||||
rrn = rrn + "1",
|
||||
mobileOrEmail = transactionRequest.mobileNumber
|
||||
)
|
||||
|
||||
}
|
||||
@ -57,12 +58,13 @@ class TransactionFactory(private val transactionRequest: TransactionRequest, pri
|
||||
sourceAcctNo = transactionRequest.linkedCBSAccountNumber,
|
||||
cbsSbAcctNo = "",
|
||||
destinationAcctNo = transactionRequest.neftBeneficiaryAccountNumber,
|
||||
narration = "TRF to member A/C for NEFT RTGS",
|
||||
narration = "TRF for NEFT/RTGS",
|
||||
sourceTxnNo = TransactionType.NEFT.code,
|
||||
sourceStat = "A/P",
|
||||
apiType = "OUTWARD_QUEUE_POSTING",
|
||||
remitterName = transactionRequest.remitterName,
|
||||
ifscCode = transactionRequest.ifscCode,
|
||||
mobileOrEmail = transactionRequest.mobileNumber,
|
||||
rrn = rrn + "2"
|
||||
)
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.ipksindia.dao
|
||||
|
||||
import model.TransactionRequest
|
||||
import net.ipksindia.model.TransactionRequest
|
||||
import net.ipksindia.ItemNotFoundException
|
||||
import java.sql.Date
|
||||
import java.sql.ResultSet
|
||||
@ -27,13 +27,15 @@ class TransactionDao {
|
||||
comm_txn_no,
|
||||
comm_txn_amt,
|
||||
dccb_code,
|
||||
TO_NUMBER(cbs_br_code) AS br_code,
|
||||
TO_NUMBER(t.cbs_br_code) AS br_code,
|
||||
SUBSTR(REGEXP_REPLACE(REGEXP_REPLACE(UPPER(remm_name), '[^A-Z0-9 ]', ''), ' {2,}', ' '),1,35) AS remitter_name,
|
||||
ipks_accno AS pacs_acc_no,
|
||||
da.link_accno AS cbs_sb_acc_no,
|
||||
'pacs_db' AS db_name
|
||||
'pacs_db' AS db_name,
|
||||
kh.mobile_no
|
||||
FROM neft_rtgs_txn t
|
||||
JOIN dep_account da ON t.ipks_accno = da.key_1
|
||||
JOIN kyc_hdr kh ON da.customer_no = kh.cif_no
|
||||
WHERE
|
||||
t.txn_no = ?
|
||||
""".trimIndent()
|
||||
@ -89,20 +91,20 @@ class TransactionDao {
|
||||
it.setString(19, neftQueueNumber)
|
||||
}.use { it.executeUpdate() }
|
||||
}
|
||||
}catch (e: ExceptionInInitializerError) {
|
||||
throw SQLException("Failed to connect to the database")
|
||||
} catch (e: ExceptionInInitializerError) {
|
||||
throw SQLException("Failed to connect to the database ${e.message}")
|
||||
}
|
||||
}
|
||||
|
||||
fun getTransactionRequest(transactionNumber: String): TransactionRequest {
|
||||
return try {
|
||||
DatabaseFactory.instance.getConnection().use { connection ->
|
||||
connection.prepareStatement(singleTransactionRequestQuery).apply { setString(1, transactionNumber) }
|
||||
.executeQuery()
|
||||
.use { mapToObject(it) ?: throw ItemNotFoundException("Transaction Number", transactionNumber) }
|
||||
}
|
||||
connection.prepareStatement(singleTransactionRequestQuery).apply { setString(1, transactionNumber) }
|
||||
.executeQuery()
|
||||
.use { mapToObject(it) ?: throw ItemNotFoundException("Transaction Number", transactionNumber) }
|
||||
}
|
||||
} catch (e: ExceptionInInitializerError) {
|
||||
throw SQLException("Failed to connect to the database")
|
||||
throw SQLException("Failed to connect to the database: ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -130,6 +132,7 @@ private fun mapToObject(rs: ResultSet): TransactionRequest? {
|
||||
remitterName = rs.getString("remitter_name"),
|
||||
pacsAccountNumber = rs.getString("pacs_acc_no"),
|
||||
linkedCBSAccountNumber = rs.getString("cbs_sb_acc_no"),
|
||||
mobileNumber = rs.getString("mobile_no") ?: "999999999"
|
||||
)
|
||||
}
|
||||
return null
|
||||
|
@ -25,5 +25,6 @@ class NeftTransaction(
|
||||
override val apiType: String,
|
||||
override val remitterName: String,
|
||||
override val ifscCode: String,
|
||||
override val mobileOrEmail: String,
|
||||
override val rrn: String,
|
||||
) : Transaction
|
@ -21,5 +21,6 @@ interface Transaction {
|
||||
val apiType: String
|
||||
val remitterName: String
|
||||
val ifscCode: String
|
||||
val mobileOrEmail: String
|
||||
val rrn: String
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package model
|
||||
package net.ipksindia.model
|
||||
|
||||
import java.time.LocalDate
|
||||
|
||||
@ -21,6 +21,7 @@ data class TransactionRequest(
|
||||
val branchCode: String,
|
||||
val remitterName: String,
|
||||
val pacsAccountNumber: String,
|
||||
val linkedCBSAccountNumber: String
|
||||
val linkedCBSAccountNumber: String,
|
||||
val mobileNumber: String
|
||||
)
|
||||
|
||||
|
@ -25,5 +25,6 @@ class TransferTransaction(
|
||||
override val apiType: String,
|
||||
override val remitterName: String,
|
||||
override val ifscCode: String,
|
||||
override val mobileOrEmail: String,
|
||||
override val rrn: String,
|
||||
) : Transaction
|
||||
|
@ -10,7 +10,7 @@ bank {
|
||||
server {
|
||||
protocol = "http"
|
||||
host = "localhost"
|
||||
port = 8080
|
||||
port = 3000
|
||||
rootRoute = "IPKS_Queue_Generation"
|
||||
transactionRoute = "IpksApi"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user