You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "mariiaKraievska (via GitHub)" <gi...@apache.org> on 2025/08/28 14:01:10 UTC
[PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
mariiaKraievska opened a new pull request, #4992:
URL: https://github.com/apache/fineract/pull/4992
## Description
Describe the changes made and why they were made.
Ignore if these details are present on the associated [Apache Fineract JIRA ticket](https://github.com/apache/fineract/pull/1284).
## Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
- [ ] Write the commit message as per https://github.com/apache/fineract/#pull-requests
- [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
- [ ] Create/update unit or integration tests for verifying the changes made.
- [ ] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
- [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
- [ ] Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.)
FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2315447413
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAmortizationAllocationServiceImpl.java:
##########
@@ -0,0 +1,149 @@
+/**
+ * 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.loanaccount.service;
+
+import java.math.BigDecimal;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
+import org.apache.fineract.portfolio.loanaccount.data.LoanAmortizationAllocationData;
+import org.apache.fineract.portfolio.loanaccount.data.LoanAmortizationAllocationData.AmortizationMappingData;
+import org.apache.fineract.portfolio.loanaccount.domain.AmortizationType;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanAmortizationAllocationMapping;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanAmortizationAllocationMappingRepository;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRepository;
+import org.apache.fineract.portfolio.loanaccount.exception.LoanTransactionNotFoundException;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+
+@RequiredArgsConstructor
+public class LoanAmortizationAllocationServiceImpl implements LoanAmortizationAllocationService {
+
+ private final JdbcTemplate jdbcTemplate;
+ private final LoanAmortizationAllocationMappingRepository loanAmortizationAllocationMappingRepository;
+ private final LoanTransactionRepository loanTransactionRepository;
+
+ @Override
+ public LoanAmortizationAllocationData retrieveLoanAmortizationAllocationData(final Long loanTransactionId, final Long loanId) {
+ try {
+ final LoanTransaction loanTransaction = this.loanTransactionRepository.findById(loanTransactionId)
+ .orElseThrow(() -> new LoanTransactionNotFoundException(loanTransactionId));
+
+ final String baseTransactionSql = "select l.id as loanId, l.external_id as loanExternalId, "
Review Comment:
Please use `JPQL` + Projections instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2315464234
##########
fineract-provider/src/main/resources/db/changelog/tenant/parts/0195_create_loan_amortization_allocation_mapping.xml:
##########
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">
+ <changeSet author="fineract" id="1" context="postgresql">
+ <createTable tableName="m_loan_amortization_allocation_mapping">
+ <column autoIncrement="true" name="id" type="BIGINT">
+ <constraints nullable="false" primaryKey="true" primaryKeyName="pk_m_loan_amortization_allocation_mapping"/>
+ </column>
+ <column name="version" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="loan_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="base_loan_transaction_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="date" type="DATE">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amortization_loan_transaction_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amortization_type" type="VARCHAR(20)">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amount" type="DECIMAL(19, 6)">
+ <constraints nullable="false"/>
+ </column>
+ <column name="created_by" type="BIGINT"/>
+ <column name="created_on_utc" type="timestamp with time zone"/>
+ <column name="last_modified_by" type="BIGINT"/>
+ <column name="last_modified_on_utc" type="timestamp with time zone"/>
+ </createTable>
+ </changeSet>
+ <changeSet author="fineract" id="2" context="mysql">
+ <createTable tableName="m_loan_amortization_allocation_mapping">
+ <column autoIncrement="true" name="id" type="BIGINT">
+ <constraints nullable="false" primaryKey="true" primaryKeyName="pk_m_loan_amortization_allocation_mapping"/>
+ </column>
+ <column name="version" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="loan_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="base_loan_transaction_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="date" type="DATE">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amortization_loan_transaction_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amortization_type" type="VARCHAR(20)">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amount" type="DECIMAL(19, 6)">
+ <constraints nullable="false"/>
+ </column>
+ <column name="created_by" type="BIGINT"/>
+ <column name="created_on_utc" type="DATETIME"/>
+ <column name="last_modified_by" type="BIGINT"/>
+ <column name="last_modified_on_utc" type="DATETIME"/>
+ </createTable>
+ </changeSet>
+ <changeSet author="fineract" id="3">
+ <addForeignKeyConstraint baseColumnNames="created_by" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_created_by" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_appuser" validate="true"/>
+ <addForeignKeyConstraint baseColumnNames="last_modified_by" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_last_modified_by" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_appuser" validate="true"/>
+ <addForeignKeyConstraint baseColumnNames="loan_id" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_loan_id" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_loan" validate="true"/>
+ <addForeignKeyConstraint baseColumnNames="base_loan_transaction_id" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_base_transaction_id" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_loan_transaction" validate="true"/>
+ <addForeignKeyConstraint baseColumnNames="amortization_loan_transaction_id" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_amortization_transaction_id" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_loan_transaction" validate="true"/>
+ </changeSet>
+ <changeSet author="fineract" id="4" runInTransaction="false" context="postgresql">
Review Comment:
Adding foreign key constraint implicitly adding indexes, no need to add additional indexes for these columns.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2315440633
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
+
+ @ManyToOne
+ @JoinColumn(name = "loan_id", nullable = false)
+ private Loan loan;
+
+ @ManyToOne
+ @JoinColumn(name = "base_loan_transaction_id", nullable = false)
+ private LoanTransaction baseLoanTransaction;
+
+ @Column(name = "date", nullable = false)
+ private LocalDate date;
+
+ @ManyToOne
+ @JoinColumn(name = "amortization_loan_transaction_id", nullable = false)
+ private LoanTransaction amortizationLoanTransaction;
Review Comment:
we can flatten and use the `Long` loan transaction id here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2315439212
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
+
+ @ManyToOne
+ @JoinColumn(name = "loan_id", nullable = false)
+ private Loan loan;
Review Comment:
we can flatten and use the `Long` loanId here.
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
+
+ @ManyToOne
+ @JoinColumn(name = "loan_id", nullable = false)
+ private Loan loan;
+
+ @ManyToOne
+ @JoinColumn(name = "base_loan_transaction_id", nullable = false)
+ private LoanTransaction baseLoanTransaction;
Review Comment:
we can flatten and use the `Long` loan transaction id here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2316246843
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
Review Comment:
Done
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
+
+ @ManyToOne
+ @JoinColumn(name = "loan_id", nullable = false)
+ private Loan loan;
Review Comment:
Done
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
+
+ @ManyToOne
+ @JoinColumn(name = "loan_id", nullable = false)
+ private Loan loan;
+
+ @ManyToOne
+ @JoinColumn(name = "base_loan_transaction_id", nullable = false)
+ private LoanTransaction baseLoanTransaction;
Review Comment:
Done
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
+
+ @ManyToOne
+ @JoinColumn(name = "loan_id", nullable = false)
+ private Loan loan;
+
+ @ManyToOne
+ @JoinColumn(name = "base_loan_transaction_id", nullable = false)
+ private LoanTransaction baseLoanTransaction;
+
+ @Column(name = "date", nullable = false)
+ private LocalDate date;
+
+ @ManyToOne
+ @JoinColumn(name = "amortization_loan_transaction_id", nullable = false)
+ private LoanTransaction amortizationLoanTransaction;
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2315435569
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
Review Comment:
No need for setters, we create the transaction with all arguments and never change it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2315426896
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
Review Comment:
No need for versioning, this entries will never change once they got created.
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
+public class LoanAmortizationAllocationMapping extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @Version
+ private Long version;
Review Comment:
No need for versioning, these entries will never change once they got created, imho
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2316248346
##########
fineract-provider/src/main/resources/db/changelog/tenant/parts/0195_create_loan_amortization_allocation_mapping.xml:
##########
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.3.xsd">
+ <changeSet author="fineract" id="1" context="postgresql">
+ <createTable tableName="m_loan_amortization_allocation_mapping">
+ <column autoIncrement="true" name="id" type="BIGINT">
+ <constraints nullable="false" primaryKey="true" primaryKeyName="pk_m_loan_amortization_allocation_mapping"/>
+ </column>
+ <column name="version" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="loan_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="base_loan_transaction_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="date" type="DATE">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amortization_loan_transaction_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amortization_type" type="VARCHAR(20)">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amount" type="DECIMAL(19, 6)">
+ <constraints nullable="false"/>
+ </column>
+ <column name="created_by" type="BIGINT"/>
+ <column name="created_on_utc" type="timestamp with time zone"/>
+ <column name="last_modified_by" type="BIGINT"/>
+ <column name="last_modified_on_utc" type="timestamp with time zone"/>
+ </createTable>
+ </changeSet>
+ <changeSet author="fineract" id="2" context="mysql">
+ <createTable tableName="m_loan_amortization_allocation_mapping">
+ <column autoIncrement="true" name="id" type="BIGINT">
+ <constraints nullable="false" primaryKey="true" primaryKeyName="pk_m_loan_amortization_allocation_mapping"/>
+ </column>
+ <column name="version" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="loan_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="base_loan_transaction_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="date" type="DATE">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amortization_loan_transaction_id" type="BIGINT">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amortization_type" type="VARCHAR(20)">
+ <constraints nullable="false"/>
+ </column>
+ <column name="amount" type="DECIMAL(19, 6)">
+ <constraints nullable="false"/>
+ </column>
+ <column name="created_by" type="BIGINT"/>
+ <column name="created_on_utc" type="DATETIME"/>
+ <column name="last_modified_by" type="BIGINT"/>
+ <column name="last_modified_on_utc" type="DATETIME"/>
+ </createTable>
+ </changeSet>
+ <changeSet author="fineract" id="3">
+ <addForeignKeyConstraint baseColumnNames="created_by" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_created_by" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_appuser" validate="true"/>
+ <addForeignKeyConstraint baseColumnNames="last_modified_by" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_last_modified_by" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_appuser" validate="true"/>
+ <addForeignKeyConstraint baseColumnNames="loan_id" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_loan_id" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_loan" validate="true"/>
+ <addForeignKeyConstraint baseColumnNames="base_loan_transaction_id" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_base_transaction_id" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_loan_transaction" validate="true"/>
+ <addForeignKeyConstraint baseColumnNames="amortization_loan_transaction_id" baseTableName="m_loan_amortization_allocation_mapping"
+ constraintName="FK_laam_amortization_transaction_id" deferrable="false" initiallyDeferred="false"
+ onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="id"
+ referencedTableName="m_loan_transaction" validate="true"/>
+ </changeSet>
+ <changeSet author="fineract" id="4" runInTransaction="false" context="postgresql">
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on PR #4992:
URL: https://github.com/apache/fineract/pull/4992#issuecomment-3245565612
PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #4992:
URL: https://github.com/apache/fineract/pull/4992
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "mariiaKraievska (via GitHub)" <gi...@apache.org>.
mariiaKraievska commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2316247634
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanAmortizationAllocationServiceImpl.java:
##########
@@ -0,0 +1,149 @@
+/**
+ * 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.loanaccount.service;
+
+import java.math.BigDecimal;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
+import org.apache.fineract.portfolio.loanaccount.data.LoanAmortizationAllocationData;
+import org.apache.fineract.portfolio.loanaccount.data.LoanAmortizationAllocationData.AmortizationMappingData;
+import org.apache.fineract.portfolio.loanaccount.domain.AmortizationType;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanAmortizationAllocationMapping;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanAmortizationAllocationMappingRepository;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanTransaction;
+import org.apache.fineract.portfolio.loanaccount.domain.LoanTransactionRepository;
+import org.apache.fineract.portfolio.loanaccount.exception.LoanTransactionNotFoundException;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+
+@RequiredArgsConstructor
+public class LoanAmortizationAllocationServiceImpl implements LoanAmortizationAllocationService {
+
+ private final JdbcTemplate jdbcTemplate;
+ private final LoanAmortizationAllocationMappingRepository loanAmortizationAllocationMappingRepository;
+ private final LoanTransactionRepository loanTransactionRepository;
+
+ @Override
+ public LoanAmortizationAllocationData retrieveLoanAmortizationAllocationData(final Long loanTransactionId, final Long loanId) {
+ try {
+ final LoanTransaction loanTransaction = this.loanTransactionRepository.findById(loanTransactionId)
+ .orElseThrow(() -> new LoanTransactionNotFoundException(loanTransactionId));
+
+ final String baseTransactionSql = "select l.id as loanId, l.external_id as loanExternalId, "
Review Comment:
Done
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2315455497
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
Review Comment:
Do we need setters? I was wondering whether an all args constructor here would be better. What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2348: Calculate and store Capitalized income / Buydown fee amortization allocation schedule [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #4992:
URL: https://github.com/apache/fineract/pull/4992#discussion_r2315435569
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanAmortizationAllocationMapping.java:
##########
@@ -0,0 +1,74 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.EnumType;
+import jakarta.persistence.Enumerated;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+
+/**
+ * Entity to store the mapping between base loan transactions (Capitalized Income or Buy Down Fee) and their
+ * amortization allocation schedule. This mapping table stores which base loan transaction amortization occurs, on which
+ * date and what was the calculated amount.
+ */
+@Entity
+@Table(name = "m_loan_amortization_allocation_mapping")
+@Getter
+@Setter
Review Comment:
No need for setters, we create the transaction with all arguments and never change it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org