[ 
https://issues.apache.org/jira/browse/FINERACT-2727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Foo Developer updated FINERACT-2727:
------------------------------------
    Description: 
## Bug                                                                          
                                                                                
                  
                                                                                
                                                                                
                    
  Fineract has a global configuration flag `office-specific-products-enabled`   
                                                                                
                    
  intended to restrict which loan products each office can offer. When enabled, 
                                                                                
                    
  only the products explicitly mapped to an office (via Entity to Entity        
                                                                                
                    
  Mapping) should be available to that office's users.                          
                                                                                
                    
                                                                                
                                                                                
                    
  In practice, enabling this flag causes the opposite of the intended behavior: 
                                                                                
                    
                                                                                
                                                                                
                    
  1. **Entity to Entity Mapping screen** — the Loan Product dropdown in         
                                                                                
                    
     Admin → System → Entity to Entity Mapping → Offices → Loan Products        
                                                                                
                    
     shows only "All" and no individual products. This makes it impossible      
                                                                                
                    
     to create the mappings the feature depends on.                             
                                                                                
                    
                                                                                
                                                                                
                    
  2. **Loan product listing** — all loan products disappear from the listing    
                                                                                
                    
     page for branch users, even products that should be visible (e.g. products 
                                                                                
                    
     mapped to "All" or products with no mapping at all).                       
                                                                                
                    
                                                                                
                                                                                
                    
  3. **Loan application template** — the `/loans/template` API returns an       
                                                                                
                    
     empty product list, blocking any new loan application when the flag is on. 
  
 The root cause is that `retrieveAllLoanProducts()` ignores the                 
                                                                                
                   
  `office-specific-products-enabled` flag entirely. There is no code path that  
                                                                                
                    
  filters or resolves the entity mappings to determine which products are       
                                                                                
                    
  visible to a given office. 
 ## Visibility rules when office-specific-products-enabled is ON                
                                                                                
                   
                                                                                
                                                                                
                    
  A loan product is visible to an office if:                                    
                                                                                
                    
  - It has no entity mapping at all, OR                                         
                                                                                
                    
  - It is mapped to "All", OR                                                   
                                                                                
                    
  - It is explicitly mapped to the user's office or any office in its           
                                                                                
                    
    parent hierarchy.                                                           
                                                                                
                    
                           

> Office to Loan Product Mapping Shows Only “All” When 
> office-specific-products-enabled is Enabled
> ------------------------------------------------------------------------------------------------
>
>                 Key: FINERACT-2727
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2727
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: System
>            Reporter: Foo Developer
>            Assignee: Foo Developer
>            Priority: Major
>
> ## Bug                                                                        
>                                                                               
>                       
>                                                                               
>                                                                               
>                         
>   Fineract has a global configuration flag `office-specific-products-enabled` 
>                                                                               
>                         
>   intended to restrict which loan products each office can offer. When 
> enabled,                                                                      
>                                
>   only the products explicitly mapped to an office (via Entity to Entity      
>                                                                               
>                         
>   Mapping) should be available to that office's users.                        
>                                                                               
>                         
>                                                                               
>                                                                               
>                         
>   In practice, enabling this flag causes the opposite of the intended 
> behavior:                                                                     
>                                 
>                                                                               
>                                                                               
>                         
>   1. **Entity to Entity Mapping screen** — the Loan Product dropdown in       
>                                                                               
>                         
>      Admin → System → Entity to Entity Mapping → Offices → Loan Products      
>                                                                               
>                         
>      shows only "All" and no individual products. This makes it impossible    
>                                                                               
>                         
>      to create the mappings the feature depends on.                           
>                                                                               
>                         
>                                                                               
>                                                                               
>                         
>   2. **Loan product listing** — all loan products disappear from the listing  
>                                                                               
>                         
>      page for branch users, even products that should be visible (e.g. 
> products                                                                      
>                                
>      mapped to "All" or products with no mapping at all).                     
>                                                                               
>                         
>                                                                               
>                                                                               
>                         
>   3. **Loan application template** — the `/loans/template` API returns an     
>                                                                               
>                         
>      empty product list, blocking any new loan application when the flag is 
> on.   
>  The root cause is that `retrieveAllLoanProducts()` ignores the               
>                                                                               
>                        
>   `office-specific-products-enabled` flag entirely. There is no code path 
> that                                                                          
>                             
>   filters or resolves the entity mappings to determine which products are     
>                                                                               
>                         
>   visible to a given office. 
>  ## Visibility rules when office-specific-products-enabled is ON              
>                                                                               
>                        
>                                                                               
>                                                                               
>                         
>   A loan product is visible to an office if:                                  
>                                                                               
>                         
>   - It has no entity mapping at all, OR                                       
>                                                                               
>                         
>   - It is mapped to "All", OR                                                 
>                                                                               
>                         
>   - It is explicitly mapped to the user's office or any office in its         
>                                                                               
>                         
>     parent hierarchy.                                                         
>                                                                               
>                         
>                            



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to