예제 #1
0
        private async Task <Deduction> GetHsaDeduction(int employeeId)
        {
            var hsa = await _payrollRepository.GetHsaByEmployee(employeeId);

            if (hsa != null)
            {
                return new Deduction
                       {
                           Amount = hsa.ContributionAmount,
                           Type   = "Hsa"
                       }
            }
            ;

            return(null);
        }
    }
예제 #2
0
        public async Task AddOrUpdateHsa(Hsa hsaMessage)
        {
            var hsa = await _payrollRepository.GetHsaByEmployee(hsaMessage.EmployeeId);

            if (hsa != null)
            {
                hsa.ContributionAmount = hsaMessage.ContributionAmount;
                await _payrollRepository.UpdateHsa(hsa);
            }
            else
            {
                hsa = new Hsa
                {
                    ContributionAmount = hsaMessage.ContributionAmount,
                    EmployeeId         = hsaMessage.EmployeeId
                };

                await _payrollRepository.CreateHsa(hsa);
            }
        }