You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "somasorosdpc (via GitHub)" <gi...@apache.org> on 2026/05/21 16:15:37 UTC
[PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
somasorosdpc opened a new pull request, #5872:
URL: https://github.com/apache/fineract/pull/5872
## 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!
- [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#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](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
- [ ] Follow our [coding conventions](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
- [ ] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
Your assigned reviewer(s) will follow our [guidelines for code reviews](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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340041107
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
Review Comment:
charge_calculation_type
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
Review Comment:
charge_payment_mode
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340039688
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
Review Comment:
`charge_time_type`
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340030139
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
Review Comment:
`amount_paid` is enough, no need for "derived" prefix
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "somasorosdpc (via GitHub)" <gi...@apache.org>.
somasorosdpc commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3348561303
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
+
+ @Column(name = "amount_writtenoff_derived", scale = 6, precision = 19)
+ private BigDecimal amountWrittenOff;
+
+ @Column(name = "amount_outstanding_derived", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOutstanding;
+
+ @Column(name = "is_penalty", nullable = false)
+ private boolean penaltyCharge = false;
+
+ @Column(name = "is_paid_derived", nullable = false)
+ private boolean paid = false;
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3339963464
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java:
##########
@@ -450,6 +450,19 @@ public List<ChargeData> retrieveShareProductCharges(final Long shareProductId) {
return this.jdbcTemplate.query(sql, rm, new Object[] { shareProductId }); // NOSONAR
}
+ @Override
+ public List<ChargeData> retrieveWorkingCapitalLoanAccountApplicableCharges(Long loanId) {
Review Comment:
Can we do JPQL query + 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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "somasorosdpc (via GitHub)" <gi...@apache.org>.
somasorosdpc commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3348550105
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java:
##########
@@ -450,6 +450,19 @@ public List<ChargeData> retrieveShareProductCharges(final Long shareProductId) {
return this.jdbcTemplate.query(sql, rm, new Object[] { shareProductId }); // NOSONAR
}
+ @Override
+ public List<ChargeData> retrieveWorkingCapitalLoanAccountApplicableCharges(Long loanId) {
Review Comment:
As far as I see, using JPQL with projection would be too big change in the code to do it here also it would be risky to break uncovered features
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340020360
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
Review Comment:
we are not supporting...
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
+
+ @Column(name = "amount_writtenoff_derived", scale = 6, precision = 19)
+ private BigDecimal amountWrittenOff;
Review Comment:
we are not supporting...
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
+
+ @Column(name = "amount_writtenoff_derived", scale = 6, precision = 19)
+ private BigDecimal amountWrittenOff;
+
+ @Column(name = "amount_outstanding_derived", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOutstanding;
+
+ @Column(name = "is_penalty", nullable = false)
+ private boolean penaltyCharge = false;
+
+ @Column(name = "is_paid_derived", nullable = false)
+ private boolean paid = false;
+
+ @Column(name = "waived", nullable = false)
+ private boolean waived = false;
Review Comment:
we are not supporting...
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340066824
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanChargeReadPlatformServiceImpl.java:
##########
@@ -0,0 +1,137 @@
+/**
+ * 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.workingcapitalloan.service;
+
+import java.math.BigDecimal;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.time.LocalDate;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
+import org.apache.fineract.infrastructure.core.service.ExternalIdFactory;
+import org.apache.fineract.organisation.monetary.data.CurrencyData;
+import org.apache.fineract.portfolio.charge.exception.LoanChargeNotFoundException;
+import org.apache.fineract.portfolio.charge.service.ChargeEnumerations;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.stereotype.Service;
+
+@Service
+@RequiredArgsConstructor
+public class WorkingCapitalLoanChargeReadPlatformServiceImpl implements WorkingCapitalLoanChargeReadPlatformService {
Review Comment:
Can we 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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3339986779
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanChargesApiResourceSwagger.java:
##########
@@ -0,0 +1,221 @@
+/**
+ * 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.workingcapitalloan.api;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import java.time.LocalDate;
+import java.util.Set;
+
+final class WorkingCapitalLoanChargesApiResourceSwagger {
+
+ private WorkingCapitalLoanChargesApiResourceSwagger() {}
+
+ @Schema(description = "GetLoansLoanIdChargesChargeIdResponse")
+ public static final class GetLoansLoanIdChargesChargeIdResponse {
+
+ private GetLoansLoanIdChargesChargeIdResponse() {}
+
+ public static final class GetLoanChargeTimeType {
+
+ private GetLoanChargeTimeType() {}
+
+ @Schema(example = "1")
+ public Long id;
+ @Schema(example = "chargeTimeType.disbursement")
+ public String code;
+ @Schema(example = "Disbursement")
+ public String description;
+ }
+
+ public static final class GetLoanChargePaymentMethod {
+
+ private GetLoanChargePaymentMethod() {}
+
+ @Schema(example = "0")
+ public Long id;
+ @Schema(example = "chargepaymentmode.regular")
+ public String code;
+ @Schema(example = "Regular")
+ public String description;
+ }
+
+ public static final class GetLoanChargeCalculationType {
+
+ private GetLoanChargeCalculationType() {}
+
+ @Schema(example = "1")
+ public Long id;
+ @Schema(example = "chargeCalculationType.flat")
+ public String code;
+ @Schema(example = "Flat")
+ public String description;
+ }
+
+ public static final class GetLoanChargeCurrency {
+
+ private GetLoanChargeCurrency() {}
+
+ @Schema(example = "USD")
+ public String code;
+ @Schema(example = "US Dollar")
+ public String name;
+ @Schema(example = "2")
+ public Integer decimalPlaces;
+ @Schema(example = "$")
+ public String displaySymbol;
+ @Schema(example = "currency.USD")
+ public String nameCode;
+ @Schema(example = "US Dollar ($)")
+ public String displayLabel;
+ }
+
+ @Schema(example = "1")
+ public Long id;
+ @Schema(example = "1")
+ public Long chargeId;
+ @Schema(example = "Loan Processing fee")
+ public String name;
+ public GetLoanChargeTimeType chargeTimeType;
+ public GetLoanChargeCalculationType chargeCalculationType;
+ public GetLoanChargePaymentMethod chargePaymentMode;
+ @Schema(example = "0")
+ public Double percentage;
Review Comment:
Please return only the fields that are supported for Working Capital type of charge...
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #5872:
URL: https://github.com/apache/fineract/pull/5872#issuecomment-4595536915
@somasorosdpc Please rebase
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340048938
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
+
+ @Column(name = "amount_writtenoff_derived", scale = 6, precision = 19)
+ private BigDecimal amountWrittenOff;
+
+ @Column(name = "amount_outstanding_derived", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOutstanding;
+
+ @Column(name = "is_penalty", nullable = false)
+ private boolean penaltyCharge = false;
+
+ @Column(name = "is_paid_derived", nullable = false)
+ private boolean paid = false;
+
+ @Column(name = "waived", nullable = false)
+ private boolean waived = false;
+
+ @Column(name = "min_cap", scale = 6, precision = 19)
+ private BigDecimal minCap;
+
+ @Column(name = "max_cap", scale = 6, precision = 19)
+ private BigDecimal maxCap;
+
+ @Column(name = "is_active", nullable = false)
+ private boolean active = true;
+
+ @Column(name = "external_id")
+ private ExternalId externalId;
+
+ public LoanChargeData toData() {
Review Comment:
I might use mapper instead 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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340044372
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
+
+ @Column(name = "amount_writtenoff_derived", scale = 6, precision = 19)
+ private BigDecimal amountWrittenOff;
+
+ @Column(name = "amount_outstanding_derived", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOutstanding;
+
+ @Column(name = "is_penalty", nullable = false)
+ private boolean penaltyCharge = false;
+
+ @Column(name = "is_paid_derived", nullable = false)
+ private boolean paid = false;
Review Comment:
`is_paid`
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "somasorosdpc (via GitHub)" <gi...@apache.org>.
somasorosdpc commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3348550105
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java:
##########
@@ -450,6 +450,19 @@ public List<ChargeData> retrieveShareProductCharges(final Long shareProductId) {
return this.jdbcTemplate.query(sql, rm, new Object[] { shareProductId }); // NOSONAR
}
+ @Override
+ public List<ChargeData> retrieveWorkingCapitalLoanAccountApplicableCharges(Long loanId) {
Review Comment:
As far as I see, using JPQL with projection would be too big change in the code to do it 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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3339966149
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeWritePlatformServiceJpaRepositoryImpl.java:
##########
@@ -264,6 +265,12 @@ private boolean isAnyLoansAssociateWithThisCharge(final Long chargeId) {
return Boolean.valueOf(isLoansUsingCharge);
}
+ private boolean isAnyWorkingCapitalLoansAssociateWithThisCharge(final Long chargeId) {
Review Comment:
Can we user JPQL instead?
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/charge/service/ChargeReadPlatformServiceImpl.java:
##########
@@ -450,6 +450,19 @@ public List<ChargeData> retrieveShareProductCharges(final Long shareProductId) {
return this.jdbcTemplate.query(sql, rm, new Object[] { shareProductId }); // NOSONAR
}
+ @Override
+ public List<ChargeData> retrieveWorkingCapitalLoanAccountApplicableCharges(Long loanId) {
Review Comment:
Can we use JPQL query + 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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340007750
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanChargesApiResource.java:
##########
@@ -0,0 +1,239 @@
+/**
+ * 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.workingcapitalloan.api;
+
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.media.ArraySchema;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.parameters.RequestBody;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.UriInfo;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import org.apache.fineract.commands.domain.CommandWrapper;
+import org.apache.fineract.commands.service.CommandWrapperBuilder;
+import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService;
+import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.infrastructure.core.service.ExternalIdFactory;
+import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
+import org.apache.fineract.portfolio.charge.data.ChargeData;
+import org.apache.fineract.portfolio.charge.service.ChargeReadPlatformService;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+import org.apache.fineract.portfolio.workingcapitalloan.WorkingCapitalLoanConstants;
+import org.apache.fineract.portfolio.workingcapitalloan.repository.WorkingCapitalLoanChargeRepository;
+import org.apache.fineract.portfolio.workingcapitalloan.repository.WorkingCapitalLoanRepository;
+import org.apache.fineract.portfolio.workingcapitalloan.service.WorkingCapitalLoanChargeReadPlatformService;
+import org.springframework.stereotype.Component;
+
+@Path("/v1/working-capital-loans")
+@Component
+@Tag(name = "Working Capital Loan Charges", description = "Manages Charges for Working Capital loans")
+@RequiredArgsConstructor
+public class WorkingCapitalLoanChargesApiResource {
+
+ private final WorkingCapitalLoanRepository workingCapitalLoanRepository;
+ private final ChargeReadPlatformService chargeReadPlatformService;
+ private final PlatformSecurityContext securityContext;
+ private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
+ private final WorkingCapitalLoanChargeReadPlatformService loanChargeReadPlatformService;
+ private final WorkingCapitalLoanChargeRepository loanChargeRepository;
+
+ @GET
+ @Path("{loanId}/charges/template")
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Retrieve Working Capital Loan Charges Template", operationId = "retrieveTemplateWorkingCapitalLoanCharge", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
+ + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "loans/1/charges/template\n" + "\n")
+ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = WorkingCapitalLoanChargesApiResourceSwagger.GetLoansLoanIdChargesTemplateResponse.class)))
+ public LoanChargeData retrieveTemplate(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId) {
+ return retrieveTemplate(loanId, null);
+ }
+
+ @GET
+ @Path("external-id/{loanExternalId}/charges/template")
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Retrieve Working Capital Loan Charges Template", operationId = "retrieveTemplateWorkingCapitalLoanChargeByLoanExternalId", description = "This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of:\n"
+ + "\n" + "Field Defaults\n" + "Allowed description Lists\n" + "Example Request:\n" + "\n" + "loans/1/charges/template\n" + "\n")
+ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = WorkingCapitalLoanChargesApiResourceSwagger.GetLoansLoanIdChargesTemplateResponse.class)))
+ public LoanChargeData retrieveTemplate(
+ @PathParam("loanExternalId") @Parameter(description = "loanExternalId") final String loanExternalId) {
+
+ return retrieveTemplate(null, loanExternalId);
+ }
+
+ @POST
+ @Path("{loanId}/charges")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Create a Loan Charge ", description = "Creates a Loan Charge")
+ @RequestBody(required = true, content = @Content(schema = @Schema(implementation = WorkingCapitalLoanChargesApiResourceSwagger.PostLoansLoanIdChargesRequest.class)))
+ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = WorkingCapitalLoanChargesApiResourceSwagger.PostLoansLoanIdChargesResponse.class)))
+ public CommandProcessingResult createLoanCharge(@PathParam("loanId") @Parameter(description = "loanId") final Long loanId,
+ @Parameter(hidden = true) final String apiRequestBodyAsJson) {
+
+ return handleExecuteLoanCharge(loanId, null, "create", apiRequestBodyAsJson);
+ }
+
+ @POST
+ @Path("external-id/{loanExternalId}/charges")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Create a Loan Charge (no command provided) or Pay a charge (command=pay)", operationId = "executeWorkingCapitalLoanChargeByLoanExternalId", description = "Creates a Loan Charge | Pay a Loan Charge")
Review Comment:
We are not supporting Pay a loan Charge functionality (it depends on savings account).
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340032890
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
+
+ @Column(name = "amount_writtenoff_derived", scale = 6, precision = 19)
+ private BigDecimal amountWrittenOff;
+
+ @Column(name = "amount_outstanding_derived", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOutstanding;
Review Comment:
No need to store outstanding amount. It can be easily calculated
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #5872:
URL: https://github.com/apache/fineract/pull/5872#issuecomment-4592155467
@somasorosdpc Please resolve the conflicts.
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3339970584
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/api/WorkingCapitalLoanApiResourceSwagger.java:
##########
@@ -250,12 +250,20 @@ private GetBalance() {}
@Schema(example = "10000.00")
public BigDecimal feePaid;
@Schema(example = "10000.00")
+ public BigDecimal feeWaived;
Review Comment:
No such fields populated at the moment.
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3339991008
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/data/WorkingCapitalLoanBalanceData.java:
##########
@@ -42,9 +42,13 @@ public class WorkingCapitalLoanBalanceData implements Serializable {
private BigDecimal principalOutstanding;
private BigDecimal fee;
private BigDecimal feePaid;
+ private BigDecimal feeWaived;
Review Comment:
No such fields.
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "somasorosdpc (via GitHub)" <gi...@apache.org>.
somasorosdpc commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3348553108
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/service/WorkingCapitalLoanChargeReadPlatformServiceImpl.java:
##########
@@ -0,0 +1,137 @@
+/**
+ * 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.workingcapitalloan.service;
+
+import java.math.BigDecimal;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.time.LocalDate;
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.infrastructure.core.domain.JdbcSupport;
+import org.apache.fineract.infrastructure.core.service.ExternalIdFactory;
+import org.apache.fineract.organisation.monetary.data.CurrencyData;
+import org.apache.fineract.portfolio.charge.exception.LoanChargeNotFoundException;
+import org.apache.fineract.portfolio.charge.service.ChargeEnumerations;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.core.RowMapper;
+import org.springframework.stereotype.Service;
+
+@Service
+@RequiredArgsConstructor
+public class WorkingCapitalLoanChargeReadPlatformServiceImpl implements WorkingCapitalLoanChargeReadPlatformService {
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #5872:
URL: https://github.com/apache/fineract/pull/5872
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3339993310
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanBalance.java:
##########
@@ -62,6 +62,14 @@ public class WorkingCapitalLoanBalance extends AbstractAuditableWithUTCDateTimeC
@Setter
private BigDecimal feePaid = BigDecimal.ZERO;
+ @Column(name = "fee_waived", scale = 6, precision = 19, nullable = false)
Review Comment:
Nothing using these fields at the moment
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340013651
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
Review Comment:
we are not supporting...
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
Review Comment:
we are not supporting...
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
Review Comment:
we are not supporting...
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340021607
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
+
+ @Column(name = "amount_writtenoff_derived", scale = 6, precision = 19)
+ private BigDecimal amountWrittenOff;
+
+ @Column(name = "amount_outstanding_derived", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOutstanding;
+
+ @Column(name = "is_penalty", nullable = false)
+ private boolean penaltyCharge = false;
+
+ @Column(name = "is_paid_derived", nullable = false)
+ private boolean paid = false;
+
+ @Column(name = "waived", nullable = false)
+ private boolean waived = false;
+
+ @Column(name = "min_cap", scale = 6, precision = 19)
+ private BigDecimal minCap;
Review Comment:
we are not supporting...
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
+ private LocalDate dueDate;
+
+ @Column(name = "charge_calculation_enum")
+ @Convert(converter = ChargeCalculationTypeConverter.class)
+ private ChargeCalculationType chargeCalculation;
+
+ @Column(name = "charge_payment_mode_enum")
+ @Convert(converter = ChargePaymentModeConverter.class)
+ private ChargePaymentMode chargePaymentMode;
+
+ @Column(name = "calculation_percentage", scale = 6, precision = 19)
+ private BigDecimal percentage;
+
+ @Column(name = "calculation_on_amount", scale = 6, precision = 19)
+ private BigDecimal amountPercentageAppliedTo;
+
+ @Column(name = "charge_amount_or_percentage", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOrPercentage;
+
+ @Column(name = "amount", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amount;
+
+ @Column(name = "amount_paid_derived", scale = 6, precision = 19)
+ private BigDecimal amountPaid;
+
+ @Column(name = "amount_waived_derived", scale = 6, precision = 19)
+ private BigDecimal amountWaived;
+
+ @Column(name = "amount_writtenoff_derived", scale = 6, precision = 19)
+ private BigDecimal amountWrittenOff;
+
+ @Column(name = "amount_outstanding_derived", scale = 6, precision = 19, nullable = false)
+ private BigDecimal amountOutstanding;
+
+ @Column(name = "is_penalty", nullable = false)
+ private boolean penaltyCharge = false;
+
+ @Column(name = "is_paid_derived", nullable = false)
+ private boolean paid = false;
+
+ @Column(name = "waived", nullable = false)
+ private boolean waived = false;
+
+ @Column(name = "min_cap", scale = 6, precision = 19)
+ private BigDecimal minCap;
+
+ @Column(name = "max_cap", scale = 6, precision = 19)
+ private BigDecimal maxCap;
Review Comment:
we are not supporting...
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Charge - Add Specified Due Date Loan Charge [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5872:
URL: https://github.com/apache/fineract/pull/5872#discussion_r3340037271
##########
fineract-working-capital-loan/src/main/java/org/apache/fineract/portfolio/workingcapitalloan/domain/WorkingCapitalLoanCharge.java:
##########
@@ -0,0 +1,161 @@
+/**
+ * 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.workingcapitalloan.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.ManyToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.UniqueConstraint;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
+import org.apache.fineract.infrastructure.core.domain.ExternalId;
+import org.apache.fineract.portfolio.charge.domain.Charge;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationType;
+import org.apache.fineract.portfolio.charge.domain.ChargeCalculationTypeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentMode;
+import org.apache.fineract.portfolio.charge.domain.ChargePaymentModeConverter;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeType;
+import org.apache.fineract.portfolio.charge.domain.ChargeTimeTypeConverter;
+import org.apache.fineract.portfolio.loanaccount.data.LoanChargeData;
+
+@Setter
+@Getter
+@Entity
+@Table(name = "m_wc_loan_charge", uniqueConstraints = { @UniqueConstraint(columnNames = { "external_id" }, name = "external_id") })
+public class WorkingCapitalLoanCharge extends AbstractAuditableWithUTCDateTimeCustom<Long> {
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "loan_id", referencedColumnName = "id", nullable = false)
+ private WorkingCapitalLoan loan;
+
+ @ManyToOne(optional = false)
+ @JoinColumn(name = "charge_id", referencedColumnName = "id", nullable = false)
+ private Charge charge;
+
+ @Column(name = "charge_time_enum", nullable = false)
+ @Convert(converter = ChargeTimeTypeConverter.class)
+ private ChargeTimeType chargeTime;
+
+ @Column(name = "submitted_on_date")
+ private LocalDate submittedOnDate;
+
+ @Column(name = "due_for_collection_as_of_date")
Review Comment:
"due_date" is enough
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org