Repository: fineract Updated Branches: refs/heads/develop 781689c8d -> 6711a145a
http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java index d5c5c12..12de527 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java @@ -121,6 +121,9 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom<L @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch=FetchType.EAGER) @JoinColumn(name = "savings_transaction_id", referencedColumnName = "id", nullable = false) private List<SavingsAccountTransactionTaxDetails> taxDetails = new ArrayList<>(); + + @Column(name = "release_id_of_hold_amount", length = 20) + private Long releaseIdOfHoldAmountTransaction; protected SavingsAccountTransaction() { this.dateOf = null; @@ -289,6 +292,21 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom<L this.appUser = appUser; this.isManualTransaction = isManualTransaction; } + + public static SavingsAccountTransaction holdAmount(final SavingsAccount savingsAccount, final Office office, + final PaymentDetail paymentDetail, final LocalDate date, final Money amount, Date createdDate, final AppUser appUser) { + final boolean isReversed = false; + final boolean isManualTransaction = false; + return new SavingsAccountTransaction(savingsAccount, office, paymentDetail, SavingsAccountTransactionType.AMOUNT_HOLD.getValue(), + date, createdDate, amount, isReversed, appUser, isManualTransaction); + } + + public static SavingsAccountTransaction releaseAmount(SavingsAccountTransaction accountTransaction,LocalDate transactionDate, Date createdDate, + final AppUser appUser) { + return new SavingsAccountTransaction(accountTransaction.savingsAccount, accountTransaction.office, accountTransaction.paymentDetail, + SavingsAccountTransactionType.AMOUNT_RELEASE.getValue(),transactionDate , createdDate, + accountTransaction.amount, accountTransaction.reversed, appUser, accountTransaction.isManualTransaction); + } public LocalDate transactionLocalDate() { return new LocalDate(this.dateOf); @@ -640,6 +658,14 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom<L public boolean isWaiveCharge() { return SavingsAccountTransactionType.fromInt(this.typeOf).isWaiveCharge(); } + + public boolean isAmountOnHold() { + return SavingsAccountTransactionType.fromInt(this.typeOf).isAmountOnHold(); + } + + public boolean isAmountRelease() { + return SavingsAccountTransactionType.fromInt(this.typeOf).isAmountRelease(); + } private boolean canOverriteSavingAccountRules() { final SavingsAccountChargePaidBy chargePaidBy = getSavingsAccountChargePaidBy(); @@ -753,4 +779,12 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom<L public PaymentDetail getPaymentDetail() { return this.paymentDetail ; } + + public void updateReleaseId(Long releaseId) { + this.releaseIdOfHoldAmountTransaction = releaseId; + } + + public Long getReleaseIdOfHoldAmountTransaction() { + return this.releaseIdOfHoldAmountTransaction; + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountBlockedException.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountBlockedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountBlockedException.java new file mode 100644 index 0000000..50f7d41 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountBlockedException.java @@ -0,0 +1,29 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.exception; + +import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; + +public class SavingsAccountBlockedException extends AbstractPlatformDomainRuleException { + + public SavingsAccountBlockedException(final Long accountId) { + super("error.msg.saving.account.blocked.transaction.not.allowed", + "Any transaction to " + accountId + " is not allowed, since the account is blocked", accountId); + } +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountCreditsBlockedException.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountCreditsBlockedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountCreditsBlockedException.java new file mode 100644 index 0000000..d54cb87 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountCreditsBlockedException.java @@ -0,0 +1,29 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.exception; + +import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; + +public class SavingsAccountCreditsBlockedException extends AbstractPlatformDomainRuleException { + + public SavingsAccountCreditsBlockedException(final Long accountId) { + super("error.msg.savings.account.credit.transaction.not.allowed", + "Any Credit transactions to " + accountId + " is not allowed, since the account is blocked for credits", accountId); + } +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountDebitsBlockedException.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountDebitsBlockedException.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountDebitsBlockedException.java new file mode 100644 index 0000000..8a2903b --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/exception/SavingsAccountDebitsBlockedException.java @@ -0,0 +1,30 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.exception; + +import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException; + +public class SavingsAccountDebitsBlockedException extends AbstractPlatformDomainRuleException { + + public SavingsAccountDebitsBlockedException(final Long accountId) { + super("error.msg.savings.account.debit.transaction.not.allowed", + "Any debit transactions from " + accountId + " is not allowed, since the account is blocked for debits", accountId); + } + +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockCreditsToSavingsAccountCommandHandler.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockCreditsToSavingsAccountCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockCreditsToSavingsAccountCommandHandler.java new file mode 100644 index 0000000..2c483f6 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockCreditsToSavingsAccountCommandHandler.java @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@CommandType(entity = "SAVINGSACCOUNT", action = "BLOCKCREDIT") +public class BlockCreditsToSavingsAccountCommandHandler implements NewCommandSourceHandler { + + private final SavingsAccountWritePlatformService writePlatformService; + + @Autowired + public BlockCreditsToSavingsAccountCommandHandler(final SavingsAccountWritePlatformService savingAccountWritePlatformService) { + this.writePlatformService = savingAccountWritePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(JsonCommand command) { + return this.writePlatformService.blockCredits(command.getSavingsId()); + } + +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockDebitsFromSavingsAccountCommandHandler.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockDebitsFromSavingsAccountCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockDebitsFromSavingsAccountCommandHandler.java new file mode 100644 index 0000000..15bbf50 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockDebitsFromSavingsAccountCommandHandler.java @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@CommandType(entity = "SAVINGSACCOUNT", action = "BLOCKDEBIT") +public class BlockDebitsFromSavingsAccountCommandHandler implements NewCommandSourceHandler { + + private final SavingsAccountWritePlatformService writePlatformService; + + @Autowired + public BlockDebitsFromSavingsAccountCommandHandler(final SavingsAccountWritePlatformService savingAccountWritePlatformService) { + this.writePlatformService = savingAccountWritePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(JsonCommand command) { + return this.writePlatformService.blockDebits(command.getSavingsId()); + } + +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockSavingsAccountCommandHandler.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockSavingsAccountCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockSavingsAccountCommandHandler.java new file mode 100644 index 0000000..6001c66 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/BlockSavingsAccountCommandHandler.java @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@CommandType(entity = "SAVINGSACCOUNT", action = "BLOCK") +public class BlockSavingsAccountCommandHandler implements NewCommandSourceHandler { + + private final SavingsAccountWritePlatformService writePlatformService; + + @Autowired + public BlockSavingsAccountCommandHandler(final SavingsAccountWritePlatformService savingAccountWritePlatformService) { + this.writePlatformService = savingAccountWritePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(JsonCommand command) { + return this.writePlatformService.blockAccount(command.getSavingsId()); + } + +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/HoldAmountSavingsAccountCommandHandler.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/HoldAmountSavingsAccountCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/HoldAmountSavingsAccountCommandHandler.java new file mode 100644 index 0000000..c2291eb --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/HoldAmountSavingsAccountCommandHandler.java @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@CommandType(entity = "SAVINGSACCOUNT", action = "HOLDAMOUNT") +public class HoldAmountSavingsAccountCommandHandler implements NewCommandSourceHandler { + + private final SavingsAccountWritePlatformService writePlatformService; + + @Autowired + public HoldAmountSavingsAccountCommandHandler(final SavingsAccountWritePlatformService savingAccountWritePlatformService) { + this.writePlatformService = savingAccountWritePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(JsonCommand command) { + return this.writePlatformService.holdAmount(command.getSavingsId(), command); + } + +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/ReleaseAmountSavingsAccountCommandHandler.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/ReleaseAmountSavingsAccountCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/ReleaseAmountSavingsAccountCommandHandler.java new file mode 100644 index 0000000..876f977 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/ReleaseAmountSavingsAccountCommandHandler.java @@ -0,0 +1,48 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@CommandType(entity = "SAVINGSACCOUNT", action = "RELEASEAMOUNT") +public class ReleaseAmountSavingsAccountCommandHandler implements NewCommandSourceHandler { + + private final SavingsAccountWritePlatformService writePlatformService; + + @Autowired + public ReleaseAmountSavingsAccountCommandHandler(final SavingsAccountWritePlatformService savingAccountWritePlatformService) { + this.writePlatformService = savingAccountWritePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(JsonCommand command) { + final Long transactionId = Long.valueOf(command.getTransactionId()); + return this.writePlatformService.releaseAmount(command.getSavingsId(), transactionId); + } + +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockCreditsToSavingsAccountCommandHandler.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockCreditsToSavingsAccountCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockCreditsToSavingsAccountCommandHandler.java new file mode 100644 index 0000000..0985cc5 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockCreditsToSavingsAccountCommandHandler.java @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@CommandType(entity = "SAVINGSACCOUNT", action = "UNBLOCKCREDIT") +public class UnblockCreditsToSavingsAccountCommandHandler implements NewCommandSourceHandler { + + private final SavingsAccountWritePlatformService writePlatformService; + + @Autowired + public UnblockCreditsToSavingsAccountCommandHandler(final SavingsAccountWritePlatformService savingAccountWritePlatformService) { + this.writePlatformService = savingAccountWritePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(JsonCommand command) { + return this.writePlatformService.unblockCredits(command.getSavingsId()); + } + +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockDebitsFromSavingsAccountCommandHandler.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockDebitsFromSavingsAccountCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockDebitsFromSavingsAccountCommandHandler.java new file mode 100644 index 0000000..8f7b0fc --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockDebitsFromSavingsAccountCommandHandler.java @@ -0,0 +1,46 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@CommandType(entity = "SAVINGSACCOUNT", action = "UNBLOCKDEBIT") +public class UnblockDebitsFromSavingsAccountCommandHandler implements NewCommandSourceHandler { + + private final SavingsAccountWritePlatformService writePlatformService; + + @Autowired + public UnblockDebitsFromSavingsAccountCommandHandler(final SavingsAccountWritePlatformService savingAccountWritePlatformService) { + this.writePlatformService = savingAccountWritePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(JsonCommand command) { + return this.writePlatformService.unblockDebits(command.getSavingsId()); + } +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockSavingsAccountCommandHandler.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockSavingsAccountCommandHandler.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockSavingsAccountCommandHandler.java new file mode 100644 index 0000000..7db7496 --- /dev/null +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/handler/UnblockSavingsAccountCommandHandler.java @@ -0,0 +1,46 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.savings.handler; + +import org.apache.fineract.commands.annotation.CommandType; +import org.apache.fineract.commands.handler.NewCommandSourceHandler; +import org.apache.fineract.infrastructure.core.api.JsonCommand; +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult; +import org.apache.fineract.portfolio.savings.service.SavingsAccountWritePlatformService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +@CommandType(entity = "SAVINGSACCOUNT", action = "UNBLOCK") +public class UnblockSavingsAccountCommandHandler implements NewCommandSourceHandler { + + private final SavingsAccountWritePlatformService writePlatformService; + + @Autowired + public UnblockSavingsAccountCommandHandler(final SavingsAccountWritePlatformService savingAccountWritePlatformService) { + this.writePlatformService = savingAccountWritePlatformService; + } + + @Transactional + @Override + public CommandProcessingResult processCommand(JsonCommand command) { + return this.writePlatformService.unblockAccount(command.getSavingsId()); + } +} http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java index 3df1138..011256a 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/DepositAccountReadPlatformServiceImpl.java @@ -738,9 +738,10 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead taxGroupData = TaxGroupData.lookup(taxGroupId, taxGroupName); } + final BigDecimal availableBalance = null; final SavingsAccountSummaryData summary = new SavingsAccountSummaryData(currency, totalDeposits, totalWithdrawals, totalWithdrawalFees, totalAnnualFees, totalInterestEarned, totalInterestPosted, accountBalance, totalFeeCharge, - totalPenaltyCharge, totalOverdraftInterestDerived, totalWithholdTax, null, null); + totalPenaltyCharge, totalOverdraftInterestDerived, totalWithholdTax, null, null, availableBalance); return DepositAccountData.instance(id, accountNo, externalId, groupId, groupName, clientId, clientName, productId, productName, fieldOfficerId, fieldOfficerName, status, timeline, currency, nominalAnnualInterestRate, interestCompoundingPeriodType, http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java index 16e0c19..1b68e3f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java @@ -511,6 +511,12 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead "minBalanceForInterestCalculation"); final BigDecimal onHoldFunds = rs.getBigDecimal("onHoldFunds"); + BigDecimal availableBalance = accountBalance; + if (availableBalance != null && onHoldFunds != null) { + + availableBalance = availableBalance.subtract(onHoldFunds); + } + BigDecimal interestNotPosted = BigDecimal.ZERO; LocalDate lastInterestCalculationDate = null; if(totalInterestEarned != null){ @@ -520,7 +526,7 @@ public class SavingsAccountReadPlatformServiceImpl implements SavingsAccountRead final SavingsAccountSummaryData summary = new SavingsAccountSummaryData(currency, totalDeposits, totalWithdrawals, totalWithdrawalFees, totalAnnualFees, totalInterestEarned, totalInterestPosted, accountBalance, totalFeeCharge, - totalPenaltyCharge, totalOverdraftInterestDerived, totalWithholdTax, interestNotPosted, lastInterestCalculationDate); + totalPenaltyCharge, totalOverdraftInterestDerived, totalWithholdTax, interestNotPosted, lastInterestCalculationDate, availableBalance); final boolean withHoldTax = rs.getBoolean("withHoldTax"); final Long taxGroupId = JdbcSupport.getLong(rs, "taxGroupId"); http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformService.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformService.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformService.java index 51e5383..d23e09d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformService.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformService.java @@ -88,4 +88,20 @@ public interface SavingsAccountWritePlatformService { CommandProcessingResult postInterest(JsonCommand command); void postInterest(SavingsAccount account, boolean postInterestAs, LocalDate transactionDate); + + CommandProcessingResult blockAccount(Long savingsId); + + CommandProcessingResult unblockAccount(Long savingsId); + + CommandProcessingResult holdAmount(Long savingsId, JsonCommand command); + + CommandProcessingResult blockCredits(Long savingsId); + + CommandProcessingResult unblockCredits(Long savingsId); + + CommandProcessingResult blockDebits(Long savingsId); + + CommandProcessingResult unblockDebits(Long savingsId); + + CommandProcessingResult releaseAmount(Long savingsId, Long transactionId); } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java index 8b3aa1d..f9e52b2 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountWritePlatformServiceJpaRepositoryImpl.java @@ -1339,4 +1339,141 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi map.put(entityEvent, entity); return map; } + + @Override + public CommandProcessingResult blockAccount(final Long savingsId) { + + this.context.authenticatedUser(); + + final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); + checkClientOrGroupActive(account); + + final Map<String, Object> changes = account.block(); + if (!changes.isEmpty()) { + + this.savingAccountRepositoryWrapper.save(account); + } + return new CommandProcessingResultBuilder().withEntityId(savingsId).withOfficeId(account.officeId()) + .withClientId(account.clientId()).withGroupId(account.groupId()).withSavingsId(savingsId).with(changes).build(); + } + + @Override + public CommandProcessingResult unblockAccount(final Long savingsId) { + this.context.authenticatedUser(); + + final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); + checkClientOrGroupActive(account); + + final Map<String, Object> changes = account.unblock(); + if (!changes.isEmpty()) { + + this.savingAccountRepositoryWrapper.save(account); + } + return new CommandProcessingResultBuilder().withEntityId(savingsId).withOfficeId(account.officeId()) + .withClientId(account.clientId()).withGroupId(account.groupId()).withSavingsId(savingsId).with(changes).build(); + } + + @Transactional + @Override + public CommandProcessingResult holdAmount(final Long savingsId, final JsonCommand command) { + + final AppUser submittedBy = this.context.authenticatedUser(); + final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); + checkClientOrGroupActive(account); + + SavingsAccountTransaction transacton = this.savingsAccountTransactionDataValidator.validateHoldAndAssembleForm(command.json(), + account, submittedBy); + + this.savingsAccountTransactionRepository.save(transacton); + this.savingAccountRepositoryWrapper.saveAndFlush(account); + + return new CommandProcessingResultBuilder().withEntityId(transacton.getId()).withOfficeId(account.officeId()) + .withClientId(account.clientId()).withGroupId(account.groupId()).withSavingsId(savingsId).build(); + } + + @Transactional + @Override + public CommandProcessingResult releaseAmount(final Long savingsId, final Long savingsTransactionId) { + + final AppUser submittedBy = this.context.authenticatedUser(); + SavingsAccountTransaction holdTransaction = this.savingsAccountTransactionRepository + .findOneByIdAndSavingsAccountId(savingsTransactionId, savingsId); + + final SavingsAccountTransaction transaction = this.savingsAccountTransactionDataValidator + .validateReleaseAmountAndAssembleForm(holdTransaction, submittedBy); + final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); + checkClientOrGroupActive(account); + account.releaseFunds(transaction.getAmount()); + + this.savingsAccountTransactionRepository.save(transaction); + holdTransaction.updateReleaseId(transaction.getId()); + this.savingAccountRepositoryWrapper.save(account); + + return new CommandProcessingResultBuilder().withEntityId(transaction.getId()).withOfficeId(account.officeId()) + .withClientId(account.clientId()).withGroupId(account.groupId()).withSavingsId(account.getId()).build(); + } + + @Override + public CommandProcessingResult blockCredits(final Long savingsId) { + this.context.authenticatedUser(); + + final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); + checkClientOrGroupActive(account); + + final Map<String, Object> changes = account.blockCredits(account.getSubStatus()); + if (!changes.isEmpty()) { + + this.savingAccountRepositoryWrapper.save(account); + } + return new CommandProcessingResultBuilder().withEntityId(savingsId).withOfficeId(account.officeId()) + .withClientId(account.clientId()).withGroupId(account.groupId()).withSavingsId(savingsId).with(changes).build(); + } + + @Override + public CommandProcessingResult unblockCredits(final Long savingsId) { + this.context.authenticatedUser(); + + final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); + checkClientOrGroupActive(account); + + final Map<String, Object> changes = account.unblockCredits(); + if (!changes.isEmpty()) { + + this.savingAccountRepositoryWrapper.save(account); + } + return new CommandProcessingResultBuilder().withEntityId(savingsId).withOfficeId(account.officeId()) + .withClientId(account.clientId()).withGroupId(account.groupId()).withSavingsId(savingsId).with(changes).build(); + } + + @Override + public CommandProcessingResult blockDebits(final Long savingsId) { + this.context.authenticatedUser(); + + final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); + checkClientOrGroupActive(account); + + final Map<String, Object> changes = account.blockDebits(account.getSubStatus()); + if (!changes.isEmpty()) { + + this.savingAccountRepositoryWrapper.save(account); + } + return new CommandProcessingResultBuilder().withEntityId(savingsId).withOfficeId(account.officeId()) + .withClientId(account.clientId()).withGroupId(account.groupId()).withSavingsId(savingsId).with(changes).build(); + } + + @Override + public CommandProcessingResult unblockDebits(final Long savingsId) { + this.context.authenticatedUser(); + + final SavingsAccount account = this.savingAccountAssembler.assembleFrom(savingsId); + checkClientOrGroupActive(account); + + final Map<String, Object> changes = account.unblockDebits(); + if (!changes.isEmpty()) { + + this.savingAccountRepositoryWrapper.save(account); + } + return new CommandProcessingResultBuilder().withEntityId(savingsId).withOfficeId(account.officeId()) + .withClientId(account.clientId()).withGroupId(account.groupId()).withSavingsId(savingsId).with(changes).build(); + } } http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsEnumerations.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsEnumerations.java index 9bc4566..d74e4a8 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsEnumerations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsEnumerations.java @@ -193,6 +193,14 @@ public class SavingsEnumerations { optionData = new SavingsAccountTransactionEnumData(SavingsAccountTransactionType.ESCHEAT.getValue().longValue(), SavingsAccountTransactionType.ESCHEAT.getCode(), "Escheat"); break; + case AMOUNT_HOLD: + optionData = new SavingsAccountTransactionEnumData(SavingsAccountTransactionType.AMOUNT_HOLD.getValue().longValue(), + SavingsAccountTransactionType.AMOUNT_HOLD.getCode(), "Amount on hold"); + break; + case AMOUNT_RELEASE: + optionData = new SavingsAccountTransactionEnumData(SavingsAccountTransactionType.AMOUNT_RELEASE.getValue().longValue(), + SavingsAccountTransactionType.AMOUNT_RELEASE.getCode(), "Release Amount"); + break; } return optionData; } @@ -294,22 +302,37 @@ public class SavingsEnumerations { final boolean inactive = type.isSubStatusInactive(); final boolean dormant = type.isSubStatusDormant(); final boolean escheat = type.isSubStatusEscheat(); + final boolean block = type.isSubStatusAccountBlocked(); + final boolean blockCredit = type.isSubStatusCreditBlocked(); + final boolean blockDebit = type.isSubStatusDebitBlocked(); SavingsAccountSubStatusEnumData optionData = new SavingsAccountSubStatusEnumData(SavingsAccountSubStatusEnum.NONE.getValue().longValue(), - SavingsAccountSubStatusEnum.NONE.getCode(), "None", true, inactive, dormant, escheat); + SavingsAccountSubStatusEnum.NONE.getCode(), "None", true, inactive, dormant, escheat, block, blockCredit, blockDebit); switch (type) { case INACTIVE: optionData = new SavingsAccountSubStatusEnumData(SavingsAccountSubStatusEnum.INACTIVE.getValue().longValue(), - SavingsAccountSubStatusEnum.INACTIVE.getCode(), "Inactive", none, inactive, dormant, escheat); + SavingsAccountSubStatusEnum.INACTIVE.getCode(), "Inactive", none, inactive, dormant, escheat, block, blockCredit, blockDebit); break; case DORMANT: optionData = new SavingsAccountSubStatusEnumData(SavingsAccountSubStatusEnum.DORMANT.getValue().longValue(), - SavingsAccountSubStatusEnum.DORMANT.getCode(), "Dormant", none, inactive, dormant, escheat); + SavingsAccountSubStatusEnum.DORMANT.getCode(), "Dormant", none, inactive, dormant, escheat, block, blockCredit, blockDebit); break; case ESCHEAT: optionData = new SavingsAccountSubStatusEnumData(SavingsAccountSubStatusEnum.ESCHEAT.getValue().longValue(), - SavingsAccountSubStatusEnum.ESCHEAT.getCode(), "Escheat", none, inactive, dormant, escheat); + SavingsAccountSubStatusEnum.ESCHEAT.getCode(), "Escheat", none, inactive, dormant, escheat, block, blockCredit, blockDebit); + break; + case BLOCK: + optionData = new SavingsAccountSubStatusEnumData(SavingsAccountSubStatusEnum.BLOCK.getValue().longValue(), + SavingsAccountSubStatusEnum.BLOCK.getCode(), "Block", none, inactive, dormant, escheat, block, blockCredit, blockDebit); + break; + case BLOCK_CREDIT: + optionData = new SavingsAccountSubStatusEnumData(SavingsAccountSubStatusEnum.BLOCK_CREDIT.getValue().longValue(), + SavingsAccountSubStatusEnum.BLOCK_CREDIT.getCode(), "BlockCredit", none, inactive, dormant, escheat, block, blockCredit, blockDebit); + break; + case BLOCK_DEBIT: + optionData = new SavingsAccountSubStatusEnumData(SavingsAccountSubStatusEnum.BLOCK_DEBIT.getValue().longValue(), + SavingsAccountSubStatusEnum.BLOCK_DEBIT.getCode(), "BlockDebit", none, inactive, dormant, escheat, block, blockCredit, blockDebit); break; default: break; http://git-wip-us.apache.org/repos/asf/fineract/blob/fe3741c2/fineract-provider/src/main/resources/sql/migrations/core_db/V329__savings_account_transaction_releaseId.sql ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V329__savings_account_transaction_releaseId.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V329__savings_account_transaction_releaseId.sql new file mode 100644 index 0000000..cf9e24c --- /dev/null +++ b/fineract-provider/src/main/resources/sql/migrations/core_db/V329__savings_account_transaction_releaseId.sql @@ -0,0 +1,44 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. +-- + + -- permissions +INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES +('transaction_savings', 'HOLDAMOUNT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'HOLDAMOUNT', 0), +('transaction_savings', 'HOLDAMOUNT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'HOLDAMOUNT_CHECKER', 0), +('transaction_savings', 'BLOCKDEBIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'BLOCKDEBIT', 0), +('transaction_savings', 'BLOCKDEBIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'BLOCKDEBIT_CHECKER', 0), +('transaction_savings', 'UNBLOCKDEBIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UNBLOCKDEBIT', 0), +('transaction_savings', 'UNBLOCKDEBIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UNBLOCKDEBIT_CHECKER', 0), +('transaction_savings', 'BLOCKCREDIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'BLOCKCREDIT', 0), +('transaction_savings', 'BLOCKCREDIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'BLOCKCREDIT_CHECKER', 0), +('transaction_savings', 'UNBLOCKCREDIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UNBLOCKCREDIT', 0), +('transaction_savings', 'UNBLOCKCREDIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UNBLOCKCREDIT_CHECKER', 0), +('transaction_savings', 'BLOCK_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'BLOCK', 0), +('transaction_savings', 'BLOCK_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'BLOCK_CHECKER', 0), +('transaction_savings', 'UNBLOCK_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UNBLOCK', 0), +('transaction_savings', 'UNBLOCK_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UNBLOCK_CHECKER', 0), +('transaction_savings', 'RELEASEAMOUNT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'RELEASEAMOUNT', 0), +('transaction_savings', 'RELEASEAMOUNT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'RELEASEAMOUNT_CHECKER', 0); + +-- modify `m_savings_account_transaction` + +ALTER TABLE `m_savings_account_transaction` ADD COLUMN `release_id_of_hold_amount` BIGINT(20) NULL DEFAULT NULL; + + +