FINERACT-1183: archive FD and RD products#5967
Conversation
446969d to
6cd7264
Compare
|
@San-43 This PR has nothing to do with: https://issues.apache.org/jira/browse/FINERACT-1315 |
|
@San-43 Can you please explain this PR and update the description + use correct Fineract JIRA ticket (or create new if needed)? |
adamsaghy
left a comment
There was a problem hiding this comment.
Please review my concerns
6cd7264 to
4dd3f2b
Compare
Srry @adamsaghy, I referenced the wrong JIRA ticket. This PR addresses FINERACT-1183. It adds optional validity dates to Fixed Deposit and Recurring Deposit products. Archived products remain visible for administration, but cannot be used for new accounts or reinvestments. Existing accounts remain unaffected. |
2746743 to
35ebe6e
Compare
|
Fixed the failing tests and rebased onto the latest develop. |
|
@San-43 Please rebase the PR to resolve the conflicts. |
35ebe6e to
b6a51fe
Compare
|
@adamsaghy done |
# Conflicts: # fineract-provider/src/main/resources/db/changelog/tenant/changelog-tenant.xml
b6a51fe to
c810e1e
Compare
| @Schema(example = "3") | ||
| public Integer maxDepositTermTypeId; | ||
| @Schema(example = "10000") | ||
| public Long depositAmount; |
There was a problem hiding this comment.
This should be BigDecimal
| validateDepositTermDetailForUpdate(element, baseDataValidator); | ||
|
|
||
| validateChartsData(element, baseDataValidator); | ||
| if (fromApiJsonHelper.parameterExists(chartsParamName, element)) { |
There was a problem hiding this comment.
This condition can be moved into validateChartsData, so the validator will be unified (none of the other validate methods are wrapped in an if condition).
| } | ||
| ExternalId externalId = this.externalIdFactory.create(); | ||
|
|
||
| this.depositAccountAssembler.validateProductApplicationDate(closedDate, account.savingsProduct()); |
There was a problem hiding this comment.
I believe validations should occur as early as possible. Could we move this validator to be executed as one of the initial steps and only begin processing after it has successfully passed?
| sqlBuilder.append("select "); | ||
| sqlBuilder.append(DEPOSIT_PRODUCT_LOOKUP_MAPPER.schema()); | ||
| sqlBuilder.append(" where sp.deposit_type_enum = ? "); | ||
| sqlBuilder.append(" and (sp.close_date is null or sp.close_date >= "); |
There was a problem hiding this comment.
I dont think we should filter them out...
| } | ||
|
|
||
| private void validateDomainRules(final DataValidatorBuilder baseDataValidator) { | ||
| if (getStartDate() != null && getCloseDate() != null && DateUtils.isBefore(getCloseDate(), getStartDate())) { |
There was a problem hiding this comment.
This should be handled in validator, not in JPA entity. Please move this logic out.
Description
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.