Skip to content

Commit 737f3e1

Browse files
authored
Merge pull request #5764
FINERACT-2587: Remove CLIENTCHARGE|INACTIVATE write path (never implemented since 2015)
2 parents 53269ba + 49d94eb commit 737f3e1

9 files changed

Lines changed: 36 additions & 32 deletions

File tree

fineract-core/src/main/java/org/apache/fineract/commands/service/CommandWrapperBuilder.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,15 +3170,6 @@ public CommandWrapperBuilder payClientCharge(final Long clientId, final Long cha
31703170
return this;
31713171
}
31723172

3173-
public CommandWrapperBuilder inactivateClientCharge(final Long clientId, final Long chargeId) {
3174-
this.actionName = ACTION_INACTIVATE;
3175-
this.entityName = ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME;
3176-
this.entityId = chargeId;
3177-
this.clientId = clientId;
3178-
this.href = "/clients/" + clientId + "/charges/" + chargeId + "?command=inactivate";
3179-
return this;
3180-
}
3181-
31823173
public CommandWrapperBuilder undoClientTransaction(final Long clientId, final Long transactionId) {
31833174
this.actionName = ClientApiConstants.CLIENT_TRANSACTION_ACTION_UNDO;
31843175
this.entityName = ClientApiConstants.CLIENT_RESOURCE_NAME;

fineract-core/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public class ClientApiConstants {
3333
public static final String CLIENT_CHARGE_ACTION_DELETE = "DELETE";
3434
public static final String CLIENT_CHARGE_ACTION_WAIVE = "WAIVE";
3535
public static final String CLIENT_CHARGE_ACTION_PAY = "PAY";
36-
public static final String CLIENT_CHARGE_ACTION_INACTIVATE = "INACTIVATE";
3736

3837
// Client charge associations and query parameters
3938
public static final String CLIENT_CHARGE_QUERY_PARAM_STATUS = "chargeStatus";
@@ -49,7 +48,6 @@ public class ClientApiConstants {
4948
// Commands
5049
public static final String CLIENT_CHARGE_COMMAND_WAIVE_CHARGE = "waive";
5150
public static final String CLIENT_CHARGE_COMMAND_PAY_CHARGE = "paycharge";
52-
public static final String CLIENT_CHARGE_COMMAND_INACTIVATE_CHARGE = "inactivate";
5351
public static final String CLIENT_TRANSACTION_COMMAND_UNDO = "undo";
5452

5553
public static final String CLIENT_CLOSURE_REASON = "ClientClosureReason";

fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientChargesApiResource.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,10 @@ public String payOrWaiveClientCharge(@PathParam("clientId") @Parameter(descripti
205205

206206
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
207207

208-
json = this.toApiJsonSerializer.serialize(result);
209-
} else if (is(commandParam, ClientApiConstants.CLIENT_CHARGE_COMMAND_INACTIVATE_CHARGE)) {
210-
final CommandWrapper commandRequest = new CommandWrapperBuilder().inactivateClientCharge(clientId, chargeId).build();
211-
212-
final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
213-
214208
json = this.toApiJsonSerializer.serialize(result);
215209
} else {
216210
throw new UnrecognizedQueryParamException("command", commandParam, ClientApiConstants.CLIENT_CHARGE_COMMAND_WAIVE_CHARGE,
217-
ClientApiConstants.CLIENT_CHARGE_COMMAND_PAY_CHARGE, ClientApiConstants.CLIENT_CHARGE_COMMAND_INACTIVATE_CHARGE);
211+
ClientApiConstants.CLIENT_CHARGE_COMMAND_PAY_CHARGE);
218212
}
219213

220214
return json;

fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformService.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,4 @@ public interface ClientChargeWritePlatformService {
3939
@Transactional
4040
CommandProcessingResult payCharge(Long clientId, Long clientChargeId, JsonCommand command);
4141

42-
@Transactional
43-
CommandProcessingResult inactivateCharge(Long clientId, Long clientChargeId);
44-
4542
}

fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientChargeWritePlatformServiceImpl.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,6 @@ public CommandProcessingResult updateCharge(@SuppressWarnings("unused") Long cli
355355
return null;
356356
}
357357

358-
@Override
359-
@SuppressWarnings("unused")
360-
public CommandProcessingResult inactivateCharge(Long clientId, Long clientChargeId) {
361-
// functionality not yet supported
362-
return null;
363-
}
364-
365358
/**
366359
* Ensures that the charge due date is not on a holiday or a non working day
367360
*

fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,5 @@
249249
<include file="parts/0228_add_configuration_block_transactions_on_closed_overpaid_loans.xml" relativeToChangelogFile="true" />
250250
<include file="parts/0229_trial_balance_summary_fix_empty_space.xml" relativeToChangelogFile="true" />
251251
<include file="parts/0230_add_forgot_password.xml" relativeToChangelogFile="true" />
252+
<include file="parts/0231_remove_clientcharge_inactivate_permissions.xml" relativeToChangelogFile="true" />
252253
</databaseChangeLog>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
23+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
25+
<changeSet author="ashharahmadkhan" id="1">
26+
<comment>Remove INACTIVATE_CLIENTCHARGE permissions - command was never implemented and the client-charge inactivate write path is being removed.</comment>
27+
<delete tableName="m_permission">
28+
<where>code='INACTIVATE_CLIENTCHARGE'</where>
29+
</delete>
30+
<delete tableName="m_permission">
31+
<where>code='INACTIVATE_CLIENTCHARGE_CHECKER'</where>
32+
</delete>
33+
</changeSet>
34+
</databaseChangeLog>

fineract-provider/src/main/resources/sql/migrations/sample_data/barebones_db.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3738,13 +3738,11 @@ INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_nam
37383738
(668, 'portfolio', 'DELETE_CLIENTCHARGE', 'CLIENTCHARGE', 'DELETE', 0),
37393739
(669, 'portfolio', 'WAIVE_CLIENTCHARGE', 'CLIENTCHARGE', 'WAIVE', 0),
37403740
(670, 'portfolio', 'PAY_CLIENTCHARGE', 'CLIENTCHARGE', 'PAY', 0),
3741-
(671, 'portfolio', 'INACTIVATE_CLIENTCHARGE', 'CLIENTCHARGE', 'INACTIVATE', 0),
37423741
(672, 'portfolio', 'UPDATE_CLIENTCHARGE', 'CLIENTCHARGE', 'UPDATE', 0),
37433742
(673, 'portfolio', 'CREATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'CREATE_CHECKER', 0),
37443743
(674, 'portfolio', 'DELETE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'DELETE_CHECKER', 0),
37453744
(675, 'portfolio', 'WAIVE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'WAIVE_CHECKER', 0),
37463745
(676, 'portfolio', 'PAY_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'PAY_CHECKER', 0),
3747-
(677, 'portfolio', 'INACTIVATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'INACTIVATE_CHECKER', 0),
37483746
(678, 'portfolio', 'UPDATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'UPDATE_CHECKER', 0),
37493747
(679, 'transaction_client', 'READTRANSACTION_CLIENT', 'CLIENT', 'READTRANSACTION', 0),
37503748
(680, 'transaction_client', 'UNDOTRANSACTION_CLIENT', 'CLIENT', 'UNDOTRANSACTION', 0),

fineract-provider/src/main/resources/sql/migrations/sample_data/load_sample_data.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3910,13 +3910,11 @@ INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_nam
39103910
(668, 'portfolio', 'DELETE_CLIENTCHARGE', 'CLIENTCHARGE', 'DELETE', 0),
39113911
(669, 'portfolio', 'WAIVE_CLIENTCHARGE', 'CLIENTCHARGE', 'WAIVE', 0),
39123912
(670, 'portfolio', 'PAY_CLIENTCHARGE', 'CLIENTCHARGE', 'PAY', 0),
3913-
(671, 'portfolio', 'INACTIVATE_CLIENTCHARGE', 'CLIENTCHARGE', 'INACTIVATE', 0),
39143913
(672, 'portfolio', 'UPDATE_CLIENTCHARGE', 'CLIENTCHARGE', 'UPDATE', 0),
39153914
(673, 'portfolio', 'CREATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'CREATE_CHECKER', 0),
39163915
(674, 'portfolio', 'DELETE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'DELETE_CHECKER', 0),
39173916
(675, 'portfolio', 'WAIVE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'WAIVE_CHECKER', 0),
39183917
(676, 'portfolio', 'PAY_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'PAY_CHECKER', 0),
3919-
(677, 'portfolio', 'INACTIVATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'INACTIVATE_CHECKER', 0),
39203918
(678, 'portfolio', 'UPDATE_CLIENTCHARGE_CHECKER', 'CLIENTCHARGE', 'UPDATE_CHECKER', 0),
39213919
(679, 'transaction_client', 'READTRANSACTION_CLIENT', 'CLIENT', 'READTRANSACTION', 0),
39223920
(680, 'transaction_client', 'UNDOTRANSACTION_CLIENT', 'CLIENT', 'UNDOTRANSACTION', 0),

0 commit comments

Comments
 (0)