You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@fineract.apache.org by jdc91 <gi...@git.apache.org> on 2016/04/03 21:11:32 UTC

[GitHub] incubator-fineract pull request: [MIFOSX-2310] User allowed to lea...

GitHub user jdc91 opened a pull request:

    https://github.com/apache/incubator-fineract/pull/60

    [MIFOSX-2310] User allowed to leave Max age for LOSS criteria blank.

    Under category we have STANDARD, SUB-STANDARD, DOUBTFUL and LOSS options. In which if the Loss is considered as the last category it would be better to set the Max Age as Infinity (Blank) so that for any loans which are due from very long period falls under that category.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jdc91/incubator-fineract develop

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-fineract/pull/60.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #60
    
----
commit a4602a58899ce174088e24fedc7333d7c1bec797
Author: Dehan <de...@gmail.com>
Date:   2016-04-03T19:09:56Z

    [MIFOSX-2310] User allowed to leave Max age for LOSS criteria blank.
    
    Under category we have STANDARD, SUB-STANDARD, DOUBTFUL and LOSS options. In which if the Loss is considered as the last category it would be better to set the Max Age as Infinity (Blank) so that for any loans which are due from very long period falls under that category.

----


---
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.
---

[GitHub] incubator-fineract pull request: [MIFOSX-2310] User allowed to lea...

Posted by rajuan <gi...@git.apache.org>.
Github user rajuan commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/60#discussion_r59498209
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/serialization/ProvisioningCriteriaDefinitionJsonDeserializer.java ---
    @@ -104,10 +104,20 @@ public void validateForCreate(final String json) {
                             .parameterAtIndexArray(ProvisioningCriteriaConstants.JSON_MINIMUM_AGE_PARAM, i + 1).value(minimumAge).notNull()
                             .longZeroOrGreater() ;
     
    -                Long maximumAge = this.fromApiJsonHelper.extractLongNamed(ProvisioningCriteriaConstants.JSON_MAXIMUM_AGE_PARAM, jsonObject);
    -                baseDataValidator.reset().parameter(ProvisioningCriteriaConstants.JSON_MAXIMUM_AGE_PARAM)
    -                        .parameterAtIndexArray(ProvisioningCriteriaConstants.JSON_MAXIMUM_AGE_PARAM, i + 1).value(maximumAge).notNull()
    -                        .longGreaterThanNumber(ProvisioningCriteriaConstants.JSON_MINIMUM_AGE_PARAM, minimumAge, (i+1));
    +
    +                //Allow Max age of "Loss Category" to be blank => Symbolises infinity// NotNull check removed when  categoryId=4
    +                if(categoryId == 4) {
    --- End diff --
    
    Categories are user configurable. Some organisations can have 3 categories and some other 10. So such hardcoded check will not help. This solution cannot be taken as is. This solution should be generic to allow only one nullable max age param and it doesn't violate overlap conditions. 


---
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.
---

[GitHub] incubator-fineract pull request: [MIFOSX-2310] User allowed to lea...

Posted by jdc91 <gi...@git.apache.org>.
Github user jdc91 commented on a diff in the pull request:

    https://github.com/apache/incubator-fineract/pull/60#discussion_r59589622
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/organisation/provisioning/serialization/ProvisioningCriteriaDefinitionJsonDeserializer.java ---
    @@ -104,10 +104,20 @@ public void validateForCreate(final String json) {
                             .parameterAtIndexArray(ProvisioningCriteriaConstants.JSON_MINIMUM_AGE_PARAM, i + 1).value(minimumAge).notNull()
                             .longZeroOrGreater() ;
     
    -                Long maximumAge = this.fromApiJsonHelper.extractLongNamed(ProvisioningCriteriaConstants.JSON_MAXIMUM_AGE_PARAM, jsonObject);
    -                baseDataValidator.reset().parameter(ProvisioningCriteriaConstants.JSON_MAXIMUM_AGE_PARAM)
    -                        .parameterAtIndexArray(ProvisioningCriteriaConstants.JSON_MAXIMUM_AGE_PARAM, i + 1).value(maximumAge).notNull()
    -                        .longGreaterThanNumber(ProvisioningCriteriaConstants.JSON_MINIMUM_AGE_PARAM, minimumAge, (i+1));
    +
    +                //Allow Max age of "Loss Category" to be blank => Symbolises infinity// NotNull check removed when  categoryId=4
    +                if(categoryId == 4) {
    --- End diff --
    
    I was also confused at this! But the requirement in the issue tracker specifically assumes that there are only 4 categories 
    https://mifosforge.jira.com/browse/MIFOSX-2310
    
    > Currently under category we have "STANDARD", "SUB-STANDARD", "DOUBTFUL" and "LOSS" options.  In which if the Loss is considered as the last category it would be better to set the Max Age as Infinity (Blank)
    
    This is why I uneasily did this fix. Will think of a way to abstract his out!


---
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.
---