FINERACT-2081: Allow loan charge-off via batch api
This commit is contained in:
+1
-1
@@ -65,7 +65,7 @@ public class CreateTransactionByLoanExternalIdCommandStrategy implements Command
|
||||
final List<String> pathParameters = Splitter.on('/').splitToList(relativeUrlWithoutVersion(request));
|
||||
final String loanExternalId = pathParameters.get(2);
|
||||
|
||||
final Pattern commandPattern = Pattern.compile("^?command=[a-zA-Z]+");
|
||||
final Pattern commandPattern = Pattern.compile("^?command=[a-zA-Z\\-]+");
|
||||
final Matcher commandMatcher = commandPattern.matcher(pathParameters.get(3));
|
||||
|
||||
if (!commandMatcher.find()) {
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public class CreateTransactionLoanCommandStrategy implements CommandStrategy {
|
||||
final List<String> pathParameters = Splitter.on('/').splitToList(relativeUrlWithoutVersion(request));
|
||||
final Long loanId = Long.parseLong(pathParameters.get(1));
|
||||
|
||||
final Pattern commandPattern = Pattern.compile("^?command=[a-zA-Z]+");
|
||||
final Pattern commandPattern = Pattern.compile("^?command=[a-zA-Z\\-]+");
|
||||
final Matcher commandMatcher = commandPattern.matcher(pathParameters.get(2));
|
||||
|
||||
if (!commandMatcher.find()) {
|
||||
|
||||
+2
@@ -140,6 +140,8 @@ public class CommandStrategyProviderTest {
|
||||
mock(CreateTransactionLoanCommandStrategy.class)),
|
||||
Arguments.of("loans/123/transactions?command=chargeRefund", HttpMethod.POST, "createTransactionLoanCommandStrategy",
|
||||
mock(CreateTransactionLoanCommandStrategy.class)),
|
||||
Arguments.of("loans/123/transactions?command=charge-off", HttpMethod.POST, "createTransactionLoanCommandStrategy",
|
||||
mock(CreateTransactionLoanCommandStrategy.class)),
|
||||
Arguments.of("loans/123/transactions/123", HttpMethod.POST, "adjustLoanTransactionCommandStrategy",
|
||||
mock(AdjustLoanTransactionCommandStrategy.class)),
|
||||
Arguments.of("loans/123/transactions/123?command=chargeback", HttpMethod.POST, "adjustLoanTransactionCommandStrategy",
|
||||
|
||||
Reference in New Issue
Block a user