Skip to content

Commit

Permalink
refactor/OBPv510 added currency to CounterpartyLimit Model
Browse files Browse the repository at this point in the history
  • Loading branch information
hongwei1 committed Jul 12, 2024
1 parent d9f0bce commit ec2c10e
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5470,6 +5470,7 @@ object SwaggerDefinitionsJSON {
account_id = accountIdExample.value,
view_id = viewIdExample.value,
counterparty_id = counterpartyIdExample.value,
currency = currencyExample.value,
max_single_amount = maxSingleAmountExample.value.toInt,
max_monthly_amount = maxMonthlyAmountExample.value.toInt,
max_number_of_monthly_transactions = maxNumberOfMonthlyTransactionsExample.value.toInt,
Expand Down
2 changes: 2 additions & 0 deletions obp-api/src/main/scala/code/api/util/NewStyle.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4068,6 +4068,7 @@ object NewStyle extends MdcLoggable{
accountId: String,
viewId: String,
counterpartyId: String,
currency: String,
maxSingleAmount: Int,
maxMonthlyAmount: Int,
maxNumberOfMonthlyTransactions: Int,
Expand All @@ -4080,6 +4081,7 @@ object NewStyle extends MdcLoggable{
accountId: String,
viewId: String,
counterpartyId: String,
currency: String,
maxSingleAmount: Int,
maxMonthlyAmount: Int,
maxNumberOfMonthlyTransactions: Int,
Expand Down
2 changes: 2 additions & 0 deletions obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,7 @@ trait APIMethods510 {
accountId.value,
viewId.value,
counterpartyId.value,
postCounterpartyLimitV510.currency,
postCounterpartyLimitV510.max_single_amount,
postCounterpartyLimitV510.max_monthly_amount,
postCounterpartyLimitV510.max_number_of_monthly_transactions,
Expand Down Expand Up @@ -2398,6 +2399,7 @@ trait APIMethods510 {
accountId.value,
viewId.value,
counterpartyId.value,
postCounterpartyLimitV510.currency,
postCounterpartyLimitV510.max_single_amount,
postCounterpartyLimitV510.max_monthly_amount,
postCounterpartyLimitV510.max_number_of_monthly_transactions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ case class CounterpartyLimitV510(
account_id: String,
view_id: String,
counterparty_id: String,
currency: String,
max_single_amount: Int,
max_monthly_amount: Int,
max_number_of_monthly_transactions: Int,
Expand Down
1 change: 1 addition & 0 deletions obp-api/src/main/scala/code/bankconnectors/Connector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2693,6 +2693,7 @@ trait Connector extends MdcLoggable {
accountId: String,
viewId: String,
counterpartyId: String,
currency: String,
maxSingleAmount: Int,
maxMonthlyAmount: Int,
maxNumberOfMonthlyTransactions: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5947,6 +5947,7 @@ object LocalMappedConnector extends Connector with MdcLoggable {
accountId: String,
viewId: String,
counterpartyId: String,
currency: String,
maxSingleAmount: Int,
maxMonthlyAmount: Int,
maxNumberOfMonthlyTransactions: Int,
Expand All @@ -5957,6 +5958,7 @@ object LocalMappedConnector extends Connector with MdcLoggable {
accountId: String,
viewId: String,
counterpartyId: String,
currency: String,
maxSingleAmount: Int,
maxMonthlyAmount: Int,
maxNumberOfMonthlyTransactions: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ trait CounterpartyLimitProviderTrait {
accountId: String,
viewId: String,
counterpartyId: String,
currency: String,
maxSingleAmount: Int,
maxMonthlyAmount: Int,
maxNumberOfMonthlyTransactions: Int,
Expand All @@ -48,6 +49,7 @@ trait CounterpartyLimitTrait extends JsonAble{
def viewId: String
def counterpartyId: String

def currency: String
def maxSingleAmount: Int
def maxMonthlyAmount: Int
def maxNumberOfMonthlyTransactions: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ object MappedCounterpartyLimitProvider extends CounterpartyLimitProviderTrait {
accountId: String,
viewId: String,
counterpartyId: String,
currency: String,
maxSingleAmount: Int,
maxMonthlyAmount: Int,
maxNumberOfMonthlyTransactions: Int,
Expand All @@ -58,6 +59,7 @@ object MappedCounterpartyLimitProvider extends CounterpartyLimitProviderTrait {
counterpartyLimit.AccountId(accountId)
counterpartyLimit.ViewId(viewId)
counterpartyLimit.CounterpartyId(counterpartyId)
counterpartyLimit.Currency(currency)
counterpartyLimit.MaxSingleAmount(maxSingleAmount)
counterpartyLimit.MaxMonthlyAmount(maxMonthlyAmount)
counterpartyLimit.MaxNumberOfMonthlyTransactions(maxNumberOfMonthlyTransactions)
Expand Down Expand Up @@ -100,6 +102,9 @@ class CounterpartyLimit extends CounterpartyLimitTrait with LongKeyedMapper[Coun
override def dbNotNull_? = true
}

object Currency extends MappedString(this, 255){
override def dbNotNull_? = true
}

object MaxSingleAmount extends MappedInt(this) {
override def defaultValue = -1
Expand All @@ -123,6 +128,7 @@ class CounterpartyLimit extends CounterpartyLimitTrait with LongKeyedMapper[Coun
def accountId: String = AccountId.get
def viewId: String = ViewId.get
def counterpartyId: String = CounterpartyId.get
def currency: String = Currency.get

def maxSingleAmount: Int = MaxSingleAmount.get
def maxMonthlyAmount: Int = MaxMonthlyAmount.get
Expand All @@ -136,6 +142,7 @@ class CounterpartyLimit extends CounterpartyLimitTrait with LongKeyedMapper[Coun
("account_id",accountId) ~
("view_id",viewId) ~
("counterparty_id",counterpartyId) ~
("currency",currency) ~
("max_single_amount", maxSingleAmount) ~
("max_monthly_amount", maxMonthlyAmount) ~
("max_number_of_monthly_transactions", maxNumberOfMonthlyTransactions) ~
Expand Down

0 comments on commit ec2c10e

Please sign in to comment.