tech.deepdreams.worker.deduction.CNAMGSServicev2016Impl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of worker-gab-impl Show documentation
Show all versions of worker-gab-impl Show documentation
Payroll Worker API project for Spring Boot
The newest version!
package tech.deepdreams.worker.deduction;
import java.util.Map;
import tech.deepdreams.worker.api.services.DeductionService;
import tech.deepdreams.worker.api.util.CommonCodes;
import tech.deepdreams.worker.api.enums.CountryCode;
import tech.deepdreams.worker.constants.ElementCode;
import tech.deepdreams.worker.constants.LocalConstantCode;
public class CNAMGSServicev2016Impl implements DeductionService{
public Double calculateEmployee(Map params) {
Double minimumSalary = (Double) params.get(CommonCodes.CODE_SMIG) ;
Double contribSalary = (Double) params.get(LocalConstantCode.CODE_GROSS_TAXABLE_SALARY) ;
return Math.max(Math.min(contribSalary, 2_500_000.0), minimumSalary) * 0.02 ;
}
public Double calculateEmployer(Map params) {
Double minimumSalary = (Double) params.get(CommonCodes.CODE_SMIG) ;
Double contribSalary = (Double) params.get(LocalConstantCode.CODE_GROSS_TAXABLE_SALARY) ;
return Math.max(Math.min(contribSalary, 2_500_000.0), minimumSalary) * 0.041 ;
}
public CountryCode country() {
return CountryCode.GAB ;
}
public String code() {
return ElementCode.CODE_CNAMGS ;
}
public int version() {
return 2016 ;
}
}