Fix type mapping (#47)

This commit is contained in:
Egor Cherniak 2022-08-03 18:52:32 +03:00 committed by GitHub
parent 35fa9e4707
commit f8fa3304e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 15 deletions

16
pom.xml
View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.vality</groupId>
<artifactId>service-parent-pom</artifactId>
<version>1.0.17</version>
<version>1.0.18</version>
</parent>
<artifactId>anapi-v2</artifactId>
@ -43,12 +43,12 @@
<dependency>
<groupId>dev.vality</groupId>
<artifactId>swag-anapi-v2</artifactId>
<version>1.76-ec7a406-server</version>
<version>1.77-89e7ff0-server</version>
</dependency>
<dependency>
<groupId>dev.vality</groupId>
<artifactId>bouncer-proto</artifactId>
<version>1.39-633ba73</version>
<version>1.41-5628c61</version>
</dependency>
<dependency>
<groupId>dev.vality</groupId>
@ -58,7 +58,7 @@
<dependency>
<groupId>dev.vality</groupId>
<artifactId>payout-manager-proto</artifactId>
<version>1.36-063163d</version>
<version>1.38-635dc24</version>
</dependency>
<dependency>
<groupId>dev.vality</groupId>
@ -78,7 +78,7 @@
<dependency>
<groupId>dev.vality</groupId>
<artifactId>reporter-proto</artifactId>
<version>1.16-cc187f5</version>
<version>1.18-d7d9995</version>
</dependency>
<dependency>
<groupId>dev.vality.geck</groupId>
@ -87,7 +87,7 @@
<dependency>
<groupId>dev.vality</groupId>
<artifactId>damsel</artifactId>
<version>1.566-03bbf48</version>
<version>1.568-9362c08</version>
</dependency>
<dependency>
<groupId>dev.vality.woody</groupId>
@ -230,7 +230,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.2</version>
<version>0.2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -268,7 +268,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-wiremock</artifactId>
<version>3.1.1</version>
<version>3.1.3</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -73,7 +73,8 @@ public class StatPaymentToPaymentSearchResultConverter {
return new CustomerPayer()
.customerID(customer.getCustomerId())
.paymentToolDetails(mapPaymentToolDetails(paymentTool))
.paymentToolToken(getPaymentToolToken(paymentTool));
.paymentToolToken(getPaymentToolToken(paymentTool))
.payerType("CustomerPayer");
}
case PAYMENT_RESOURCE -> {
var resource = payer.getPaymentResource();
@ -91,7 +92,8 @@ public class StatPaymentToPaymentSearchResultConverter {
: null)
.contactInfo(new ContactInfo()
.email(contactInfo.getEmail())
.phoneNumber(contactInfo.getPhoneNumber()));
.phoneNumber(contactInfo.getPhoneNumber()))
.payerType("PaymentResourcePayer");
}
case RECURRENT -> {
var recurrent = payer.getRecurrent();
@ -105,7 +107,8 @@ public class StatPaymentToPaymentSearchResultConverter {
.phoneNumber(contactInfo.getPhoneNumber()))
.recurrentParentPayment(new PaymentRecurrentParent()
.paymentID(recurrent.getRecurrentParent().getPaymentId())
.invoiceID(recurrent.getRecurrentParent().getInvoiceId()));
.invoiceID(recurrent.getRecurrentParent().getInvoiceId()))
.payerType("RecurrentPayer");
}
default -> throw new IllegalArgumentException();
}
@ -133,22 +136,26 @@ public class StatPaymentToPaymentSearchResultConverter {
.paymentSystem(getPaymentSystem(card))
.cardNumberMask(MaskUtil.constructCardNumber(card))
.lastDigits(card.getLastDigits())
.tokenProvider(getTokenProvider(card));
.tokenProvider(getTokenProvider(card))
.detailsType("PaymentToolDetailsBankCard");
}
case PAYMENT_TERMINAL -> {
var terminal = paymentTool.getPaymentTerminal();
return new PaymentToolDetailsPaymentTerminal()
.provider(getProvider(terminal));
.provider(getProvider(terminal))
.detailsType("PaymentToolDetailsPaymentTerminal");
}
case MOBILE_COMMERCE -> {
var mobile = paymentTool.getMobileCommerce();
return new PaymentToolDetailsMobileCommerce()
.phoneNumber(MaskUtil.constructPhoneNumber(mobile.getPhone()));
.phoneNumber(MaskUtil.constructPhoneNumber(mobile.getPhone()))
.detailsType("PaymentToolDetailsMobileCommerce");
}
case CRYPTO_CURRENCY -> {
var cryptoCurrency = paymentTool.getCryptoCurrency();
return new PaymentToolDetailsCryptoWallet()
.cryptoCurrency(cryptoCurrency.getId());
.cryptoCurrency(cryptoCurrency.getId())
.detailsType("PaymentToolDetailsCryptoWallet");
}
default -> throw new IllegalArgumentException();
}