refactor: add lombok to Creditbureau module
This commit is contained in:
committed by
Arnold Gálovics
parent
e9ae88d057
commit
f86841646b
+15
-37
@@ -18,52 +18,30 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.creditbureau.data;
|
package org.apache.fineract.infrastructure.creditbureau.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CreditBureauConfigurationData {
|
public final class CreditBureauConfigurationData {
|
||||||
|
|
||||||
private final long creditBureauConfigurationId;
|
private long creditBureauConfigurationId;
|
||||||
|
|
||||||
private final String configurationKey;
|
private String configurationKey;
|
||||||
|
|
||||||
private final String value;
|
private String value;
|
||||||
|
|
||||||
private final long organizationCreditBureauId;
|
private long organizationCreditBureauId;
|
||||||
|
|
||||||
private final String description;
|
private String description;
|
||||||
|
|
||||||
private CreditBureauConfigurationData(final long creditBureauConfigurationId, final String configurationKey, final String value,
|
|
||||||
final long organizationCreditBureauId, final String description) {
|
|
||||||
this.creditBureauConfigurationId = creditBureauConfigurationId;
|
|
||||||
this.configurationKey = configurationKey;
|
|
||||||
this.value = value;
|
|
||||||
this.organizationCreditBureauId = organizationCreditBureauId;
|
|
||||||
this.description = description;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CreditBureauConfigurationData instance(final long creditBureauConfigurationId, final String configurationKey,
|
public static CreditBureauConfigurationData instance(final long creditBureauConfigurationId, final String configurationKey,
|
||||||
final String value, final long organizationCreditBureauId, final String description) {
|
final String value, final long organizationCreditBureauId, final String description) {
|
||||||
return new CreditBureauConfigurationData(creditBureauConfigurationId, configurationKey, value, organizationCreditBureauId,
|
return new CreditBureauConfigurationData().setCreditBureauConfigurationId(creditBureauConfigurationId)
|
||||||
description);
|
.setConfigurationKey(configurationKey).setValue(value).setOrganizationCreditBureauId(organizationCreditBureauId)
|
||||||
}
|
.setDescription(description);
|
||||||
|
|
||||||
public long getCreditBureauConfigurationId() {
|
|
||||||
return this.creditBureauConfigurationId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConfigurationKey() {
|
|
||||||
return this.configurationKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getOrganizationCreditBureauId() {
|
|
||||||
return this.organizationCreditBureauId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return this.description;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-42
@@ -18,59 +18,32 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.creditbureau.data;
|
package org.apache.fineract.infrastructure.creditbureau.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CreditBureauData {
|
public final class CreditBureauData {
|
||||||
|
|
||||||
private final long creditBureauId;
|
private long creditBureauId;
|
||||||
|
|
||||||
private final String creditBureauName;
|
private String creditBureauName;
|
||||||
|
|
||||||
private final String country;
|
private String country;
|
||||||
|
|
||||||
private final String productName;
|
private String productName;
|
||||||
|
|
||||||
private final String creditBureauSummary;
|
private String creditBureauSummary;
|
||||||
|
|
||||||
private final long implementationKey;
|
private long implementationKey;
|
||||||
|
|
||||||
private CreditBureauData(final long creditBureauId, final String creditBureauName, final String country, final String productName,
|
|
||||||
final String creditBureauSummary, final long implementationKey) {
|
|
||||||
this.creditBureauId = creditBureauId;
|
|
||||||
this.creditBureauName = creditBureauName;
|
|
||||||
this.country = country;
|
|
||||||
this.productName = productName;
|
|
||||||
this.creditBureauSummary = creditBureauSummary;
|
|
||||||
this.implementationKey = implementationKey;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CreditBureauData instance(final long creditBureauId, final String creditBureauName, final String country,
|
public static CreditBureauData instance(final long creditBureauId, final String creditBureauName, final String country,
|
||||||
final String productName, final String creditBureauSummary, final long implementationKey) {
|
final String productName, final String creditBureauSummary, final long implementationKey) {
|
||||||
|
|
||||||
return new CreditBureauData(creditBureauId, creditBureauName, country, productName, creditBureauSummary, implementationKey);
|
return new CreditBureauData().setCreditBureauId(creditBureauId).setCreditBureauName(creditBureauName).setCountry(country)
|
||||||
}
|
.setProductName(productName).setCreditBureauSummary(creditBureauSummary).setImplementationKey(implementationKey);
|
||||||
|
|
||||||
public String getCreditBureauSummary() {
|
|
||||||
return this.creditBureauSummary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getCreditBureauId() {
|
|
||||||
return this.creditBureauId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditBureauName() {
|
|
||||||
return this.creditBureauName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCountry() {
|
|
||||||
return this.country;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProductName() {
|
|
||||||
return this.productName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getImplementationKey() {
|
|
||||||
return this.implementationKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-70
@@ -18,94 +18,49 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.creditbureau.data;
|
package org.apache.fineract.infrastructure.creditbureau.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CreditBureauLoanProductMappingData {
|
public final class CreditBureauLoanProductMappingData {
|
||||||
|
|
||||||
private final long creditbureauLoanProductMappingId;
|
private long creditbureauLoanProductMappingId;
|
||||||
|
|
||||||
private final long organisationCreditBureauId;
|
private long organisationCreditBureauId;
|
||||||
|
|
||||||
private final String alias;
|
private String alias;
|
||||||
|
|
||||||
private final String creditbureauSummary;
|
private String creditbureauSummary;
|
||||||
|
|
||||||
private final String loanProductName;
|
private String loanProductName;
|
||||||
|
|
||||||
private final long loanProductId;
|
private long loanProductId;
|
||||||
|
|
||||||
private final boolean isCreditCheckMandatory;
|
private boolean isCreditCheckMandatory;
|
||||||
|
|
||||||
private final boolean skipCrediCheckInFailure;
|
private boolean skipCrediCheckInFailure;
|
||||||
|
|
||||||
private final long stalePeriod;
|
private long stalePeriod;
|
||||||
|
|
||||||
private final boolean isActive;
|
private boolean active;
|
||||||
|
|
||||||
private CreditBureauLoanProductMappingData(final long creditbureauLoanProductMappingId, final long organisationCreditBureauId,
|
|
||||||
final String alias, final String creditbureauSummary, final String loanProductName, final long loanProductId,
|
|
||||||
final boolean isCreditCheckMandatory, final boolean skipCrediCheckInFailure, final long stalePeriod, final boolean isActive) {
|
|
||||||
this.creditbureauLoanProductMappingId = creditbureauLoanProductMappingId;
|
|
||||||
this.organisationCreditBureauId = organisationCreditBureauId;
|
|
||||||
this.alias = alias;
|
|
||||||
this.creditbureauSummary = creditbureauSummary;
|
|
||||||
this.loanProductName = loanProductName;
|
|
||||||
this.loanProductId = loanProductId;
|
|
||||||
this.isCreditCheckMandatory = isCreditCheckMandatory;
|
|
||||||
this.skipCrediCheckInFailure = skipCrediCheckInFailure;
|
|
||||||
this.stalePeriod = stalePeriod;
|
|
||||||
this.isActive = isActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CreditBureauLoanProductMappingData instance(final long creditbureauLoanProductMappingId,
|
public static CreditBureauLoanProductMappingData instance(final long creditbureauLoanProductMappingId,
|
||||||
final long organisationCreditBureauId, final String alias, final String creditbureauSummary, final String loanProductName,
|
final long organisationCreditBureauId, final String alias, final String creditbureauSummary, final String loanProductName,
|
||||||
final long loanProductId, final boolean isCreditCheckMandatory, final boolean skipCrediCheckInFailure, final long stalePeriod,
|
final long loanProductId, final boolean isCreditCheckMandatory, final boolean skipCrediCheckInFailure, final long stalePeriod,
|
||||||
final boolean isActive) {
|
final boolean active) {
|
||||||
return new CreditBureauLoanProductMappingData(creditbureauLoanProductMappingId, organisationCreditBureauId, alias,
|
return new CreditBureauLoanProductMappingData().setCreditbureauLoanProductMappingId(creditbureauLoanProductMappingId)
|
||||||
creditbureauSummary, loanProductName, loanProductId, isCreditCheckMandatory, skipCrediCheckInFailure, stalePeriod,
|
.setOrganisationCreditBureauId(organisationCreditBureauId).setAlias(alias).setCreditbureauSummary(creditbureauSummary)
|
||||||
isActive);
|
.setLoanProductName(loanProductName).setLoanProductId(loanProductId).setCreditCheckMandatory(isCreditCheckMandatory)
|
||||||
|
.setSkipCrediCheckInFailure(skipCrediCheckInFailure).setStalePeriod(stalePeriod).setActive(active);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CreditBureauLoanProductMappingData instance1(final String loanProductName, final long loanProductId) {
|
public static CreditBureauLoanProductMappingData instance1(final String loanProductName, final long loanProductId) {
|
||||||
return new CreditBureauLoanProductMappingData(0, 0, "", "", loanProductName, loanProductId, false, false, 0, false);
|
return new CreditBureauLoanProductMappingData().setCreditbureauLoanProductMappingId(0).setOrganisationCreditBureauId(0).setAlias("")
|
||||||
}
|
.setCreditbureauSummary("").setLoanProductName(loanProductName).setLoanProductId(loanProductId)
|
||||||
|
.setCreditCheckMandatory(false).setSkipCrediCheckInFailure(false).setStalePeriod(0).setActive(false);
|
||||||
public long getCreditbureauLoanProductMappingId() {
|
|
||||||
return this.creditbureauLoanProductMappingId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAlias() {
|
|
||||||
return this.alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditbureauSummary() {
|
|
||||||
return this.creditbureauSummary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLoanProductName() {
|
|
||||||
return this.loanProductName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getOrganisationCreditBureauId() {
|
|
||||||
return this.organisationCreditBureauId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getLoanProductId() {
|
|
||||||
return this.loanProductId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCreditCheckMandatory() {
|
|
||||||
return this.isCreditCheckMandatory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSkipCrediCheckInFailure() {
|
|
||||||
return this.skipCrediCheckInFailure;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getStalePeriod() {
|
|
||||||
return this.stalePeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isActive() {
|
|
||||||
return this.isActive;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-24
@@ -18,35 +18,22 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.creditbureau.data;
|
package org.apache.fineract.infrastructure.creditbureau.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CreditBureauMasterData {
|
public final class CreditBureauMasterData {
|
||||||
|
|
||||||
private final long creditBureauId;
|
private long creditBureauId;
|
||||||
|
|
||||||
private final String creditBureauName;
|
private String creditBureauName;
|
||||||
|
|
||||||
private final String country;
|
private String country;
|
||||||
|
|
||||||
public static CreditBureauMasterData instance(final Long creditBureauId, final String creditBureauName, final String country) {
|
public static CreditBureauMasterData instance(final Long creditBureauId, final String creditBureauName, final String country) {
|
||||||
return new CreditBureauMasterData(creditBureauId, creditBureauName, country);
|
return new CreditBureauMasterData().setCreditBureauId(creditBureauId).setCreditBureauName(creditBureauName).setCountry(country);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CreditBureauMasterData(final Long creditBureauId, final String creditBureauName, final String country) {
|
|
||||||
this.creditBureauId = creditBureauId;
|
|
||||||
this.creditBureauName = creditBureauName;
|
|
||||||
this.country = country;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditBureauName() {
|
|
||||||
return this.creditBureauName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCountry() {
|
|
||||||
return this.country;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getCreditBureauId() {
|
|
||||||
return this.creditBureauId;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-22
@@ -18,35 +18,25 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.creditbureau.data;
|
package org.apache.fineract.infrastructure.creditbureau.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CreditBureauProduct {
|
public final class CreditBureauProduct {
|
||||||
|
|
||||||
private final long creditBureauProductId;
|
private long creditBureauProductId;
|
||||||
|
|
||||||
private final String creditBureauProductName;
|
private String creditBureauProductName;
|
||||||
|
|
||||||
private final long creditBureauMasterId;
|
private long creditBureauMasterId;
|
||||||
|
|
||||||
private CreditBureauProduct(final long creditBureauProductId, final String creditBureauProductName, final long creditBureauMasterId) {
|
|
||||||
this.creditBureauProductId = creditBureauProductId;
|
|
||||||
this.creditBureauProductName = creditBureauProductName;
|
|
||||||
this.creditBureauMasterId = creditBureauMasterId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CreditBureauProduct instance(final long creditBureauProductId, final String creditBureauProductName,
|
public static CreditBureauProduct instance(final long creditBureauProductId, final String creditBureauProductName,
|
||||||
final long creditBureauMasterId) {
|
final long creditBureauMasterId) {
|
||||||
return new CreditBureauProduct(creditBureauProductId, creditBureauProductName, creditBureauMasterId);
|
return new CreditBureauProduct().setCreditBureauProductId(creditBureauProductId).setCreditBureauProductName(creditBureauProductName)
|
||||||
}
|
.setCreditBureauMasterId(creditBureauMasterId);
|
||||||
|
|
||||||
public long getCreditBureauProductId() {
|
|
||||||
return this.creditBureauProductId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditBureauProductName() {
|
|
||||||
return this.creditBureauProductName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getCreditBureauMasterId() {
|
|
||||||
return this.creditBureauMasterId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-46
@@ -20,65 +20,35 @@
|
|||||||
package org.apache.fineract.infrastructure.creditbureau.data;
|
package org.apache.fineract.infrastructure.creditbureau.data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CreditBureauReportData implements Serializable {
|
public final class CreditBureauReportData implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final String name;
|
private String name;
|
||||||
|
|
||||||
private final String gender;
|
private String gender;
|
||||||
|
|
||||||
private final String address;
|
private String address;
|
||||||
|
|
||||||
private final String creditScore;
|
private String creditScore;
|
||||||
|
|
||||||
private final String borrowerInfo;
|
private String borrowerInfo;
|
||||||
|
|
||||||
private final String[] openAccounts;
|
private String[] openAccounts;
|
||||||
|
|
||||||
private final String[] closedAccounts;
|
private String[] closedAccounts;
|
||||||
|
|
||||||
public static CreditBureauReportData instance(final String name, final String gender, final String address, final String creditScore,
|
public static CreditBureauReportData instance(final String name, final String gender, final String address, final String creditScore,
|
||||||
final String borrowerInfo, final String[] openAccounts, final String[] closedAccounts) {
|
final String borrowerInfo, final String[] openAccounts, final String[] closedAccounts) {
|
||||||
return new CreditBureauReportData(name, gender, address, creditScore, borrowerInfo, openAccounts, closedAccounts);
|
return new CreditBureauReportData().setName(name).setGender(gender).setAddress(address).setCreditScore(creditScore)
|
||||||
|
.setBorrowerInfo(borrowerInfo).setOpenAccounts(openAccounts).setClosedAccounts(closedAccounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CreditBureauReportData(final String name, final String gender, final String address, final String creditScore,
|
|
||||||
final String borrowerInfo, final String[] openAccounts, final String[] closedAccounts) {
|
|
||||||
this.name = name;
|
|
||||||
this.gender = gender;
|
|
||||||
this.address = address;
|
|
||||||
this.creditScore = creditScore;
|
|
||||||
this.borrowerInfo = borrowerInfo;
|
|
||||||
this.openAccounts = openAccounts;
|
|
||||||
this.closedAccounts = closedAccounts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGender() {
|
|
||||||
return gender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAddress() {
|
|
||||||
return address;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditScore() {
|
|
||||||
return creditScore;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBorrowerInfo() {
|
|
||||||
return borrowerInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getOpenAccounts() {
|
|
||||||
return openAccounts;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getClosedAccounts() {
|
|
||||||
return closedAccounts;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-11
@@ -19,23 +19,23 @@
|
|||||||
package org.apache.fineract.infrastructure.creditbureau.data;
|
package org.apache.fineract.infrastructure.creditbureau.data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class CreditReportData implements Serializable {
|
public final class CreditReportData implements Serializable {
|
||||||
|
|
||||||
private final Long id;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long id;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final Long creditBureauId;
|
private Long creditBureauId;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private final String nationalId;
|
private String nationalId;
|
||||||
|
|
||||||
public static CreditReportData instance(final Long id, final Long creditBureauId, final String nationalId) {
|
public static CreditReportData instance(final Long id, final Long creditBureauId, final String nationalId) {
|
||||||
return new CreditReportData(id, creditBureauId, nationalId);
|
return new CreditReportData().setId(id).setCreditBureauId(creditBureauId).setNationalId(nationalId);
|
||||||
}
|
|
||||||
|
|
||||||
private CreditReportData(final Long id, final Long creditBureauId, final String nationalId) {
|
|
||||||
this.id = id;
|
|
||||||
this.creditBureauId = creditBureauId;
|
|
||||||
this.nationalId = nationalId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-55
@@ -18,74 +18,38 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.creditbureau.data;
|
package org.apache.fineract.infrastructure.creditbureau.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public final class OrganisationCreditBureauData {
|
public final class OrganisationCreditBureauData {
|
||||||
|
|
||||||
private final long organisationCreditBureauId;
|
private long organisationCreditBureauId;
|
||||||
|
|
||||||
private final String alias;
|
private String alias;
|
||||||
|
|
||||||
private final long creditBureauId;
|
private long creditBureauId;
|
||||||
|
|
||||||
private final String creditBureauName;
|
private String creditBureauName;
|
||||||
|
|
||||||
private final String creditBureauProduct;
|
private String creditBureauProduct;
|
||||||
|
|
||||||
private final String creditBureauCountry;
|
private String creditBureauCountry;
|
||||||
|
|
||||||
private final String creditBureauSummary;
|
private String creditBureauSummary;
|
||||||
|
|
||||||
private final boolean isActive;
|
private boolean active;
|
||||||
|
|
||||||
private OrganisationCreditBureauData(final long organisationCreditBureauId, final String alias, final long creditBureauId,
|
|
||||||
final String creditBureauName, final String creditBureauProduct, final String creditBureauCountry,
|
|
||||||
final String creditBureauSummary, final boolean isActive) {
|
|
||||||
this.organisationCreditBureauId = organisationCreditBureauId;
|
|
||||||
this.alias = alias;
|
|
||||||
this.creditBureauId = creditBureauId;
|
|
||||||
this.creditBureauName = creditBureauName;
|
|
||||||
this.creditBureauProduct = creditBureauProduct;
|
|
||||||
this.creditBureauCountry = creditBureauCountry;
|
|
||||||
this.creditBureauSummary = creditBureauSummary;
|
|
||||||
this.isActive = isActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static OrganisationCreditBureauData instance(final long organisationCreditBureauId, final String alias,
|
public static OrganisationCreditBureauData instance(final long organisationCreditBureauId, final String alias,
|
||||||
final long creditBureauId, final String creditBureauName, final String creditBureauProduct, final String creditBureauCountry,
|
final long creditBureauId, final String creditBureauName, final String creditBureauProduct, final String creditBureauCountry,
|
||||||
final String creditBureauSummary, final boolean isActive) {
|
final String creditBureauSummary, final boolean active) {
|
||||||
return new OrganisationCreditBureauData(organisationCreditBureauId, alias, creditBureauId, creditBureauName, creditBureauProduct,
|
return new OrganisationCreditBureauData().setOrganisationCreditBureauId(organisationCreditBureauId).setAlias(alias)
|
||||||
creditBureauCountry, creditBureauSummary, isActive);
|
.setCreditBureauId(creditBureauId).setCreditBureauName(creditBureauName).setCreditBureauProduct(creditBureauProduct)
|
||||||
}
|
.setCreditBureauCountry(creditBureauCountry).setCreditBureauSummary(creditBureauSummary).setActive(active);
|
||||||
|
|
||||||
public long getOrganisationCreditBureauId() {
|
|
||||||
return this.organisationCreditBureauId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditBureauName() {
|
|
||||||
return this.creditBureauName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditBureauProduct() {
|
|
||||||
return this.creditBureauProduct;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditBureauCountry() {
|
|
||||||
return this.creditBureauCountry;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCreditBureauSummary() {
|
|
||||||
return this.creditBureauSummary;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAlias() {
|
|
||||||
return this.alias;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getCreditBureauId() {
|
|
||||||
return this.creditBureauId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isActive() {
|
|
||||||
return this.isActive;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-47
@@ -18,15 +18,22 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.fineract.infrastructure.creditbureau.domain;
|
package org.apache.fineract.infrastructure.creditbureau.domain;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_creditbureau")
|
@Table(name = "m_creditbureau")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public class CreditBureau extends AbstractPersistableCustom {
|
public class CreditBureau extends AbstractPersistableCustom {
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
@@ -38,18 +45,6 @@ public class CreditBureau extends AbstractPersistableCustom {
|
|||||||
@Column(name = "implementation_key")
|
@Column(name = "implementation_key")
|
||||||
private String implementationKey;
|
private String implementationKey;
|
||||||
|
|
||||||
public CreditBureau(String name, String product, String country, String implementationKey,
|
|
||||||
List<CreditBureauLoanProductMapping> CreditBureauLoanProductMapping) {
|
|
||||||
this.name = name;
|
|
||||||
this.product = product;
|
|
||||||
this.country = country;
|
|
||||||
this.implementationKey = implementationKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CreditBureau() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CreditBureau fromJson(final JsonCommand command) {
|
public static CreditBureau fromJson(final JsonCommand command) {
|
||||||
|
|
||||||
final String tname = command.stringValueOfParameterNamed("name");
|
final String tname = command.stringValueOfParameterNamed("name");
|
||||||
@@ -57,40 +52,7 @@ public class CreditBureau extends AbstractPersistableCustom {
|
|||||||
final String tcountry = command.stringValueOfParameterNamed("country");
|
final String tcountry = command.stringValueOfParameterNamed("country");
|
||||||
final String timplementationKey = command.stringValueOfParameterNamed("implementationKey");
|
final String timplementationKey = command.stringValueOfParameterNamed("implementationKey");
|
||||||
|
|
||||||
return new CreditBureau(tname, tproduct, tcountry, timplementationKey, null);
|
return new CreditBureau().setName(tname).setProduct(tproduct).setCountry(tcountry).setImplementationKey(timplementationKey);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProduct() {
|
|
||||||
return this.product;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProduct(String product) {
|
|
||||||
this.product = product;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCountry() {
|
|
||||||
return this.country;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCountry(String country) {
|
|
||||||
this.country = country;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getImplementationKey() {
|
|
||||||
return this.implementationKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImplementationKey(String implementationKey) {
|
|
||||||
this.implementationKey = implementationKey;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-46
@@ -25,12 +25,20 @@ import javax.persistence.Entity;
|
|||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_creditbureau_configuration")
|
@Table(name = "m_creditbureau_configuration")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public class CreditBureauConfiguration extends AbstractPersistableCustom {
|
public class CreditBureauConfiguration extends AbstractPersistableCustom {
|
||||||
|
|
||||||
@Column(name = "configkey")
|
@Column(name = "configkey")
|
||||||
@@ -46,60 +54,16 @@ public class CreditBureauConfiguration extends AbstractPersistableCustom {
|
|||||||
@JoinColumn(name = "organisation_creditbureau_id")
|
@JoinColumn(name = "organisation_creditbureau_id")
|
||||||
private OrganisationCreditBureau organisationCreditbureau;
|
private OrganisationCreditBureau organisationCreditbureau;
|
||||||
|
|
||||||
public CreditBureauConfiguration() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public CreditBureauConfiguration(String configkey, String value, String description,
|
|
||||||
OrganisationCreditBureau organisationCreditbureau) {
|
|
||||||
this.configurationKey = configkey;
|
|
||||||
this.value = value;
|
|
||||||
this.description = description;
|
|
||||||
this.organisationCreditbureau = organisationCreditbureau;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CreditBureauConfiguration fromJson(JsonCommand command, OrganisationCreditBureau organisation_creditbureau) {
|
public static CreditBureauConfiguration fromJson(JsonCommand command, OrganisationCreditBureau organisation_creditbureau) {
|
||||||
final String configkey = command.stringValueOfParameterNamed("configkey");
|
final String configkey = command.stringValueOfParameterNamed("configkey");
|
||||||
final String value = command.stringValueOfParameterNamed("value");
|
final String value = command.stringValueOfParameterNamed("value");
|
||||||
final String description = command.stringValueOfParameterNamed("description");
|
final String description = command.stringValueOfParameterNamed("description");
|
||||||
|
|
||||||
return new CreditBureauConfiguration(configkey, value, description, organisation_creditbureau);
|
return new CreditBureauConfiguration().setConfigurationKey(configkey).setValue(value).setDescription(description)
|
||||||
|
.setOrganisationCreditbureau(organisation_creditbureau);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getConfigkey() {
|
|
||||||
return this.configurationKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConfigkey(String configkey) {
|
|
||||||
this.configurationKey = configkey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDescription() {
|
|
||||||
return this.description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDescription(String description) {
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrganisationCreditBureau getOrganisation_creditbureau() {
|
|
||||||
return this.organisationCreditbureau;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrganisation_creditbureau(OrganisationCreditBureau organisation_creditbureau) {
|
|
||||||
this.organisationCreditbureau = organisation_creditbureau;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> update(final JsonCommand command) {
|
public Map<String, Object> update(final JsonCommand command) {
|
||||||
|
|
||||||
final Map<String, Object> actualChanges = new LinkedHashMap<>(1);
|
final Map<String, Object> actualChanges = new LinkedHashMap<>(1);
|
||||||
|
|||||||
+13
-67
@@ -24,6 +24,10 @@ import javax.persistence.JoinColumn;
|
|||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
import javax.persistence.OneToOne;
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
|
import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
|
||||||
@@ -31,10 +35,14 @@ import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
|
|||||||
@SuppressWarnings({ "MemberName" })
|
@SuppressWarnings({ "MemberName" })
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_creditbureau_loanproduct_mapping")
|
@Table(name = "m_creditbureau_loanproduct_mapping")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public class CreditBureauLoanProductMapping extends AbstractPersistableCustom {
|
public class CreditBureauLoanProductMapping extends AbstractPersistableCustom {
|
||||||
|
|
||||||
@Column(name = "is_credit_check_mandatory")
|
@Column(name = "is_credit_check_mandatory")
|
||||||
private boolean isCreditCheckMandatory;
|
private boolean creditCheckMandatory;
|
||||||
|
|
||||||
@Column(name = "skip_credit_check_in_failure")
|
@Column(name = "skip_credit_check_in_failure")
|
||||||
private boolean skipCreditCheckInFailure;
|
private boolean skipCreditCheckInFailure;
|
||||||
@@ -43,7 +51,7 @@ public class CreditBureauLoanProductMapping extends AbstractPersistableCustom {
|
|||||||
private int stalePeriod;
|
private int stalePeriod;
|
||||||
|
|
||||||
@Column(name = "is_active")
|
@Column(name = "is_active")
|
||||||
private boolean isActive;
|
private boolean active;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private OrganisationCreditBureau organisation_creditbureau;
|
private OrganisationCreditBureau organisation_creditbureau;
|
||||||
@@ -52,20 +60,6 @@ public class CreditBureauLoanProductMapping extends AbstractPersistableCustom {
|
|||||||
@JoinColumn(name = "loan_product_id")
|
@JoinColumn(name = "loan_product_id")
|
||||||
private LoanProduct loanProduct;
|
private LoanProduct loanProduct;
|
||||||
|
|
||||||
public CreditBureauLoanProductMapping() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public CreditBureauLoanProductMapping(boolean isCreditCheckMandatory, boolean skipCreditCheckInFailure, int stalePeriod,
|
|
||||||
boolean isActive, OrganisationCreditBureau organisationCreditbureau, LoanProduct loanProduct) {
|
|
||||||
this.isCreditCheckMandatory = isCreditCheckMandatory;
|
|
||||||
this.skipCreditCheckInFailure = skipCreditCheckInFailure;
|
|
||||||
this.stalePeriod = stalePeriod;
|
|
||||||
this.isActive = isActive;
|
|
||||||
this.organisation_creditbureau = organisationCreditbureau;
|
|
||||||
this.loanProduct = loanProduct;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CreditBureauLoanProductMapping fromJson(final JsonCommand command, OrganisationCreditBureau organisation_creditbureau,
|
public static CreditBureauLoanProductMapping fromJson(final JsonCommand command, OrganisationCreditBureau organisation_creditbureau,
|
||||||
LoanProduct loanProduct) {
|
LoanProduct loanProduct) {
|
||||||
Boolean isCreditCheckMandatory = false;
|
Boolean isCreditCheckMandatory = false;
|
||||||
@@ -88,57 +82,9 @@ public class CreditBureauLoanProductMapping extends AbstractPersistableCustom {
|
|||||||
isActive = command.booleanPrimitiveValueOfParameterNamed("isActive");
|
isActive = command.booleanPrimitiveValueOfParameterNamed("isActive");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CreditBureauLoanProductMapping(isCreditCheckMandatory, skipCreditCheckInFailure, stalePeriod, isActive,
|
return new CreditBureauLoanProductMapping().setCreditCheckMandatory(isCreditCheckMandatory)
|
||||||
organisation_creditbureau, loanProduct);
|
.setSkipCreditCheckInFailure(skipCreditCheckInFailure).setStalePeriod(stalePeriod).setActive(isActive)
|
||||||
|
.setOrganisation_creditbureau(organisation_creditbureau).setLoanProduct(loanProduct);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCreditCheckMandatory() {
|
|
||||||
return this.isCreditCheckMandatory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreditCheckMandatory(boolean isCreditCheckMandatory) {
|
|
||||||
this.isCreditCheckMandatory = isCreditCheckMandatory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSkipCreditCheckInFailure() {
|
|
||||||
return this.skipCreditCheckInFailure;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSkipCreditCheckInFailure(boolean skipCreditCheckInFailure) {
|
|
||||||
this.skipCreditCheckInFailure = skipCreditCheckInFailure;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStalePeriod() {
|
|
||||||
return this.stalePeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStalePeriod(int stalePeriod) {
|
|
||||||
this.stalePeriod = stalePeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isIs_active() {
|
|
||||||
return this.isActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIs_active(boolean isActive) {
|
|
||||||
this.isActive = isActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public OrganisationCreditBureau getOrganisationCreditbureau() {
|
|
||||||
return this.organisation_creditbureau;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrganisationCreditbureau(OrganisationCreditBureau organisationCreditbureau) {
|
|
||||||
this.organisation_creditbureau = organisationCreditbureau;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LoanProduct getLoanProduct() {
|
|
||||||
return this.loanProduct;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoanProduct(LoanProduct loanProduct) {
|
|
||||||
this.loanProduct = loanProduct;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-40
@@ -25,6 +25,10 @@ import java.time.format.DateTimeFormatterBuilder;
|
|||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -32,6 +36,10 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_creditbureau_token")
|
@Table(name = "m_creditbureau_token")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
public class CreditBureauToken extends AbstractPersistableCustom {
|
public class CreditBureauToken extends AbstractPersistableCustom {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(CreditBureauToken.class);
|
private static final Logger LOG = LoggerFactory.getLogger(CreditBureauToken.class);
|
||||||
@@ -66,45 +74,7 @@ public class CreditBureauToken extends AbstractPersistableCustom {
|
|||||||
|
|
||||||
LocalDate expires = LocalDate.parse(expiry, dateformat);
|
LocalDate expires = LocalDate.parse(expiry, dateformat);
|
||||||
|
|
||||||
return new CreditBureauToken(userName, accessToken, tokenType, expiresIn, issued, expires);
|
return new CreditBureauToken().setUserName(userName).setAccessToken(accessToken).setTokenType(tokenType).setExpiresIn(expiresIn)
|
||||||
|
.setIssued(issued).setExpires(expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CreditBureauToken(String userName, String accessToken, String tokenType, String expiresIn, String issued, LocalDate expires) {
|
|
||||||
this.userName = userName;
|
|
||||||
this.accessToken = accessToken;
|
|
||||||
this.tokenType = tokenType;
|
|
||||||
this.expiresIn = expiresIn;
|
|
||||||
this.issued = issued;
|
|
||||||
this.expires = expires;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CreditBureauToken() {
|
|
||||||
this.userName = null;
|
|
||||||
this.accessToken = null;
|
|
||||||
this.tokenType = null;
|
|
||||||
this.expiresIn = null;
|
|
||||||
this.issued = null;
|
|
||||||
this.expires = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserName() {
|
|
||||||
return this.userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserName(String userName) {
|
|
||||||
this.userName = userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCurrentToken() {
|
|
||||||
return this.accessToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTokens(String tokens) {
|
|
||||||
this.accessToken = tokens;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LocalDate getTokenExpiryDate() {
|
|
||||||
return this.expires;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-16
@@ -23,11 +23,19 @@ import javax.persistence.Column;
|
|||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.FetchType;
|
import javax.persistence.FetchType;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "m_creditreport")
|
@Table(name = "m_creditreport")
|
||||||
public final class CreditReport extends AbstractPersistableCustom {
|
@NoArgsConstructor
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class CreditReport extends AbstractPersistableCustom {
|
||||||
|
|
||||||
@Column(name = "credit_bureau_id")
|
@Column(name = "credit_bureau_id")
|
||||||
private Long creditBureauId;
|
private Long creditBureauId;
|
||||||
@@ -39,21 +47,7 @@ public final class CreditReport extends AbstractPersistableCustom {
|
|||||||
@Column(name = "credit_reports")
|
@Column(name = "credit_reports")
|
||||||
private byte[] creditReports;
|
private byte[] creditReports;
|
||||||
|
|
||||||
private CreditReport() {}
|
|
||||||
|
|
||||||
public static CreditReport instance(final Long creditBureauId, final String nationalId, final byte[] creditReports) {
|
public static CreditReport instance(final Long creditBureauId, final String nationalId, final byte[] creditReports) {
|
||||||
return new CreditReport(creditBureauId, nationalId, creditReports);
|
return new CreditReport().setCreditBureauId(creditBureauId).setNationalId(nationalId).setCreditReports(creditReports);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CreditReport(final Long creditBureauId, final String nationalId, final byte[] creditReports) {
|
|
||||||
this.creditBureauId = creditBureauId;
|
|
||||||
this.nationalId = nationalId;
|
|
||||||
this.creditReports = creditReports;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] getCreditReport() {
|
|
||||||
return this.creditReports;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -87,9 +87,9 @@ public class CreditBureauLoanProductMappingWritePlatformServiceImpl implements C
|
|||||||
this.fromApiJsonDeserializer.validateForUpdate(command.json());
|
this.fromApiJsonDeserializer.validateForUpdate(command.json());
|
||||||
|
|
||||||
final Long mappingid = command.longValueOfParameterNamed("creditbureauLoanProductMappingId");
|
final Long mappingid = command.longValueOfParameterNamed("creditbureauLoanProductMappingId");
|
||||||
final boolean isActive = command.booleanPrimitiveValueOfParameterNamed("isActive");
|
final boolean active = command.booleanPrimitiveValueOfParameterNamed("active");
|
||||||
final CreditBureauLoanProductMapping cblpmapping = this.creditBureauLoanProductMappingRepository.getReferenceById(mappingid);
|
final CreditBureauLoanProductMapping cblpmapping = this.creditBureauLoanProductMappingRepository.getReferenceById(mappingid);
|
||||||
cblpmapping.setIs_active(isActive);
|
cblpmapping.setActive(active);
|
||||||
this.creditBureauLoanProductMappingRepository.saveAndFlush(cblpmapping);
|
this.creditBureauLoanProductMappingRepository.saveAndFlush(cblpmapping);
|
||||||
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(cblpmapping.getId()).build();
|
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(cblpmapping.getId()).build();
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -215,7 +215,7 @@ public class ThitsaWorksCreditBureauIntegrationWritePlatformServiceImpl implemen
|
|||||||
String subscriptionKey = getCreditBureauConfiguration(creditBureauId, CreditBureauConfigurations.SUBSCRIPTIONKEY.toString());
|
String subscriptionKey = getCreditBureauConfiguration(creditBureauId, CreditBureauConfigurations.SUBSCRIPTIONKEY.toString());
|
||||||
|
|
||||||
CreditBureauToken creditbureautoken = createToken(creditBureauId.longValue());
|
CreditBureauToken creditbureautoken = createToken(creditBureauId.longValue());
|
||||||
token = creditbureautoken.getCurrentToken();
|
token = creditbureautoken.getAccessToken();
|
||||||
|
|
||||||
// will use only "NRC" part of code from common http method to get data based on nrc
|
// will use only "NRC" part of code from common http method to get data based on nrc
|
||||||
String process = "NRC";
|
String process = "NRC";
|
||||||
@@ -304,7 +304,7 @@ public class ThitsaWorksCreditBureauIntegrationWritePlatformServiceImpl implemen
|
|||||||
String subscriptionKey = this.getCreditBureauConfiguration(creditBureauId, CreditBureauConfigurations.SUBSCRIPTIONKEY.toString());
|
String subscriptionKey = this.getCreditBureauConfiguration(creditBureauId, CreditBureauConfigurations.SUBSCRIPTIONKEY.toString());
|
||||||
|
|
||||||
CreditBureauToken creditbureautoken = this.createToken(creditBureauId.longValue());
|
CreditBureauToken creditbureautoken = this.createToken(creditBureauId.longValue());
|
||||||
String token = creditbureautoken.getCurrentToken();
|
String token = creditbureautoken.getAccessToken();
|
||||||
|
|
||||||
CreditBureauConfiguration addReportURL = this.configDataRepository.getCreditBureauConfigData(creditBureauId, "addCreditReporturl");
|
CreditBureauConfiguration addReportURL = this.configDataRepository.getCreditBureauConfigData(creditBureauId, "addCreditReporturl");
|
||||||
String url = addReportURL.getValue();
|
String url = addReportURL.getValue();
|
||||||
@@ -414,7 +414,7 @@ public class ThitsaWorksCreditBureauIntegrationWritePlatformServiceImpl implemen
|
|||||||
// check the expiry date of the previous token.
|
// check the expiry date of the previous token.
|
||||||
if (creditBureauToken != null) {
|
if (creditBureauToken != null) {
|
||||||
LocalDate current = DateUtils.getLocalDateOfTenant();
|
LocalDate current = DateUtils.getLocalDateOfTenant();
|
||||||
LocalDate getExpiryDate = creditBureauToken.getTokenExpiryDate();
|
LocalDate getExpiryDate = creditBureauToken.getExpires();
|
||||||
|
|
||||||
if (getExpiryDate.isBefore(current)) {
|
if (getExpiryDate.isBefore(current)) {
|
||||||
this.tokenRepositoryWrapper.delete(creditBureauToken);
|
this.tokenRepositoryWrapper.delete(creditBureauToken);
|
||||||
|
|||||||
Reference in New Issue
Block a user