Added and Enforced Membername Checkstyle(2)
This commit is contained in:
committed by
Petri Tuomola
parent
bfcd74aeb3
commit
774fcd9265
@@ -184,6 +184,11 @@
|
||||
<message key="ws.notPreceded"
|
||||
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="MemberName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Member name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ParenPad" />
|
||||
<module name="ModifierOrder"/>
|
||||
<module name="LocalVariableName">
|
||||
@@ -231,11 +236,7 @@
|
||||
|
||||
<module name="RedundantModifier"/>
|
||||
|
||||
<module name="MemberName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Member name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+8
-8
@@ -36,10 +36,10 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
public class ExternalServicesPropertiesCommandFromApiJsonDeserializer {
|
||||
|
||||
private final Set<String> S3SupportedParameters = S3JSONinputParams.getAllValues();
|
||||
private final Set<String> SMTPSupportedParameters = SMTPJSONinputParams.getAllValues();
|
||||
private final Set<String> SMSSupportedParameters = SMSJSONinputParams.getAllValues();
|
||||
private final Set<String> NotificationSupportedParameters = NotificationJSONinputParams.getAllValues();
|
||||
private final Set<String> s3SupportedParameters = S3JSONinputParams.getAllValues();
|
||||
private final Set<String> smtpSupportedParameters = SMTPJSONinputParams.getAllValues();
|
||||
private final Set<String> smsSupportedParameters = SMSJSONinputParams.getAllValues();
|
||||
private final Set<String> notificationSupportedParameters = NotificationJSONinputParams.getAllValues();
|
||||
private final FromJsonHelper fromApiJsonHelper;
|
||||
|
||||
@Autowired
|
||||
@@ -55,19 +55,19 @@ public class ExternalServicesPropertiesCommandFromApiJsonDeserializer {
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
switch (externalServiceName) {
|
||||
case "S3":
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.S3SupportedParameters);
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.s3SupportedParameters);
|
||||
break;
|
||||
|
||||
case "SMTP":
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.SMTPSupportedParameters);
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.smtpSupportedParameters);
|
||||
break;
|
||||
|
||||
case "SMS":
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.SMSSupportedParameters);
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.smsSupportedParameters);
|
||||
break;
|
||||
|
||||
case "NOTIFICATION":
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.NotificationSupportedParameters);
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, this.notificationSupportedParameters);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
+5
-6
@@ -58,7 +58,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
public class CreditBureauConfigurationAPI {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("creditBureauId", "alias", "country", "creditBureauProductId", "startDate", "endDate", "isActive"));
|
||||
private final String resourceNameForPermissions = "CreditBureau";
|
||||
private final PlatformSecurityContext context;
|
||||
@@ -107,7 +107,7 @@ public class CreditBureauConfigurationAPI {
|
||||
final Collection<CreditBureauData> creditBureau = this.readPlatformService.retrieveCreditBureau();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, creditBureau, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, creditBureau, this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public class CreditBureauConfigurationAPI {
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializerCreditBureauLoanProduct.serialize(settings, creditBureauLoanProductMapping,
|
||||
this.RESPONSE_DATA_PARAMETERS);
|
||||
this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
@@ -138,8 +138,7 @@ public class CreditBureauConfigurationAPI {
|
||||
.retrieveOrgCreditBureau();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializerOrganisationCreditBureau.serialize(settings, organisationCreditBureau,
|
||||
this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializerOrganisationCreditBureau.serialize(settings, organisationCreditBureau, this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
@@ -170,7 +169,7 @@ public class CreditBureauConfigurationAPI {
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializerCreditBureauLoanProduct.serialize(settings, creditBureauLoanProductMapping,
|
||||
this.RESPONSE_DATA_PARAMETERS);
|
||||
this.responseDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+7
-7
@@ -38,11 +38,11 @@ public final class CreditBureauLoanProductMappingData {
|
||||
|
||||
private final long stalePeriod;
|
||||
|
||||
private final boolean is_active;
|
||||
private final boolean isActive;
|
||||
|
||||
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 is_active) {
|
||||
final boolean isCreditCheckMandatory, final boolean skipCrediCheckInFailure, final long stalePeriod, final boolean isActive) {
|
||||
this.creditbureauLoanProductMappingId = creditbureauLoanProductMappingId;
|
||||
this.organisationCreditBureauId = organisationCreditBureauId;
|
||||
this.alias = alias;
|
||||
@@ -52,16 +52,16 @@ public final class CreditBureauLoanProductMappingData {
|
||||
this.isCreditCheckMandatory = isCreditCheckMandatory;
|
||||
this.skipCrediCheckInFailure = skipCrediCheckInFailure;
|
||||
this.stalePeriod = stalePeriod;
|
||||
this.is_active = is_active;
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
public static CreditBureauLoanProductMappingData instance(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 is_active) {
|
||||
final boolean isActive) {
|
||||
return new CreditBureauLoanProductMappingData(creditbureauLoanProductMappingId, organisationCreditBureauId, alias,
|
||||
creditbureauSummary, loanProductName, loanProductId, isCreditCheckMandatory, skipCrediCheckInFailure, stalePeriod,
|
||||
is_active);
|
||||
isActive);
|
||||
}
|
||||
|
||||
public static CreditBureauLoanProductMappingData instance1(final String loanProductName, final long loanProductId) {
|
||||
@@ -104,8 +104,8 @@ public final class CreditBureauLoanProductMappingData {
|
||||
return this.stalePeriod;
|
||||
}
|
||||
|
||||
public boolean isIs_active() {
|
||||
return this.is_active;
|
||||
public boolean isisActive() {
|
||||
return this.isActive;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
-6
@@ -34,11 +34,11 @@ public final class OrganisationCreditBureauData {
|
||||
|
||||
private final String creditBureauSummary;
|
||||
|
||||
private final boolean is_active;
|
||||
private final boolean isActive;
|
||||
|
||||
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 is_active) {
|
||||
final String creditBureauSummary, final boolean isActive) {
|
||||
this.organisationCreditBureauId = organisationCreditBureauId;
|
||||
this.alias = alias;
|
||||
this.creditBureauId = creditBureauId;
|
||||
@@ -46,14 +46,14 @@ public final class OrganisationCreditBureauData {
|
||||
this.creditBureauProduct = creditBureauProduct;
|
||||
this.creditBureauCountry = creditBureauCountry;
|
||||
this.creditBureauSummary = creditBureauSummary;
|
||||
this.is_active = is_active;
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
public static OrganisationCreditBureauData instance(final long organisationCreditBureauId, final String alias,
|
||||
final long creditBureauId, final String creditBureauName, final String creditBureauProduct, final String creditBureauCountry,
|
||||
final String creditBureauSummary, final boolean is_active) {
|
||||
final String creditBureauSummary, final boolean isActive) {
|
||||
return new OrganisationCreditBureauData(organisationCreditBureauId, alias, creditBureauId, creditBureauName, creditBureauProduct,
|
||||
creditBureauCountry, creditBureauSummary, is_active);
|
||||
creditBureauCountry, creditBureauSummary, isActive);
|
||||
}
|
||||
|
||||
public long getOrganisationCreditBureauId() {
|
||||
@@ -85,7 +85,7 @@ public final class OrganisationCreditBureauData {
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return this.is_active;
|
||||
return this.isActive;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -28,6 +28,7 @@ import org.apache.fineract.infrastructure.core.api.JsonCommand;
|
||||
import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
|
||||
import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
|
||||
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
@Entity
|
||||
@Table(name = "m_creditbureau_loanproduct_mapping")
|
||||
public class CreditBureauLoanProductMapping extends AbstractPersistableCustom {
|
||||
|
||||
+8
-8
@@ -37,16 +37,16 @@ public class OrganisationCreditBureau extends AbstractPersistableCustom {
|
||||
@OneToOne
|
||||
private CreditBureau creditbureau;
|
||||
|
||||
private boolean is_active;
|
||||
private boolean isActive;
|
||||
|
||||
@OneToMany(mappedBy = "organisation_creditbureau", cascade = CascadeType.ALL)
|
||||
private List<CreditBureauLoanProductMapping> creditBureauLoanProductMapping = new ArrayList<>();
|
||||
|
||||
public OrganisationCreditBureau(String alias, CreditBureau creditbureau, boolean is_active,
|
||||
public OrganisationCreditBureau(String alias, CreditBureau creditbureau, boolean isActive,
|
||||
List<CreditBureauLoanProductMapping> creditBureauLoanProductMapping) {
|
||||
this.alias = alias;
|
||||
this.creditbureau = creditbureau;
|
||||
this.is_active = is_active;
|
||||
this.isActive = isActive;
|
||||
this.creditBureauLoanProductMapping = creditBureauLoanProductMapping;
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ public class OrganisationCreditBureau extends AbstractPersistableCustom {
|
||||
|
||||
public static OrganisationCreditBureau fromJson(final JsonCommand command, CreditBureau creditbureau) {
|
||||
final String alias = command.stringValueOfParameterNamed("alias");
|
||||
final boolean is_active = command.booleanPrimitiveValueOfParameterNamed("is_active");
|
||||
final boolean isActive = command.booleanPrimitiveValueOfParameterNamed("isActive");
|
||||
|
||||
return new OrganisationCreditBureau(alias, creditbureau, is_active, null);
|
||||
return new OrganisationCreditBureau(alias, creditbureau, isActive, null);
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
@@ -78,11 +78,11 @@ public class OrganisationCreditBureau extends AbstractPersistableCustom {
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return this.is_active;
|
||||
return this.isActive;
|
||||
}
|
||||
|
||||
public void setIsActive(boolean is_active) {
|
||||
this.is_active = is_active;
|
||||
public void setIsActive(boolean isActive) {
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
public List<CreditBureauLoanProductMapping> getCreditBureauLoanProductMapping() {
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ import org.apache.fineract.infrastructure.dataqueries.data.ResultsetRowData;
|
||||
/**
|
||||
* Created by sanyam on 31/7/17.
|
||||
*/
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
final class DatatablesApiResourceSwagger {
|
||||
|
||||
private DatatablesApiResourceSwagger() {
|
||||
|
||||
+4
-4
@@ -62,7 +62,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Reports", description = "Non-core reports can be added, updated and deleted.")
|
||||
public class ReportsApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "reportName", "reportType", "reportSubType",
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("id", "reportName", "reportType", "reportSubType",
|
||||
"reportCategory", "description", "reportSql", "coreReport", "useReport", "reportParameters"));
|
||||
|
||||
private final String resourceNameForPermissions = "REPORT";
|
||||
@@ -97,7 +97,7 @@ public class ReportsApiResource {
|
||||
final Collection<ReportData> result = this.readReportingService.retrieveReportList();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, result, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, result, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -119,7 +119,7 @@ public class ReportsApiResource {
|
||||
if (settings.isTemplate()) {
|
||||
result.appendedTemplate(this.readReportingService.getAllowedParameters(), this.readReportingService.getAllowedReportTypes());
|
||||
}
|
||||
return this.toApiJsonSerializer.serialize(settings, result, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, result, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -138,7 +138,7 @@ public class ReportsApiResource {
|
||||
result.appendedTemplate(this.readReportingService.getAllowedParameters(), this.readReportingService.getAllowedReportTypes());
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, result, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, result, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ import org.springframework.stereotype.Component;
|
||||
public class DataTableValidator {
|
||||
|
||||
private final FromJsonHelper fromApiJsonHelper;
|
||||
private final Set<String> REGISTER_PARAMS = new HashSet<>(
|
||||
private final Set<String> registerParams = new HashSet<>(
|
||||
Arrays.asList(DataTableApiConstant.categoryParamName, DataTableApiConstant.localParamName));
|
||||
|
||||
@Autowired
|
||||
@@ -50,7 +50,7 @@ public class DataTableValidator {
|
||||
public void validateDataTableRegistration(final String json) {
|
||||
|
||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, REGISTER_PARAMS);
|
||||
this.fromApiJsonHelper.checkForUnsupportedParameters(typeOfMap, json, registerParams);
|
||||
|
||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
|
||||
|
||||
+7
-7
@@ -71,10 +71,10 @@ import org.springframework.stereotype.Component;
|
||||
+ "Groups: URL Pattern as groups")
|
||||
public class DocumentManagementApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("id", "parentEntityType", "parentEntityId", "name", "fileName", "size", "type", "description"));
|
||||
|
||||
private final String SystemEntityType = "DOCUMENT";
|
||||
private final String systemEntityType = "DOCUMENT";
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final DocumentReadPlatformService documentReadPlatformService;
|
||||
@@ -104,12 +104,12 @@ public class DocumentManagementApiResource {
|
||||
@PathParam("entityType") @Parameter(description = "entityType") final String entityType,
|
||||
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.systemEntityType);
|
||||
|
||||
final Collection<DocumentData> documentDatas = this.documentReadPlatformService.retrieveAllDocuments(entityType, entityId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, documentDatas, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, documentDatas, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -204,12 +204,12 @@ public class DocumentManagementApiResource {
|
||||
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||
@PathParam("documentId") @Parameter(description = "documentId") final Long documentId, @Context final UriInfo uriInfo) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.systemEntityType);
|
||||
|
||||
final DocumentData documentData = this.documentReadPlatformService.retrieveDocument(entityType, entityId, documentId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, documentData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, documentData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -223,7 +223,7 @@ public class DocumentManagementApiResource {
|
||||
@PathParam("entityId") @Parameter(description = "entityId") final Long entityId,
|
||||
@PathParam("documentId") @Parameter(description = "documentId") final Long documentId) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.SystemEntityType);
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.systemEntityType);
|
||||
|
||||
final FileData fileData = this.documentReadPlatformService.retrieveFileData(entityType, entityId, documentId);
|
||||
final ResponseBuilder response = Response.ok(fileData.file());
|
||||
|
||||
+4
-4
@@ -22,7 +22,7 @@ public final class FineractEntityType {
|
||||
|
||||
private String type;
|
||||
private String description;
|
||||
private String table_name;
|
||||
private String tableName;
|
||||
|
||||
public static final FineractEntityType OFFICE = new FineractEntityType("office", "Offices", "m_office");
|
||||
public static final FineractEntityType LOAN_PRODUCT = new FineractEntityType("loan_product", "Loan Products", "m_product_loan");
|
||||
@@ -31,10 +31,10 @@ public final class FineractEntityType {
|
||||
public static final FineractEntityType CHARGE = new FineractEntityType("charge", "Fees/Charges", "m_charge");
|
||||
public static final FineractEntityType SHARE_PRODUCT = new FineractEntityType("shares_product", "Shares Products", "m_share_product");
|
||||
|
||||
private FineractEntityType(String type, String description, String table_name) {
|
||||
private FineractEntityType(String type, String description, String tableName) {
|
||||
this.type = type;
|
||||
this.description = description;
|
||||
this.table_name = table_name;
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
@@ -46,7 +46,7 @@ public final class FineractEntityType {
|
||||
}
|
||||
|
||||
public String getTable() {
|
||||
return this.table_name;
|
||||
return this.tableName;
|
||||
}
|
||||
|
||||
public static FineractEntityType get(String type) {
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
@Repository
|
||||
@Profile("twofactor")
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
public class OTPRequestRepository {
|
||||
|
||||
private final ConcurrentHashMap<Long, OTPRequest> OTPrequests = new ConcurrentHashMap<>();
|
||||
|
||||
+4
-4
@@ -35,7 +35,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
public class CustomAuthenticationFailureHandler implements AuthenticationFailureHandler {
|
||||
|
||||
protected final Logger LOG = LoggerFactory.getLogger(getClass());
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(CustomAuthenticationFailureHandler.class);
|
||||
|
||||
private String defaultFailureUrl;
|
||||
private boolean forwardToDestination = false;
|
||||
@@ -55,18 +55,18 @@ public class CustomAuthenticationFailureHandler implements AuthenticationFailure
|
||||
final AuthenticationException exception) throws IOException, ServletException {
|
||||
|
||||
if (this.defaultFailureUrl == null) {
|
||||
this.LOG.debug("No failure URL set, sending 401 Unauthorized error");
|
||||
LOG.debug("No failure URL set, sending 401 Unauthorized error");
|
||||
|
||||
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authentication Failed: " + exception.getMessage());
|
||||
} else {
|
||||
saveException(request, exception);
|
||||
|
||||
if (this.forwardToDestination) {
|
||||
this.LOG.debug("Forwarding to {}", this.defaultFailureUrl);
|
||||
LOG.debug("Forwarding to {}", this.defaultFailureUrl);
|
||||
|
||||
request.getRequestDispatcher(this.defaultFailureUrl).forward(request, response);
|
||||
} else {
|
||||
this.LOG.debug("Redirecting to {}", this.defaultFailureUrl);
|
||||
LOG.debug("Redirecting to {}", this.defaultFailureUrl);
|
||||
|
||||
final String oauthToken = request.getParameter("oauth_token");
|
||||
request.setAttribute("oauth_token", oauthToken);
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ import org.joda.time.DateTime;
|
||||
/**
|
||||
* Created by sanyam on 13/8/17.
|
||||
*/
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
final class SurveyApiResourceSwagger {
|
||||
|
||||
private SurveyApiResourceSwagger() {
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Mix Taxonomy", description = "")
|
||||
public class MixTaxonomyApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("taxonomyId", "name", "namespace", "dimension", "description"));
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
@@ -75,6 +75,6 @@ public class MixTaxonomyApiResource {
|
||||
final List<MixTaxonomyData> taxonomyDatas = this.readTaxonomyService.retrieveAll();
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, taxonomyDatas, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, taxonomyDatas, this.responseDataParameters);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Mix Mapping", description = "")
|
||||
public class MixTaxonomyMappingApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("identifier", "config"));
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("identifier", "config"));
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final ToApiJsonSerializer<MixTaxonomyMappingData> toApiJsonSerializer;
|
||||
@@ -80,7 +80,7 @@ public class MixTaxonomyMappingApiResource {
|
||||
this.context.authenticatedUser();
|
||||
final MixTaxonomyMappingData mappingData = this.readTaxonomyMappingService.retrieveTaxonomyMapping();
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, mappingData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, mappingData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Currency", description = "Application related configuration around viewing/updating the currencies permitted for use within the MFI.")
|
||||
public class CurrenciesApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("selectedCurrencyOptions", "currencyOptions"));
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("selectedCurrencyOptions", "currencyOptions"));
|
||||
|
||||
private final String resourceNameForPermissions = "CURRENCY";
|
||||
|
||||
@@ -94,7 +94,7 @@ public class CurrenciesApiResource {
|
||||
final ApplicationCurrencyConfigurationData configurationData = this.readPlatformService.retrieveCurrencyConfiguration();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, configurationData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, configurationData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+4
-4
@@ -74,7 +74,7 @@ public class OfficesApiResource {
|
||||
/**
|
||||
* The set of parameters that are supported in response for {@link OfficeData}.
|
||||
*/
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "nameDecorated", "externalId",
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("id", "name", "nameDecorated", "externalId",
|
||||
"openingDate", "hierarchy", "parentId", "parentName", "allowedParents"));
|
||||
|
||||
private final String resourceNameForPermissions = "OFFICE";
|
||||
@@ -121,7 +121,7 @@ public class OfficesApiResource {
|
||||
final Collection<OfficeData> offices = this.readPlatformService.retrieveAllOffices(onlyManualEntries, searchParameters);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, offices, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, offices, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -142,7 +142,7 @@ public class OfficesApiResource {
|
||||
office = OfficeData.appendedTemplate(office, allowedParents);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, office, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, office, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -185,7 +185,7 @@ public class OfficesApiResource {
|
||||
office = OfficeData.appendedTemplate(office, allowedParents);
|
||||
}
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, office, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, office, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+4
-4
@@ -75,8 +75,8 @@ public class StaffApiResource {
|
||||
/**
|
||||
* The set of parameters that are supported in response for {@link StaffData}.
|
||||
*/
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "firstname", "lastname", "displayName",
|
||||
"officeId", "officeName", "isLoanOfficer", "externalId", "mobileNo", "allowedOffices", "isActive", "joiningDate"));
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("id", "firstname", "lastname", "displayName", "officeId",
|
||||
"officeName", "isLoanOfficer", "externalId", "mobileNo", "allowedOffices", "isActive", "joiningDate"));
|
||||
|
||||
private final String resourceNameForPermissions = "STAFF";
|
||||
|
||||
@@ -134,7 +134,7 @@ public class StaffApiResource {
|
||||
}
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, staff, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, staff, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -174,7 +174,7 @@ public class StaffApiResource {
|
||||
final Collection<OfficeData> allowedOffices = this.officeReadPlatformService.retrieveAllOfficesForDropdown();
|
||||
staff = StaffData.templateData(staff, allowedOffices);
|
||||
}
|
||||
return this.toApiJsonSerializer.serialize(settings, staff, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, staff, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ import org.springframework.stereotype.Component;
|
||||
+ "add regular expression for validation")
|
||||
public class EntityFieldConfigurationApiResources {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("clientAddressId", "client_id", "address_id", "address_type_id", "isActive", "fieldConfigurationId", "entity",
|
||||
"table", "field", "is_enabled", "is_mandatory", "validation_regex"));
|
||||
private final String resourceNameForPermissions = "Address";
|
||||
@@ -97,7 +97,7 @@ public class EntityFieldConfigurationApiResources {
|
||||
final Collection<FieldConfigurationData> fldconfig = this.readPlatformServicefld.retrieveFieldConfiguration(entityname);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializerfld.serialize(settings, fldconfig, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializerfld.serialize(settings, fldconfig, this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
/**
|
||||
* Created by Chirag Gupta on 12/01/17.
|
||||
*/
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
final class EntityFieldConfigurationApiResourcesSwagger {
|
||||
|
||||
private EntityFieldConfigurationApiResourcesSwagger() {}
|
||||
|
||||
+8
-8
@@ -27,7 +27,7 @@ import org.apache.fineract.infrastructure.codes.data.CodeValueData;
|
||||
@SuppressWarnings("unused")
|
||||
public class AddressData implements Serializable {
|
||||
|
||||
private final Long client_id;
|
||||
private final Long clientID;
|
||||
|
||||
private final String addressType;
|
||||
|
||||
@@ -92,7 +92,7 @@ public class AddressData implements Serializable {
|
||||
this.stateProvinceId = stateProvinceId;
|
||||
this.city = city;
|
||||
this.townVillage = null;
|
||||
this.client_id = null;
|
||||
this.clientID = null;
|
||||
this.addressType = null;
|
||||
this.addressId = null;
|
||||
this.countyDistrict = null;
|
||||
@@ -109,7 +109,7 @@ public class AddressData implements Serializable {
|
||||
this.addressTypeIdOptions = null;
|
||||
}
|
||||
|
||||
private AddressData(final String addressType, final Long client_id, final Long addressId, final Long addressTypeId,
|
||||
private AddressData(final String addressType, final Long clientID, final Long addressId, final Long addressTypeId,
|
||||
final Boolean is_active, final String street, final String addressLine1, final String addressLine2, final String addressLine3,
|
||||
final String townVillage, final String city, final String countyDistrict, final Long stateProvinceId, final Long countryId,
|
||||
final String stateName, final String countryName, final String postalCode, final BigDecimal latitude,
|
||||
@@ -117,7 +117,7 @@ public class AddressData implements Serializable {
|
||||
final Collection<CodeValueData> countryIdOptions, final Collection<CodeValueData> stateProvinceIdOptions,
|
||||
final Collection<CodeValueData> addressTypeIdOptions) {
|
||||
this.addressType = addressType;
|
||||
this.client_id = client_id;
|
||||
this.clientID = clientID;
|
||||
this.addressId = addressId;
|
||||
this.addressTypeId = addressTypeId;
|
||||
this.isActive = is_active;
|
||||
@@ -144,15 +144,15 @@ public class AddressData implements Serializable {
|
||||
this.addressTypeIdOptions = addressTypeIdOptions;
|
||||
}
|
||||
|
||||
public static AddressData instance(final String addressType, final Long client_id, final Long addressId, final Long addressTypeId,
|
||||
public static AddressData instance(final String addressType, final Long clientID, final Long addressId, final Long addressTypeId,
|
||||
final Boolean is_active, final String street, final String addressLine1, final String addressLine2, final String addressLine3,
|
||||
final String townVillage, final String city, final String countyDistrict, final Long stateProvinceId, final Long countryId,
|
||||
final String stateName, final String countryName, final String postalCode, final BigDecimal latitude,
|
||||
final BigDecimal longitude, final String createdBy, final Date createdOn, final String updatedBy, final Date updatedOn) {
|
||||
|
||||
return new AddressData(addressType, client_id, addressId, addressTypeId, is_active, street, addressLine1, addressLine2,
|
||||
addressLine3, townVillage, city, countyDistrict, stateProvinceId, countryId, stateName, countryName, postalCode, latitude,
|
||||
longitude, createdBy, createdOn, updatedBy, updatedOn, null, null, null);
|
||||
return new AddressData(addressType, clientID, addressId, addressTypeId, is_active, street, addressLine1, addressLine2, addressLine3,
|
||||
townVillage, city, countyDistrict, stateProvinceId, countryId, stateName, countryName, postalCode, latitude, longitude,
|
||||
createdBy, createdOn, updatedBy, updatedOn, null, null, null);
|
||||
}
|
||||
|
||||
public static AddressData instance1(final Long addressId, final String street, final String addressLine1, final String addressLine2,
|
||||
|
||||
+11
-11
@@ -20,27 +20,27 @@ package org.apache.fineract.portfolio.address.data;
|
||||
|
||||
public final class ClientAddressData {
|
||||
|
||||
private final long clientAddressId;
|
||||
private final long clientAddressID;
|
||||
|
||||
private final long client_id;
|
||||
private final long clientID;
|
||||
|
||||
private final long address_id;
|
||||
private final long addressID;
|
||||
|
||||
private final long address_type_id;
|
||||
private final long addressTypeID;
|
||||
|
||||
private final boolean isActive;
|
||||
|
||||
private ClientAddressData(final long clientAddressId, final long client_id, final long address_id, final long address_type_id,
|
||||
private ClientAddressData(final long clientAddressID, final long client_id, final long address_id, final long address_type_id,
|
||||
final boolean isActive) {
|
||||
this.clientAddressId = clientAddressId;
|
||||
this.client_id = client_id;
|
||||
this.address_id = address_id;
|
||||
this.address_type_id = address_type_id;
|
||||
this.clientAddressID = clientAddressID;
|
||||
this.clientID = client_id;
|
||||
this.addressID = address_id;
|
||||
this.addressTypeID = address_type_id;
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
public static ClientAddressData instance(final long clientAddressId, final long client_id, final long address_id,
|
||||
public static ClientAddressData instance(final long clientAddressID, final long client_id, final long address_id,
|
||||
final long address_type_id, final boolean isActive) {
|
||||
return new ClientAddressData(clientAddressId, client_id, address_id, address_type_id, isActive);
|
||||
return new ClientAddressData(clientAddressID, client_id, address_id, address_type_id, isActive);
|
||||
}
|
||||
}
|
||||
|
||||
+13
-13
@@ -28,26 +28,26 @@ public final class FieldConfigurationData {
|
||||
|
||||
private final String field;
|
||||
|
||||
private final boolean is_enabled;
|
||||
private final boolean isEnabled;
|
||||
|
||||
private final boolean is_mandatory;
|
||||
private final boolean isMandatory;
|
||||
|
||||
private final String validation_regex;
|
||||
private final String validationRegex;
|
||||
|
||||
private FieldConfigurationData(final long fieldConfigurationId, final String entity, final String subentity, final String field,
|
||||
final boolean is_enabled, final boolean is_mandatory, final String validation_regex) {
|
||||
final boolean isEnabled, final boolean isMandatory, final String validationRegex) {
|
||||
this.fieldConfigurationId = fieldConfigurationId;
|
||||
this.entity = entity;
|
||||
this.subentity = subentity;
|
||||
this.field = field;
|
||||
this.is_enabled = is_enabled;
|
||||
this.is_mandatory = is_mandatory;
|
||||
this.validation_regex = validation_regex;
|
||||
this.isEnabled = isEnabled;
|
||||
this.isMandatory = isMandatory;
|
||||
this.validationRegex = validationRegex;
|
||||
}
|
||||
|
||||
public static FieldConfigurationData instance(final long fieldConfigurationId, final String entity, final String subentity,
|
||||
final String field, final boolean is_enabled, final boolean is_mandatory, final String validation_regex) {
|
||||
return new FieldConfigurationData(fieldConfigurationId, entity, subentity, field, is_enabled, is_mandatory, validation_regex);
|
||||
final String field, final boolean isEnabled, final boolean isMandatory, final String validationRegex) {
|
||||
return new FieldConfigurationData(fieldConfigurationId, entity, subentity, field, isEnabled, isMandatory, validationRegex);
|
||||
}
|
||||
|
||||
public long getFieldConfigurationId() {
|
||||
@@ -66,16 +66,16 @@ public final class FieldConfigurationData {
|
||||
return this.field;
|
||||
}
|
||||
|
||||
public boolean isIs_enabled() {
|
||||
return this.is_enabled;
|
||||
public boolean isisEnabled() {
|
||||
return this.isEnabled;
|
||||
}
|
||||
|
||||
public boolean isIs_mandatory() {
|
||||
return this.is_mandatory;
|
||||
return this.isMandatory;
|
||||
}
|
||||
|
||||
public String getValidation_regex() {
|
||||
return this.validation_regex;
|
||||
return this.validationRegex;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ public class FieldConfiguration extends AbstractPersistableCustom {
|
||||
|
||||
private String field;
|
||||
|
||||
private boolean is_enabled;
|
||||
private boolean isEnabled;
|
||||
|
||||
public FieldConfiguration() {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FieldConfiguration extends AbstractPersistableCustom {
|
||||
this.entity = entity;
|
||||
this.table = table;
|
||||
this.field = field;
|
||||
this.is_enabled = is_enabled;
|
||||
this.isEnabled = is_enabled;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -84,9 +84,9 @@ public class AddressCommandFromApiJsonDeserializer {
|
||||
|
||||
for (final FieldConfigurationData data : configurationData) {
|
||||
madatoryFieldsMap.put(data.getField(), data.isIs_mandatory());
|
||||
enabledFieldsMap.put(data.getField(), data.isIs_enabled());
|
||||
enabledFieldsMap.put(data.getField(), data.isisEnabled());
|
||||
regexFieldsMap.put(data.getField(), data.getValidation_regex());
|
||||
if (data.isIs_enabled()) {
|
||||
if (data.isisEnabled()) {
|
||||
enabledFieldList.add(data.getField());
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -67,7 +67,7 @@ public class CalendarsApiResource {
|
||||
/**
|
||||
* The set of parameters that are supported in response for {@link Calendar}
|
||||
*/
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "entityId", "entityType", "title", "description",
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("id", "entityId", "entityType", "title", "description",
|
||||
"location", "startDate", "endDate", "duration", "type", "repeating", "recurrence", "frequency", "interval", "repeatsOnDay",
|
||||
"remindBy", "firstReminder", "secondReminder", "humanReadable", "createdDate", "lastUpdatedDate", "createdByUserId",
|
||||
"createdByUsername", "lastUpdatedByUserId", "lastUpdatedByUsername", "recurringDates", "nextTenRecurringDates",
|
||||
@@ -117,7 +117,7 @@ public class CalendarsApiResource {
|
||||
if (settings.isTemplate()) {
|
||||
calendarData = handleTemplate(calendarData);
|
||||
}
|
||||
return this.toApiJsonSerializer.serialize(settings, calendarData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, calendarData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,7 +155,7 @@ public class CalendarsApiResource {
|
||||
calendarsData = this.readPlatformService.updateWithRecurringDates(calendarsData);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, calendarsData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, calendarsData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -170,7 +170,7 @@ public class CalendarsApiResource {
|
||||
calendarData = handleTemplate(calendarData);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, calendarData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, calendarData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+4
-4
@@ -64,7 +64,7 @@ import org.springframework.stereotype.Component;
|
||||
+ "At present we support defining charges for use with Client accounts and both loan and saving products.")
|
||||
public class ChargesApiResource {
|
||||
|
||||
private final Set<String> CHARGES_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "amount", "currency", "penalty", "active",
|
||||
private final Set<String> chargesDataParameters = new HashSet<>(Arrays.asList("id", "name", "amount", "currency", "penalty", "active",
|
||||
"chargeAppliesTo", "chargeTimeType", "chargeCalculationType", "chargeCalculationTypeOptions", "chargeAppliesToOptions",
|
||||
"chargeTimeTypeOptions", "currencyOptions", "loanChargeCalculationTypeOptions", "loanChargeTimeTypeOptions",
|
||||
"savingsChargeCalculationTypeOptions", "savingsChargeTimeTypeOptions", "incomeAccount", "clientChargeCalculationTypeOptions",
|
||||
@@ -103,7 +103,7 @@ public class ChargesApiResource {
|
||||
final Collection<ChargeData> charges = this.readPlatformService.retrieveAllCharges();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, charges, this.CHARGES_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, charges, this.chargesDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -127,7 +127,7 @@ public class ChargesApiResource {
|
||||
charge = ChargeData.withTemplate(charge, templateData);
|
||||
}
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, charge, this.CHARGES_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, charge, this.chargesDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -145,7 +145,7 @@ public class ChargesApiResource {
|
||||
final ChargeData charge = this.readPlatformService.retrieveNewChargeDetails();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, charge, this.CHARGES_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, charge, this.chargesDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+5
-5
@@ -65,14 +65,14 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
private final ChargeRepository chargeRepository;
|
||||
private final LoanProductRepository loanProductRepository;
|
||||
private final FineractEntityAccessUtil fineractEntityAccessUtil;
|
||||
private final GLAccountRepositoryWrapper gLAccountRepository;
|
||||
private final GLAccountRepositoryWrapper glAccountRepository;
|
||||
private final TaxGroupRepositoryWrapper taxGroupRepository;
|
||||
|
||||
@Autowired
|
||||
public ChargeWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context,
|
||||
final ChargeDefinitionCommandFromApiJsonDeserializer fromApiJsonDeserializer, final ChargeRepository chargeRepository,
|
||||
final LoanProductRepository loanProductRepository, final RoutingDataSource dataSource,
|
||||
final FineractEntityAccessUtil fineractEntityAccessUtil, final GLAccountRepositoryWrapper gLAccountRepository,
|
||||
final FineractEntityAccessUtil fineractEntityAccessUtil, final GLAccountRepositoryWrapper glAccountRepository,
|
||||
final TaxGroupRepositoryWrapper taxGroupRepository) {
|
||||
this.context = context;
|
||||
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
|
||||
@@ -81,7 +81,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
this.chargeRepository = chargeRepository;
|
||||
this.loanProductRepository = loanProductRepository;
|
||||
this.fineractEntityAccessUtil = fineractEntityAccessUtil;
|
||||
this.gLAccountRepository = gLAccountRepository;
|
||||
this.glAccountRepository = glAccountRepository;
|
||||
this.taxGroupRepository = taxGroupRepository;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
|
||||
GLAccount glAccount = null;
|
||||
if (glAccountId != null) {
|
||||
glAccount = this.gLAccountRepository.findOneWithNotFoundDetection(glAccountId);
|
||||
glAccount = this.glAccountRepository.findOneWithNotFoundDetection(glAccountId);
|
||||
}
|
||||
|
||||
final Long taxGroupId = command.longValueOfParameterNamed(ChargesApiConstants.taxGroupIdParamName);
|
||||
@@ -171,7 +171,7 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
||||
final Long newValue = command.longValueOfParameterNamed(ChargesApiConstants.glAccountIdParamName);
|
||||
GLAccount newIncomeAccount = null;
|
||||
if (newValue != null) {
|
||||
newIncomeAccount = this.gLAccountRepository.findOneWithNotFoundDetection(newValue);
|
||||
newIncomeAccount = this.glAccountRepository.findOneWithNotFoundDetection(newValue);
|
||||
}
|
||||
chargeForUpdate.setAccount(newIncomeAccount);
|
||||
}
|
||||
|
||||
+3
-3
@@ -62,7 +62,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Clients Address", description = "Address module is an optional module and can be configured into the system by using GlobalConfiguration setting: enable-address. In order to activate Address module, we need to enable the configuration, enable-address by setting its value to true.")
|
||||
public class ClientAddressApiResources {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("addressId", "street", "addressLine1", "addressLine2",
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("addressId", "street", "addressLine1", "addressLine2",
|
||||
"addressLine3", "townVillage", "city", "countyDistrict", "stateProvinceId", "countryId", "postalCode", "latitude", "longitude",
|
||||
"createdBy", "createdOn", "updatedBy", "updatedOn", "clientAddressId", "client_id", "address_id", "address_type_id", "isActive",
|
||||
"fieldConfigurationId", "entity", "table", "field", "is_enabled", "is_mandatory", "validation_regex"));
|
||||
@@ -94,7 +94,7 @@ public class ClientAddressApiResources {
|
||||
final AddressData template = this.readPlatformService.retrieveTemplate();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, template, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, template, this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class ClientAddressApiResources {
|
||||
}
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, address, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, address, this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
/**
|
||||
* Created by Chirag Gupta on 01/12/18.
|
||||
*/
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
final class ClientAddressApiResourcesSwagger {
|
||||
|
||||
private ClientAddressApiResourcesSwagger() {}
|
||||
|
||||
+5
-5
@@ -53,8 +53,8 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
public class ClientFamilyMembersApiResources {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "clientId", "firstName", "middleName",
|
||||
"lastName", "qualification", "relationship", "maritalStatus", "gender", "dateOfBirth", "profession", "clientFamilyMemberId"));
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("id", "clientId", "firstName", "middleName", "lastName",
|
||||
"qualification", "relationship", "maritalStatus", "gender", "dateOfBirth", "profession", "clientFamilyMemberId"));
|
||||
private final String resourceNameForPermissions = "FamilyMembers";
|
||||
private final PlatformSecurityContext context;
|
||||
private final ClientFamilyMembersReadPlatformService readPlatformService;
|
||||
@@ -87,7 +87,7 @@ public class ClientFamilyMembersApiResources {
|
||||
final ClientFamilyMembersData familyMembers = this.readPlatformService.getClientFamilyMember(familyMemberId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, familyMembers, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, familyMembers, this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class ClientFamilyMembersApiResources {
|
||||
final Collection<ClientFamilyMembersData> familyMembers = this.readPlatformService.getClientFamilyMembers(clientId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, familyMembers, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, familyMembers, this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ClientFamilyMembersApiResources {
|
||||
final ClientFamilyMembersData options = this.readPlatformService.retrieveTemplate();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, options, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, options, this.responseDataParameters);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ import java.util.List;
|
||||
/**
|
||||
* Created by Chirag Gupta on 12/17/17.
|
||||
*/
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
final class CollectionSheetApiResourceSwagger {
|
||||
|
||||
private CollectionSheetApiResourceSwagger() {}
|
||||
|
||||
+3
-3
@@ -64,7 +64,7 @@ public class FundsApiResource {
|
||||
/**
|
||||
* The set of parameters that are supported in response for {@link CodeData}
|
||||
*/
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "externalId"));
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("id", "name", "externalId"));
|
||||
|
||||
private final String resourceNameForPermissions = "FUND";
|
||||
|
||||
@@ -98,7 +98,7 @@ public class FundsApiResource {
|
||||
final Collection<FundData> funds = this.readPlatformService.retrieveAllFunds();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, funds, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, funds, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -132,7 +132,7 @@ public class FundsApiResource {
|
||||
final FundData fund = this.readPlatformService.retrieveFund(fundId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, fund, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, fund, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
public class BulkLoansApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("officeId", "fromLoanOfficerId", "assignmentDate",
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("officeId", "fromLoanOfficerId", "assignmentDate",
|
||||
"officeOptions", "loanOfficerOptions", "accountSummaryCollection"));
|
||||
|
||||
private final String resourceNameForPermissions = "LOAN";
|
||||
@@ -110,7 +110,7 @@ public class BulkLoansApiResource {
|
||||
new LocalDate(), offices, loanOfficers, staffAccountSummaryCollectionData);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, loanReassignmentData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, loanReassignmentData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+4
-4
@@ -71,7 +71,7 @@ import org.springframework.stereotype.Component;
|
||||
+ "Loan Charges are instances of Charges and represent either fees and penalties for loan products. Refer Charges for documentation of the various properties of a charge, Only additional properties ( specific to the context of a Charge being associated with a Loan) are described here")
|
||||
public class LoanChargesApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("id", "chargeId", "name", "penalty", "chargeTimeType", "dueAsOfDate", "chargeCalculationType", "percentage",
|
||||
"amountPercentageAppliedTo", "currency", "amountWaived", "amountWrittenOff", "amountOutstanding", "amountOrPercentage",
|
||||
"amount", "amountPaid", "chargeOptions", "installmentChargeData"));
|
||||
@@ -117,7 +117,7 @@ public class LoanChargesApiResource {
|
||||
final Collection<LoanChargeData> loanCharges = this.loanChargeReadPlatformService.retrieveLoanCharges(loanId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, loanCharges, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, loanCharges, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -138,7 +138,7 @@ public class LoanChargesApiResource {
|
||||
final LoanChargeData loanChargeTemplate = LoanChargeData.template(chargeOptions);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, loanChargeTemplate, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, loanChargeTemplate, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -162,7 +162,7 @@ public class LoanChargesApiResource {
|
||||
final LoanChargeData loanChargeData = new LoanChargeData(loanCharge, installmentChargeData);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, loanChargeData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, loanChargeData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+2
-2
@@ -49,7 +49,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
public class LoanDisbursementDetailApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("id", "expectedDisbursementDate", "actualDisbursementDate", "principal", "approvedPrincipal"));
|
||||
|
||||
private final String resourceNameForPermissions = "LOAN";
|
||||
@@ -112,7 +112,7 @@ public class LoanDisbursementDetailApiResource {
|
||||
final DisbursementData disbursementData = this.loanReadPlatformService.retrieveLoanDisbursementDetail(loanId, disbursementId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, disbursementData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, disbursementData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
-3
@@ -68,7 +68,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Loan Transactions", description = "Capabilities include loan repayment's, interest waivers and the ability to 'adjust' an existing transaction. An 'adjustment' of a transaction is really a 'reversal' of existing transaction followed by creation of a new transaction with the provided details.")
|
||||
public class LoanTransactionsApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("id", "type", "date", "currency", "amount", "externalId"));
|
||||
|
||||
private final String resourceNameForPermissions = "LOAN";
|
||||
@@ -160,7 +160,7 @@ public class LoanTransactionsApiResource {
|
||||
}
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, transactionData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, transactionData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -185,7 +185,7 @@ public class LoanTransactionsApiResource {
|
||||
transactionData = LoanTransactionData.templateOnTop(transactionData, paymentTypeOptions);
|
||||
}
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, transactionData, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, transactionData, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+8
-8
@@ -198,7 +198,7 @@ import org.springframework.util.CollectionUtils;
|
||||
+ "Specifies compounding frequency start date for interest recalculation. This date must be equal to disbursement date")
|
||||
public class LoansApiResource {
|
||||
|
||||
private final Set<String> LOAN_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "accountNo", "status", "externalId", "clientId",
|
||||
private final Set<String> loanDataParameters = new HashSet<>(Arrays.asList("id", "accountNo", "status", "externalId", "clientId",
|
||||
"group", "loanProductId", "loanProductName", "loanProductDescription", "isLoanProductLinkedToFloatingRate", "fundId",
|
||||
"fundName", "loanPurposeId", "loanPurposeName", "loanOfficerId", "loanOfficerName", "currency", "principal", "totalOverpaid",
|
||||
"inArrearsTolerance", "termFrequency", "termPeriodFrequencyType", "numberOfRepayments", "repaymentEvery",
|
||||
@@ -217,8 +217,8 @@ public class LoansApiResource {
|
||||
LoanApiConstants.loanIdToClose, LoanApiConstants.topupAmount, LoanApiConstants.clientActiveLoanOptions,
|
||||
LoanApiConstants.datatables, LoanProductConstants.RATES_PARAM_NAME));
|
||||
|
||||
private final Set<String> LOAN_APPROVAL_DATA_PARAMETERS = new HashSet<>(Arrays.asList("approvalDate", "approvalAmount"));
|
||||
final Set<String> GLIM_ACCOUNTS_DATA_PARAMETERS = new HashSet<>(Arrays.asList("glimId", "groupId", "clientId", "parentLoanAccountNo",
|
||||
private final Set<String> loanApprovalDataParameters = new HashSet<>(Arrays.asList("approvalDate", "approvalAmount"));
|
||||
final Set<String> glimAccountsDataParameters = new HashSet<>(Arrays.asList("glimId", "groupId", "clientId", "parentLoanAccountNo",
|
||||
"parentPrincipalAmount", "childLoanAccountNo", "childPrincipalAmount", "clientName"));
|
||||
private final String resourceNameForPermissions = "LOAN";
|
||||
|
||||
@@ -338,7 +338,7 @@ public class LoansApiResource {
|
||||
}
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.loanApprovalDataToApiJsonSerializer.serialize(settings, loanApprovalTemplate, this.LOAN_APPROVAL_DATA_PARAMETERS);
|
||||
return this.loanApprovalDataToApiJsonSerializer.serialize(settings, loanApprovalTemplate, this.loanApprovalDataParameters);
|
||||
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ public class LoansApiResource {
|
||||
newLoanAccount.setDatatables(datatableTemplates);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, newLoanAccount, this.LOAN_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, newLoanAccount, this.loanDataParameters);
|
||||
}
|
||||
|
||||
private Collection<PortfolioAccountData> getaccountLinkingOptions(final LoanAccountData newLoanAccount, final Long clientId,
|
||||
@@ -734,7 +734,7 @@ public class LoansApiResource {
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters(),
|
||||
mandatoryResponseParameters);
|
||||
String toReturn = this.toApiJsonSerializer.serialize(settings, loanAccount, this.LOAN_DATA_PARAMETERS);
|
||||
String toReturn = this.toApiJsonSerializer.serialize(settings, loanAccount, this.loanDataParameters);
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
@@ -764,7 +764,7 @@ public class LoansApiResource {
|
||||
final Page<LoanAccountData> loanBasicDetails = this.loanReadPlatformService.retrieveAll(searchParameters);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, loanBasicDetails, this.LOAN_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, loanBasicDetails, this.loanDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -930,7 +930,7 @@ public class LoansApiResource {
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
|
||||
Collection<GlimRepaymentTemplate> glimRepaymentTemplate = this.glimAccountInfoReadPlatformService.findglimRepaymentTemplate(glimId);
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.glimTemplateToApiJsonSerializer.serialize(settings, glimRepaymentTemplate, this.GLIM_ACCOUNTS_DATA_PARAMETERS);
|
||||
return this.glimTemplateToApiJsonSerializer.serialize(settings, glimRepaymentTemplate, this.glimAccountsDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+7
-7
@@ -90,7 +90,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Loan Products", description = "A Loan product is a template that is used when creating a loan. Much of the template definition can be overridden during loan creation.")
|
||||
public class LoanProductsApiResource {
|
||||
|
||||
private final Set<String> LOAN_PRODUCT_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "shortName", "description", "fundId",
|
||||
private final Set<String> loanProductDataParameters = new HashSet<>(Arrays.asList("id", "name", "shortName", "description", "fundId",
|
||||
"fundName", "includeInBorrowerCycle", "currency", "principal", "minPrincipal", "maxPrincipal", "numberOfRepayments",
|
||||
"minNumberOfRepayments", "maxNumberOfRepayments", "repaymentEvery", "repaymentFrequencyType", "graceOnPrincipalPayment",
|
||||
"recurringMoratoriumOnPrincipalPeriods", "graceOnInterestPayment", "graceOnInterestCharged", "interestRatePerPeriod",
|
||||
@@ -106,7 +106,7 @@ public class LoanProductsApiResource {
|
||||
LoanProductConstants.CAN_USE_FOR_TOPUP, LoanProductConstants.IS_EQUAL_AMORTIZATION_PARAM,
|
||||
LoanProductConstants.RATES_PARAM_NAME));
|
||||
|
||||
private final Set<String> PRODUCT_MIX_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> productMixDataParameters = new HashSet<>(
|
||||
Arrays.asList("productId", "productName", "restrictedProducts", "allowedProducts", "productOptions"));
|
||||
|
||||
private final String resourceNameForPermissions = "LOANPRODUCT";
|
||||
@@ -210,13 +210,13 @@ public class LoanProductsApiResource {
|
||||
if (associationParameters.contains("productMixes")) {
|
||||
this.context.authenticatedUser().validateHasReadPermission("PRODUCTMIX");
|
||||
final Collection<ProductMixData> productMixes = this.productMixReadPlatformService.retrieveAllProductMixes();
|
||||
return this.productMixDataApiJsonSerializer.serialize(settings, productMixes, this.PRODUCT_MIX_DATA_PARAMETERS);
|
||||
return this.productMixDataApiJsonSerializer.serialize(settings, productMixes, this.productMixDataParameters);
|
||||
}
|
||||
}
|
||||
|
||||
final Collection<LoanProductData> products = this.loanProductReadPlatformService.retrieveAllLoanProducts();
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, products, this.LOAN_PRODUCT_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, products, this.loanProductDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -238,13 +238,13 @@ public class LoanProductsApiResource {
|
||||
|
||||
final Collection<LoanProductData> productOptions = this.loanProductReadPlatformService.retrieveAvailableLoanProductsForMix();
|
||||
final ProductMixData productMixData = ProductMixData.template(productOptions);
|
||||
return this.productMixDataApiJsonSerializer.serialize(settings, productMixData, this.PRODUCT_MIX_DATA_PARAMETERS);
|
||||
return this.productMixDataApiJsonSerializer.serialize(settings, productMixData, this.productMixDataParameters);
|
||||
}
|
||||
|
||||
LoanProductData loanProduct = this.loanProductReadPlatformService.retrieveNewLoanProductDetails();
|
||||
loanProduct = handleTemplate(loanProduct);
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, loanProduct, this.LOAN_PRODUCT_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, loanProduct, this.loanProductDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -285,7 +285,7 @@ public class LoanProductsApiResource {
|
||||
if (settings.isTemplate()) {
|
||||
loanProduct = handleTemplate(loanProduct);
|
||||
}
|
||||
return this.toApiJsonSerializer.serialize(settings, loanProduct, this.LOAN_PRODUCT_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, loanProduct, this.loanProductDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+2
-2
@@ -56,7 +56,7 @@ public class ProductMixApiResource {
|
||||
|
||||
private final String resourceNameForPermissions = "PRODUCTMIX";
|
||||
|
||||
private final Set<String> PRODUCT_MIX_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> productMixDataParameters = new HashSet<>(
|
||||
Arrays.asList("productId", "productName", "restrictedProducts", "allowedProducts", "productOptions"));
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
@@ -95,7 +95,7 @@ public class ProductMixApiResource {
|
||||
final Collection<LoanProductData> productOptions = this.loanProductReadPlatformService.retrieveAvailableLoanProductsForMix();
|
||||
productMixData = ProductMixData.withTemplateOptions(productMixData, productOptions);
|
||||
}
|
||||
return this.toApiJsonSerializer.serialize(settings, productMixData, this.PRODUCT_MIX_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, productMixData, this.productMixDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+3
-3
@@ -67,7 +67,7 @@ import org.springframework.stereotype.Component;
|
||||
@Tag(name = "Notes", description = "Notes API allows to enter notes for supported resources.")
|
||||
public class NotesApiResource {
|
||||
|
||||
private final Set<String> NOTE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> noteDataParemeters = new HashSet<>(
|
||||
Arrays.asList("id", "clientId", "groupId", "loanId", "loanTransactionId", "depositAccountId", "savingAccountId", "noteType",
|
||||
"note", "createdById", "createdByUsername", "createdOn", "updatedById", "updatedByUsername", "updatedOn"));
|
||||
|
||||
@@ -113,7 +113,7 @@ public class NotesApiResource {
|
||||
final Collection<NoteData> notes = this.readPlatformService.retrieveNotesByResource(resourceId, noteTypeId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, notes, this.NOTE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, notes, this.noteDataParemeters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -143,7 +143,7 @@ public class NotesApiResource {
|
||||
final NoteData note = this.readPlatformService.retrieveNote(noteId, resourceId, noteTypeId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, note, this.NOTE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, note, this.noteDataParemeters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ import org.springframework.stereotype.Component;
|
||||
@Scope("singleton")
|
||||
public class RateApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "name", "percentage", "productApply", "active"));
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("id", "name", "percentage", "productApply", "active"));
|
||||
private final String resourceNameForPermissions = "RATE";
|
||||
private final PlatformSecurityContext context;
|
||||
private final RateReadService readPlatformService;
|
||||
@@ -87,7 +87,7 @@ public class RateApiResource {
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, rate, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, rate, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -113,7 +113,7 @@ public class RateApiResource {
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, rates, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, rates, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+1
@@ -127,6 +127,7 @@ import org.springframework.util.CollectionUtils;
|
||||
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
||||
@DiscriminatorColumn(name = "deposit_type_enum", discriminatorType = DiscriminatorType.INTEGER)
|
||||
@DiscriminatorValue("100")
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
public class SavingsAccount extends AbstractPersistableCustom {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SavingsAccount.class);
|
||||
|
||||
+3
-3
@@ -57,7 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service
|
||||
public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements FixedDepositProductWritePlatformService {
|
||||
|
||||
private final Logger LOG;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(FixedDepositProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||
private final PlatformSecurityContext context;
|
||||
private final FixedDepositProductRepository fixedDepositProductRepository;
|
||||
private final DepositProductDataValidator fromApiJsonDataValidator;
|
||||
@@ -75,7 +75,7 @@ public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements
|
||||
this.fixedDepositProductRepository = fixedDepositProductRepository;
|
||||
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
||||
this.depositProductAssembler = depositProductAssembler;
|
||||
this.LOG = LoggerFactory.getLogger(FixedDepositProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||
|
||||
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
||||
this.chartAssembler = chartAssembler;
|
||||
}
|
||||
@@ -206,6 +206,6 @@ public class FixedDepositProductWritePlatformServiceJpaRepositoryImpl implements
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||
this.LOG.error("Error occured.", dae);
|
||||
LOG.error("Error occured.", dae);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -57,7 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service
|
||||
public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implements RecurringDepositProductWritePlatformService {
|
||||
|
||||
private final Logger LOG;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||
private final PlatformSecurityContext context;
|
||||
private final RecurringDepositProductRepository recurringDepositProductRepository;
|
||||
private final DepositProductDataValidator fromApiJsonDataValidator;
|
||||
@@ -75,7 +75,7 @@ public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implem
|
||||
this.recurringDepositProductRepository = recurringDepositProductRepository;
|
||||
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
||||
this.depositProductAssembler = depositProductAssembler;
|
||||
this.LOG = LoggerFactory.getLogger(RecurringDepositProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||
|
||||
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
||||
this.chartAssembler = chartAssembler;
|
||||
}
|
||||
@@ -206,6 +206,6 @@ public class RecurringDepositProductWritePlatformServiceJpaRepositoryImpl implem
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||
this.LOG.error("Error occured.", dae);
|
||||
LOG.error("Error occured.", dae);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -58,7 +58,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service
|
||||
public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements SavingsProductWritePlatformService {
|
||||
|
||||
private final Logger LOG;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SavingsProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||
private final PlatformSecurityContext context;
|
||||
private final SavingsProductRepository savingProductRepository;
|
||||
private final SavingsProductDataValidator fromApiJsonDataValidator;
|
||||
@@ -76,7 +76,6 @@ public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
this.savingProductRepository = savingProductRepository;
|
||||
this.fromApiJsonDataValidator = fromApiJsonDataValidator;
|
||||
this.savingsProductAssembler = savingsProductAssembler;
|
||||
this.LOG = LoggerFactory.getLogger(SavingsProductWritePlatformServiceJpaRepositoryImpl.class);
|
||||
this.accountMappingWritePlatformService = accountMappingWritePlatformService;
|
||||
this.fineractEntityAccessUtil = fineractEntityAccessUtil;
|
||||
}
|
||||
@@ -104,7 +103,7 @@ public class SavingsProductWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
}
|
||||
|
||||
private void logAsErrorUnexpectedDataIntegrityException(final Exception dae) {
|
||||
this.LOG.error("Error occured.", dae);
|
||||
LOG.error("Error occured.", dae);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
+3
-3
@@ -52,7 +52,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service
|
||||
public class SelfBeneficiariesTPTWritePlatformServiceImpl implements SelfBeneficiariesTPTWritePlatformService {
|
||||
|
||||
private final Logger LOG;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SelfBeneficiariesTPTWritePlatformServiceImpl.class);
|
||||
private final PlatformSecurityContext context;
|
||||
private final SelfBeneficiariesTPTRepository repository;
|
||||
private final SelfBeneficiariesTPTDataValidator validator;
|
||||
@@ -68,7 +68,7 @@ public class SelfBeneficiariesTPTWritePlatformServiceImpl implements SelfBenefic
|
||||
this.validator = validator;
|
||||
this.loanRepositoryWrapper = loanRepositoryWrapper;
|
||||
this.savingRepositoryWrapper = savingRepositoryWrapper;
|
||||
this.LOG = LoggerFactory.getLogger(SelfBeneficiariesTPTWritePlatformServiceImpl.class);
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -178,7 +178,7 @@ public class SelfBeneficiariesTPTWritePlatformServiceImpl implements SelfBenefic
|
||||
"Beneficiary with name `" + name + "` already exists", NAME_PARAM_NAME, name);
|
||||
}
|
||||
|
||||
this.LOG.error("Error occured.", dae);
|
||||
LOG.error("Error occured.", dae);
|
||||
throw new PlatformDataIntegrityException("error.msg.beneficiary.unknown.data.integrity.issue",
|
||||
"Unknown data integrity issue with resource.");
|
||||
}
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ import java.util.Set;
|
||||
/**
|
||||
* Created by Chirag Gupta on 12/19/17.
|
||||
*/
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
final class SelfLoansApiResourceSwagger {
|
||||
|
||||
private SelfLoansApiResourceSwagger() {}
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class AccountEntityServiceForLoanImpl implements AccountEntityService {
|
||||
|
||||
private final String KEY = EntityAccountType.LOAN.name();
|
||||
private final String key = EntityAccountType.LOAN.name();
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final AppuserLoansMapperReadService appuserLoansMapperReadService;
|
||||
@@ -48,7 +48,7 @@ public class AccountEntityServiceForLoanImpl implements AccountEntityService {
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return KEY;
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class AccountEntityServiceForSavingsImpl implements AccountEntityService {
|
||||
|
||||
private final String KEY = EntityAccountType.SAVINGS.name();
|
||||
private final String key = EntityAccountType.SAVINGS.name();
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final AppuserSavingsMapperReadService appuserSavingsMapperReadService;
|
||||
@@ -49,7 +49,7 @@ public class AccountEntityServiceForSavingsImpl implements AccountEntityService
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return KEY;
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class AccountEntityServiceForShareAccountsImpl implements AccountEntityService {
|
||||
|
||||
private final String KEY = EntityAccountType.SHARES.name();
|
||||
private final String key = EntityAccountType.SHARES.name();
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final AppUserShareAccountsMapperReadPlatformService appUserShareAccountsMapperReadPlatformService;
|
||||
@@ -47,7 +47,7 @@ public class AccountEntityServiceForShareAccountsImpl implements AccountEntitySe
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return KEY;
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import java.util.Set;
|
||||
/**
|
||||
* Created by Kang Breder on 05/08/19.
|
||||
*/
|
||||
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
final class SelfShareAccountsApiResourceSwagger {
|
||||
|
||||
private SelfShareAccountsApiResourceSwagger() {
|
||||
|
||||
+11
-11
@@ -81,9 +81,9 @@ import org.springframework.stereotype.Component;
|
||||
+ "UGDs can be assigned to an entity like client or loan and be of a type like Document or SMS. The entity and type of a UGD is only there for the convenience of user agents (UIs), in order to know where to show UGDs for the user (i.e. which tab). The Template Engine back-end runner does not actually need this metadata.")
|
||||
public class TemplatesApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_TEMPLATES_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id"));
|
||||
private final Set<String> RESPONSE_TEMPLATE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "entities", "types", "template"));
|
||||
private final String RESOURCE_NAME_FOR_PERMISSION = "template";
|
||||
private final Set<String> responseTemplatesDataParameters = new HashSet<>(Arrays.asList("id"));
|
||||
private final Set<String> responseTemplateDataParameters = new HashSet<>(Arrays.asList("id", "entities", "types", "template"));
|
||||
private final String resourceNameForPermission = "template";
|
||||
|
||||
private final PlatformSecurityContext context;
|
||||
private final DefaultToApiJsonSerializer<Template> toApiJsonSerializer;
|
||||
@@ -120,7 +120,7 @@ public class TemplatesApiResource {
|
||||
@DefaultValue("-1") @QueryParam("entityId") @Parameter(description = "entityId") final int entityId,
|
||||
@Context final UriInfo uriInfo) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.RESOURCE_NAME_FOR_PERMISSION);
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||
|
||||
// FIXME - we dont use the ORM when doing fetches - we write SQL and
|
||||
// fetch through JDBC returning data to be serialized to JSON
|
||||
@@ -133,7 +133,7 @@ public class TemplatesApiResource {
|
||||
}
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, templates, this.RESPONSE_TEMPLATES_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, templates, this.responseTemplatesDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -145,12 +145,12 @@ public class TemplatesApiResource {
|
||||
@ApiResponse(responseCode = "200", description = "", content = @Content(schema = @Schema(implementation = TemplatesApiResourcesSwagger.GetTemplatesTemplateResponse.class))) })
|
||||
public String template(@Context final UriInfo uriInfo) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.RESOURCE_NAME_FOR_PERMISSION);
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||
|
||||
final TemplateData templateData = TemplateData.template();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.templateDataApiJsonSerializer.serialize(settings, templateData, this.RESPONSE_TEMPLATES_DATA_PARAMETERS);
|
||||
return this.templateDataApiJsonSerializer.serialize(settings, templateData, this.responseTemplatesDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -175,24 +175,24 @@ public class TemplatesApiResource {
|
||||
public String retrieveOne(@PathParam("templateId") @Parameter(description = "templateId") final Long templateId,
|
||||
@Context final UriInfo uriInfo) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.RESOURCE_NAME_FOR_PERMISSION);
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||
|
||||
final Template template = this.templateService.findOneById(templateId);
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, template, this.RESPONSE_TEMPLATES_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, template, this.responseTemplatesDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("{templateId}/template")
|
||||
public String getTemplateByTemplate(@PathParam("templateId") final Long templateId, @Context final UriInfo uriInfo) {
|
||||
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.RESOURCE_NAME_FOR_PERMISSION);
|
||||
this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermission);
|
||||
|
||||
final TemplateData template = TemplateData.template(this.templateService.findOneById(templateId));
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.templateDataApiJsonSerializer.serialize(settings, template, this.RESPONSE_TEMPLATE_DATA_PARAMETERS);
|
||||
return this.templateDataApiJsonSerializer.serialize(settings, template, this.responseTemplateDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ import org.springframework.stereotype.Component;
|
||||
+ "Permissions are not updated, except in the case of enabling or disabling non-read transactions for Maker Checker functionality")
|
||||
public class PermissionsApiResource {
|
||||
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("grouping", "code", "entityName", "actionName", "selected", "isMakerChecker"));
|
||||
private final String resourceNameForPermissions = "PERMISSION";
|
||||
|
||||
@@ -107,7 +107,7 @@ public class PermissionsApiResource {
|
||||
permissions = this.permissionReadPlatformService.retrieveAllPermissions();
|
||||
}
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, permissions, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, permissions, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+5
-5
@@ -71,13 +71,13 @@ public class RolesApiResource {
|
||||
/**
|
||||
* The set of parameters that are supported in response for {@link RoleData}
|
||||
*/
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> responseDataParameters = new HashSet<>(
|
||||
Arrays.asList("id", "name", "description", "availablePermissions", "selectedPermissions"));
|
||||
|
||||
/**
|
||||
* The set of parameters that are supported in response for {@link RoleData}
|
||||
*/
|
||||
private final Set<String> PERMISSIONS_RESPONSE_DATA_PARAMETERS = new HashSet<>(
|
||||
private final Set<String> permissionsResponseParameters = new HashSet<>(
|
||||
Arrays.asList("id", "name", "description", "permissionUsageData"));
|
||||
|
||||
private final String resourceNameForPermissions = "ROLE";
|
||||
@@ -119,7 +119,7 @@ public class RolesApiResource {
|
||||
final Collection<RoleData> roles = this.roleReadPlatformService.retrieveAll();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, roles, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, roles, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
@@ -156,7 +156,7 @@ public class RolesApiResource {
|
||||
|
||||
final RoleData role = this.roleReadPlatformService.retrieveOne(roleId);
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, role, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, role, this.responseDataParameters);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,7 +233,7 @@ public class RolesApiResource {
|
||||
final RoleData role = this.roleReadPlatformService.retrieveOne(roleId);
|
||||
final Collection<PermissionData> permissionUsageData = this.permissionReadPlatformService.retrieveAllRolePermissions(roleId);
|
||||
final RolePermissionsData permissionsData = role.toRolePermissionData(permissionUsageData);
|
||||
return this.permissionsToApiJsonSerializer.serialize(settings, permissionsData, this.PERMISSIONS_RESPONSE_DATA_PARAMETERS);
|
||||
return this.permissionsToApiJsonSerializer.serialize(settings, permissionsData, this.permissionsResponseParameters);
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ import java.util.Collection;
|
||||
/**
|
||||
* Created by sanyam on 23/8/17.
|
||||
*/
|
||||
@SuppressWarnings({ "MemberName" })
|
||||
final class RolesApiResourceSwagger {
|
||||
|
||||
private RolesApiResourceSwagger() {
|
||||
|
||||
+5
-5
@@ -76,8 +76,8 @@ public class UsersApiResource {
|
||||
/**
|
||||
* The set of parameters that are supported in response for {@link AppUserData}.
|
||||
*/
|
||||
private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("id", "officeId", "officeName", "username",
|
||||
"firstname", "lastname", "email", "allowedOffices", "availableRoles", "selectedRoles", "staff"));
|
||||
private final Set<String> responseDataParameters = new HashSet<>(Arrays.asList("id", "officeId", "officeName", "username", "firstname",
|
||||
"lastname", "email", "allowedOffices", "availableRoles", "selectedRoles", "staff"));
|
||||
|
||||
private final String resourceNameForPermissions = "USER";
|
||||
|
||||
@@ -121,7 +121,7 @@ public class UsersApiResource {
|
||||
final Collection<AppUserData> users = this.readPlatformService.retrieveAllUsers();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, users, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, users, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -144,7 +144,7 @@ public class UsersApiResource {
|
||||
user = AppUserData.template(user, offices);
|
||||
}
|
||||
|
||||
return this.toApiJsonSerializer.serialize(settings, user, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, user, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@GET
|
||||
@@ -162,7 +162,7 @@ public class UsersApiResource {
|
||||
final AppUserData user = this.readPlatformService.retrieveNewUserDetails();
|
||||
|
||||
final ApiRequestJsonSerializationSettings settings = this.apiRequestParameterHelper.process(uriInfo.getQueryParameters());
|
||||
return this.toApiJsonSerializer.serialize(settings, user, this.RESPONSE_DATA_PARAMETERS);
|
||||
return this.toApiJsonSerializer.serialize(settings, user, this.responseDataParameters);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ final class UsersApiResourceSwagger {
|
||||
@Schema(example = "1")
|
||||
public Long staffId;
|
||||
@Schema(example = "[2,3]")
|
||||
public String Roles;
|
||||
public String roles;
|
||||
@Schema(example = "true")
|
||||
public Boolean sendPasswordToEmail;
|
||||
@Schema(example = "true")
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
class MultiExceptionTest {
|
||||
|
||||
Logger LOG = LoggerFactory.getLogger(MultiExceptionTest.class);
|
||||
private static Logger LOG = LoggerFactory.getLogger(MultiExceptionTest.class);
|
||||
|
||||
@Test()
|
||||
void testEmpty() throws MultiException {
|
||||
|
||||
Reference in New Issue
Block a user