rymghosn opened a new pull request, #6286:
URL: https://github.com/apache/fineract/pull/6286

    Currently nothing prevents creating a `TaxComponent` or `TaxGroup` with a   
                                                                     
     name that's already in use, or renaming one to collide with another. This  
                                                                      
     also allowed submitting a `TaxGroup` with the same tax component listed    
                                                                      
     more than once in its `taxComponents` array.
     This PR adds:                                                              
                                                                      
                                                                                
                                                                      
     - On tax component create/update: reject the request if another tax        
                                                                      
       component already has the given `name` (case-sensitive match against     
                                                                      
       `TaxComponentRepository.findByName`, relying on DB collation for exact   
                                                                      
       matching), returning `tax.component.name.must.be.unique`.                
                                                                      
     - On tax group create/update: reject the request if another tax group      
                                                                      
       already has the given `name` (case-insensitive, via                      
                                                                      
       `TaxGroupRepository.existsByNameIgnoreCase` /                            
                                                                      
       `existsByNameIgnoreCaseAndIdNot`), returning                             
                                                                      
       `tax.group.name.must.be.unique`.                                         
                                                                      
     - On tax group create/update: reject a `taxComponents` payload that        
                                                                      
       references the same `taxComponentId` more than once, returning           
                                                                      
       `validation.msg.tax.group.duplicate.component`. 
                                                                                
                                                                          
     Update checks only trigger when the `name` (or, for groups, a component    
                                                                      
     list) is actually being changed, so updates that leave the name untouched  
                                                                      
     are unaffected.
    PR (https://issues.apache.org/jira/browse/FINERACT-2765).    


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to