public IHttpActionResult adviserMakeInsuranceTransactions(InsuranceTransactionModel model) { // edisRepo.AdviserMakeBondsTransactions(model); AccountBase account = null; if (model.account.accountCatagory == AccountCatergories.GroupAccount.ToString()) { account = edisRepo.GetGroupAccountById(model.account.id); } else { account = edisRepo.GetClientAccountById(model.account.id); } account.MakeTransactionSync(new InsuranceTransactionCreation() { AmountInsured = Convert.ToDouble(model.insuranceAmount), EntitiesInsured = model.insuredEntity, ExpiryDate = model.expiryDate, GrantedOn = model.grantedDate, InsuranceType = model.insuranceType, NameOfPolicy = model.insuranceType.ToString(), PolicyType = model.policyType, Premium = Convert.ToDouble(model.premium), IsAcquire = model.isAquired, Issuer = model.issuer, PolicyAddress = model.policyAddress, PolicyNumber = model.policyNumber }); return(Ok()); }
public IHttpActionResult adviserMakePropertyTransactions(PropertyTransactionModel model) { AccountBase account = null; if (model.Account.accountCatagory == AccountCatergories.GroupAccount.ToString()) { account = edisRepo.GetGroupAccountById(model.Account.id); } else { account = edisRepo.GetClientAccountById(model.Account.id); } List <TransactionFeeRecordCreation> feeRecords = new List <TransactionFeeRecordCreation>(); feeRecords.Add(new TransactionFeeRecordCreation { Amount = model.TransactionFee, TransactionExpenseType = TransactionExpenseType.LiabilityProcessingFee }); HomeLoanTransactionCreation homeLoan = new HomeLoanTransactionCreation { GrantedOn = model.GrantedDate, LoanAmount = model.LoanAmount, LoanRate = model.LoanRate, TypeOfMortgageRates = (TypeOfMortgageRates)Enum.Parse(typeof(TypeOfMortgageRates), model.TypeOfRate), ExpiryDate = model.ExpiryDate, LoanRepaymentType = LoanRepaymentType.DirectDebt, IsAcquire = true, Institution = model.Institution }; account.MakeTransactionSync(new PropertyTransactionCreation { FullAddress = model.PropertyAddress, Price = model.PropertyPrice, PropertyType = model.PropertyType.ToString(), TransactionDate = model.TransactionDate, FeesRecords = feeRecords, IsBuy = true, loan = homeLoan }); return(Ok()); }