JD-267 add country and bump parent

This commit is contained in:
ElenaKushchenko 2021-05-26 12:05:10 +03:00
parent 65c5756666
commit d254d22889
5 changed files with 26 additions and 11 deletions

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.rbkmoney</groupId>
<artifactId>service-parent-pom</artifactId>
<version>1.0.9</version>
<version>1.2.2</version>
</parent>
<artifactId>claim-management-api</artifactId>
@ -26,7 +26,7 @@
<exposed.ports>${server.port} ${management.port}</exposed.ports>
<dockerfile.registry>${env.REGISTRY}</dockerfile.registry>
<swag-claim-management.version>1.28-ae84b84-server</swag-claim-management.version>
<swag-claim-management.version>1.29-d665bf2-server</swag-claim-management.version>
<keycloak-spring-security.version>12.0.1</keycloak-spring-security.version>
<bouncycastle-jdk15on.version>1.68</bouncycastle-jdk15on.version>
<spring-cloud-contract-wiremock.version>2.2.4.RELEASE</spring-cloud-contract-wiremock.version>

View File

@ -1,8 +1,8 @@
package com.rbkmoney.claimmanagementapi.converter.party.contract
import com.rbkmoney.claimmanagementapi.converter.DarkApiConverter
import com.rbkmoney.damsel.domain.CountryCode
import com.rbkmoney.damsel.domain.InternationalBankDetails
import com.rbkmoney.damsel.domain.Residence
import com.rbkmoney.swag.claim_management.model.CorrespondentAccount
import com.rbkmoney.swag.claim_management.model.PayoutToolInfo
import org.springframework.stereotype.Component
@ -43,7 +43,7 @@ class InternationalBankAccountConverter :
.setAddress(it.address)
.setBic(it.bic)
.setName(it.name)
.setCountry(Residence.valueOf(it.country))
.setCountry(CountryCode.valueOf(it.country))
)
internationalBankAccount.correspondentAccount = correspondentAccount
}
@ -92,6 +92,6 @@ class InternationalBankAccountConverter :
return swagInternationalBankAccount
}
private fun convertCountryToResidence(country: String?): Residence? =
country?.let { Residence.valueOf(it) }
private fun convertCountryToResidence(country: String?) =
country?.let { CountryCode.valueOf(it) }
}

View File

@ -1,6 +1,8 @@
package com.rbkmoney.claimmanagementapi.converter.party.contractor
import com.rbkmoney.claimmanagementapi.converter.DarkApiConverter
import com.rbkmoney.damsel.domain.CountryCode
import com.rbkmoney.damsel.domain.CountryRef
import org.springframework.stereotype.Component
import com.rbkmoney.damsel.domain.InternationalLegalEntity as ThriftInternationalLegalEntity
import com.rbkmoney.swag.claim_management.model.InternationalLegalEntity as SwagInternationalLegalEntity
@ -19,6 +21,11 @@ class InternationalLegalEntityConverter :
.setRegisteredAddress(value.registeredAddress)
.setRegisteredNumber(value.registeredNumber)
.setTradingName(value.tradingName)
.setCountry(
if (value.country.isNotEmpty())
CountryRef(CountryCode.valueOf(value.country))
else null
)
override fun convertToSwag(
value: ThriftInternationalLegalEntity
@ -29,5 +36,6 @@ class InternationalLegalEntityConverter :
actualAddress = value.actualAddress
registeredAddress = value.registeredAddress
registeredNumber = value.registeredNumber
country = if (value.isSetCountry) value.country.id.name else null
}
}

View File

@ -8,6 +8,7 @@ import com.rbkmoney.claimmanagementapi.converter.party.contractor.InternationalL
import com.rbkmoney.claimmanagementapi.converter.party.contractor.PrivateEntityConverter
import com.rbkmoney.claimmanagementapi.converter.party.contractor.RussianLegalEntityConverter
import com.rbkmoney.damsel.domain.ContractorIdentificationLevel
import com.rbkmoney.damsel.domain.CountryCode
import com.rbkmoney.geck.serializer.kit.mock.MockMode
import com.rbkmoney.geck.serializer.kit.mock.MockTBaseProcessor
import com.rbkmoney.geck.serializer.kit.tbase.TBaseHandler
@ -80,7 +81,10 @@ class ClaimContractorConvertersTest {
val converter = InternationalLegalEntityConverter()
val swagInternationalLegalEntity = EnhancedRandom.random(
SwagInternationalLegalEntity::class.java
).apply { legalEntityType = SwagLegalEntityType.LegalEntityTypeEnum.INTERNATIONALLEGALENTITY }
).apply {
legalEntityType = SwagLegalEntityType.LegalEntityTypeEnum.INTERNATIONALLEGALENTITY
country = CountryCode.GLP.name
}
val resultSwagInternationalLegalEntity = converter.convertToSwag(
converter.convertToThrift(swagInternationalLegalEntity)
)
@ -132,7 +136,10 @@ class ClaimContractorConvertersTest {
}
SwagLegalEntityType.LegalEntityTypeEnum.INTERNATIONALLEGALENTITY -> {
val swagInternationalLegalEntity = EnhancedRandom.random(SwagInternationalLegalEntity::class.java)
.apply { legalEntityType = SwagLegalEntityType.LegalEntityTypeEnum.INTERNATIONALLEGALENTITY }
.apply {
legalEntityType = SwagLegalEntityType.LegalEntityTypeEnum.INTERNATIONALLEGALENTITY
country = CountryCode.EGY.name
}
swagLegalEntity.legalEntityType = swagInternationalLegalEntity
}
else -> throw IllegalArgumentException("Unknown legal entity type!")

View File

@ -1,6 +1,6 @@
package com.rbkmoney.claimmanagementapi.converter.party.data
import com.rbkmoney.damsel.domain.Residence
import com.rbkmoney.damsel.domain.CountryCode
import com.rbkmoney.swag.claim_management.model.ContractModification.ContractModificationTypeEnum
import com.rbkmoney.swag.claim_management.model.ContractPayoutToolModification.PayoutToolModificationTypeEnum
import com.rbkmoney.swag.claim_management.model.PartyModificationType.PartyModificationTypeEnum
@ -35,7 +35,7 @@ object TestContractData {
.setAbaRtn("rtn")
.setAddress("addr")
.setBic("bic123456")
.setCountry(Residence.AGO)
.setCountry(CountryCode.AGO)
.setName("some name")
)
.setCorrespondentAccount(
@ -48,7 +48,7 @@ object TestContractData {
.setAbaRtn("21312")
.setAddress("qweqwe")
.setBic("321321")
.setCountry(Residence.ALB)
.setCountry(CountryCode.ALB)
.setName("aasdasd")
)
)