示例#1
0
        public async Task RegisterToProvideLoans(RegisterModel registerModel)
        {
            bool isProviderLoanExist = await _rulesRepository.CheckProviderLoanExist(registerModel.ProviderLoanId);

            if (isProviderLoanExist)
            {
                throw new DuplicateLoanProviderIdException();
            }
            else
            {
                List <RuleModel> policyRules   = ConvertExcelToRulesObject(registerModel.FilePath);
                List <RuleModel> rulesListToDb = CreateRulesTree(policyRules, registerModel.ProviderLoanId);
                await _rulesRepository.CreatePolicy(rulesListToDb);
            }
        }