fineract-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nazeer1100126 <...@git.apache.org>
Subject [GitHub] incubator-fineract pull request #215: creditbureau configuration
Date Mon, 21 Nov 2016 09:30:43 GMT
Github user nazeer1100126 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/215#discussion_r88602844
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/CreditCheck/api/CreditBureauConfigurationAPI.java
---
    @@ -0,0 +1,350 @@
    +package org.apache.fineract.CreditCheck.api;
    +
    +import java.util.Arrays;
    +import java.util.Collection;
    +import java.util.HashSet;
    +import java.util.Set;
    +
    +import javax.ws.rs.Consumes;
    +import javax.ws.rs.GET;
    +import javax.ws.rs.POST;
    +import javax.ws.rs.PUT;
    +import javax.ws.rs.Path;
    +import javax.ws.rs.PathParam;
    +import javax.ws.rs.Produces;
    +import javax.ws.rs.core.Context;
    +import javax.ws.rs.core.MediaType;
    +import javax.ws.rs.core.UriInfo;
    +
    +import org.apache.fineract.CreditCheck.data.CreditBureauData;
    +import org.apache.fineract.CreditCheck.data.CreditBureauLpMappingData;
    +import org.apache.fineract.CreditCheck.data.OrganisationCreditbureauData;
    +import org.apache.fineract.CreditCheck.service.CreditBureauLpMappingReadPlatformService;
    +import org.apache.fineract.CreditCheck.service.CreditBureauReadPlatformService;
    +import org.apache.fineract.CreditCheck.service.OrganisationCreditBureauReadPlatformService;
    +import org.apache.fineract.commands.domain.CommandWrapper;
    +import org.apache.fineract.commands.service.CommandWrapperBuilder;
    +import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService;
    +import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
    +import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
    +import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
    +import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
    +import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.context.annotation.Scope;
    +import org.springframework.stereotype.Component;
    +
    +
    +
    +@Path("/cbconfig")
    +@Component
    +@Scope("singleton")
    +public class CreditBureauConfigurationAPI 
    +{
    +    private final Set<String> RESPONSE_DATA_PARAMETERS = new HashSet<>(Arrays.asList("cb_id","alias",
    +            "country","cb_product_id","start_date","end_date","is_active"));
    +    private final String resourceNameForPermissions = "CreditBureau";
    +    private final PlatformSecurityContext context;
    +    private final CreditBureauReadPlatformService readPlatformService; 
    +    private final DefaultToApiJsonSerializer<CreditBureauData> toApiJsonSerializer;
    +    private final CreditBureauLpMappingReadPlatformService readPlatformServiceCbLp;
    +    private final OrganisationCreditBureauReadPlatformService readPlatformServiceOrgCb;
    +    private final DefaultToApiJsonSerializer<CreditBureauLpMappingData> toApiJsonSerializerCbLp;

    +    private final DefaultToApiJsonSerializer<OrganisationCreditbureauData> toApiJsonSerializerOrgCb;

    +  /*  private final CreditBureauMasterReadPlatformService readPlatformServiceMaster;
    +    private final DefaultToApiJsonSerializer<CreditBureauData> toApiJsonSerializer;
 
    +    private final DefaultToApiJsonSerializer<CreditBureauLpMappingData> toApiJsonSerializerCbLp;

    +    private final DefaultToApiJsonSerializer<CreditBureauProduct> toApiJsonSerializerCbp;

    +    private final DefaultToApiJsonSerializer<CreditBureauMasterData> toApiJsonSerializerCbm;
*/
    +    private final ApiRequestParameterHelper apiRequestParameterHelper;
    +    private final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService;
    +  
    + /*   
    +    @Autowired
    +    public CreditBureauConfigurationAPI(final PlatformSecurityContext context, final
CreditBureauReadPlatformService readPlatformService,
    +            final CreditBureauLpMappingReadPlatformService readPlatformServiceCbLp,final
DefaultToApiJsonSerializer<CreditBureauProduct> toApiJsonSerializerCbp,
    +            final CreditBureauMasterReadPlatformService readPlatformServiceMaster,
    +            final DefaultToApiJsonSerializer<CreditBureauData> toApiJsonSerializer,final
DefaultToApiJsonSerializer<CreditBureauLpMappingData> toApiJsonSerializerCbLp,
    +            final DefaultToApiJsonSerializer<CreditBureauMasterData> toApiJsonSerializerCbm,final
ApiRequestParameterHelper apiRequestParameterHelper,
    +            final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService)
    +    {
    +        
    +    this.context = context;
    +    this.readPlatformService = readPlatformService;
    +    this.readPlatformServiceCbLp=readPlatformServiceCbLp;
    +    this.toApiJsonSerializerCbp=toApiJsonSerializerCbp;
    +    this.readPlatformServiceMaster=readPlatformServiceMaster;
    +    this.toApiJsonSerializer = toApiJsonSerializer;
    +    this.toApiJsonSerializerCbLp=toApiJsonSerializerCbLp;
    +    this.toApiJsonSerializerCbm=toApiJsonSerializerCbm;
    +    this.apiRequestParameterHelper = apiRequestParameterHelper;
    +    this.commandsSourceWritePlatformService = commandsSourceWritePlatformService;
    + 
    +        
    +    }*/
    +    
    +    @Autowired
    +    public CreditBureauConfigurationAPI(final PlatformSecurityContext context, final
CreditBureauReadPlatformService readPlatformService, final DefaultToApiJsonSerializer<CreditBureauData>
toApiJsonSerializer,
    +            final CreditBureauLpMappingReadPlatformService readPlatformServiceCbLp,final
DefaultToApiJsonSerializer<CreditBureauLpMappingData> toApiJsonSerializerCbLp,
    +            final OrganisationCreditBureauReadPlatformService readPlatformServiceOrgCb,final
DefaultToApiJsonSerializer<OrganisationCreditbureauData> toApiJsonSerializerOrgCb,final
ApiRequestParameterHelper apiRequestParameterHelper,
    +            final PortfolioCommandSourceWritePlatformService commandsSourceWritePlatformService)
    +    {
    +        this.context=context;
    +        this.readPlatformService=readPlatformService;
    +        this.apiRequestParameterHelper=apiRequestParameterHelper;
    +        this.readPlatformServiceCbLp=readPlatformServiceCbLp;
    +        this.toApiJsonSerializerCbLp=toApiJsonSerializerCbLp;
    +        this.readPlatformServiceOrgCb=readPlatformServiceOrgCb;
    +        this.toApiJsonSerializerOrgCb=toApiJsonSerializerOrgCb;
    +        this.toApiJsonSerializer=toApiJsonSerializer;
    +        this.commandsSourceWritePlatformService=commandsSourceWritePlatformService;
    +    }
    +    
    +    
    +    
    +    @GET
    +    @Consumes({ MediaType.APPLICATION_JSON })
    +    @Produces({ MediaType.APPLICATION_JSON })
    +    public String getCreditBureau(@Context final UriInfo uriInfo)
    +    {
    +        this.context.authenticatedUser().validateHasReadPermission(this.resourceNameForPermissions);
    +
    +        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);
    +       
    +    }
    +    
    +  @GET
    +    @Path("/mappings")
    +    @Consumes({ MediaType.APPLICATION_JSON })
    +    @Produces({ MediaType.APPLICATION_JSON })
    +    public String getCreditBureauLPMapping(@Context final UriInfo uriInfo)
    --- End diff --
    
    LP should be LoanProduct


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message