public void GetSessionDatabyUserIdAndUserDataId() { var userDataId = 0L; // for getting UserDataId BusinessObject.Tax1040 tax1040 = new BusinessObject.Tax1040(); tax1040.UserDataId = 0; userDataId = Utilities.PersistTaxObject(userId, userDataId, tax1040); UserDTO userDTO = new UserDTO(); userDTO.UserDataId = userDataId; userDTO.UserId = userId; string sessionData = "http://192.168.1.10:1040/"; mTaxReturnRepository.PersistSessionData(userId, userDataId, sessionData); string taxdata = mTaxReturnRepository.GetSessionDatabyUserIdAndUserDataId(userDTO); Assert.AreEqual(sessionData, taxdata); }
public void HasStateAndLocalTaxDeductionPriorYearNotGiven() { var hasEligibilityDiagnostics = false; //Prepare Other Income var expectedOtherIncome = new OtherIncome() { HasStateTaxRefund = true, StateOrLocalIncomeTaxRefunds = new StateOrLocalIncomeTaxRefunds() { HasClaimedItemizedDeductionPriorYear = true, HasStateAndLocalTaxDeductionPriorYear = null } }; mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedOtherIncome); //Persist Other Income mUserData.userId = mUserId; mUserData.TaxReturnData = JsonConvert.SerializeObject(mTaxReturnData); var actualOtherIncomeData = mOtherIncomeRepository.PersistOtherIncome(mUserData); //Get Other Income BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserData.userId, actualOtherIncomeData.Item1); Assert.IsTrue(taxObject.ErrorMessages.Count > 0); hasEligibilityDiagnostics = taxObject.ErrorMessages.Any(em => (em.ErrorCode == "OtherIncome_RF4")); Assert.IsTrue(hasEligibilityDiagnostics); }
public void TaxPayerFederalTaxWithheldGreaterThanTaxpayerNetBenefits() { //Prepare Other Income var expectedOtherIncome = new OtherIncome() { SSB = new SocialSecurityBenefits() { TaxpayerNetBenefits = 500, TaxPayerFederalTaxWithheld = 1000, SpouseNetBenefits = 500, SpouseFederalTaxWithheld = 1000 } }; mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedOtherIncome); //Persist Other Income mUserData.userId = mUserId; mUserData.TaxReturnData = JsonConvert.SerializeObject(mTaxReturnData); var actualOtherIncomeData = mOtherIncomeRepository.PersistOtherIncome(mUserData); //Get Other Income BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserData.userId, actualOtherIncomeData.Item1); Assert.IsTrue(taxObject.ErrorMessages.Count > 0); mLstTaxObjectErrors = taxObject.ErrorMessages.Where(err => err.Topic == Constants.TOPIC_UNEMPLOYMENT_COMPENSATION && err.MessageType.StartsWith("BR")); foreach (var errorMsg in mLstTaxObjectErrors) { Assert.IsNotNull(errorMsg.ErrorCode); } }
public void TaxpayerNetBenefitsAndTaxpayerNetBenefitsNotGiven() { var hasEligibilityDiagnostics = false; //Prepare Other Income var expectedOtherIncome = new OtherIncome() { HasSsbAndRrb = true, SSB = new SocialSecurityBenefits() { TaxpayerNetBenefits = null }, RRB = new RailroadRetirementIncome() { TaxpayerNetBenefits = null } }; mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedOtherIncome); //Persist Other Income mUserData.userId = mUserId; mUserData.TaxReturnData = JsonConvert.SerializeObject(mTaxReturnData); var actualOtherIncomeData = mOtherIncomeRepository.PersistOtherIncome(mUserData); //Get Other Income BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserData.userId, actualOtherIncomeData.Item1); Assert.IsTrue(taxObject.ErrorMessages.Count > 0); hasEligibilityDiagnostics = taxObject.ErrorMessages.Any(em => (em.ErrorCode == "OtherIncome_RF1")); Assert.IsTrue(hasEligibilityDiagnostics); }
public void PrimaryTaxpayerAlaskaFundDividendAndSpouseAlaskaFundDividendNotGiven() { var hasEligibilityDiagnostics = false; //Prepare Other Income var expectedOtherIncome = new OtherIncome() { HasAlaskaPermanantFund = true, AlaskaPermanentFundDividend = new AlaskaPermanentFundDividend() { PrimaryTaxpayerAlaskaFundDividend = null, SpouseAlaskaFundDividend = null } }; mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedOtherIncome); //Persist Other Income mUserData.userId = mUserId; mUserData.TaxReturnData = JsonConvert.SerializeObject(mTaxReturnData); var actualOtherIncomeData = mOtherIncomeRepository.PersistOtherIncome(mUserData); //Get Other Income BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserData.userId, actualOtherIncomeData.Item1); Assert.IsTrue(taxObject.ErrorMessages.Count > 0); hasEligibilityDiagnostics = taxObject.ErrorMessages.Any(em => (em.ErrorCode == "OtherIncome_RF2")); Assert.IsTrue(hasEligibilityDiagnostics); }
public void StateTaxWithholdingAmountNotGreaterThanUnEmploymentCompensation() { //Prepare Form 1099G var expectedForm1099G = CreateForm1099G(); expectedForm1099G.UnEmploymentCompensation = 100; foreach (var stateInfo in expectedForm1099G.Form1099StateInfo) { stateInfo.StateTaxWithholdingAmount = 1000.00; } mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedForm1099G); //Persist Form 1099G var actualForm1099GData = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData); //Get Form 1099G with all validations BusinessObject.Tax1040 actualForm1099G = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserInputData.userId, actualForm1099GData.UserDataId); Assert.IsTrue(actualForm1099G.ErrorMessages.Count > 0); mLstTaxObjectErrors = actualForm1099G.ErrorMessages.Where(err => err.Topic == Constants.TOPIC_UNEMPLOYMENT_COMPENSATION && err.MessageType.StartsWith("BR")); foreach (var errorMsg in mLstTaxObjectErrors) { Assert.IsNotNull(errorMsg.ErrorCode); } }
public void HasStateAndLocalTaxDeductionPriorYear() { //Prepare Other Income var expectedOtherIncome = new OtherIncome() { StateOrLocalIncomeTaxRefunds = new StateOrLocalIncomeTaxRefunds() { HasStateAndLocalTaxDeductionPriorYear = true }, HasClaimedItemizedDeductionPriorYear = true, HasStateAndLocalTaxDeductionPriorYear = true }; mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedOtherIncome); //Persist Other Income mUserData.userId = mUserId; mUserData.TaxReturnData = JsonConvert.SerializeObject(mTaxReturnData); var actualOtherIncomeData = mOtherIncomeRepository.PersistOtherIncome(mUserData); //Get Other Income BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserData.userId, actualOtherIncomeData.Item1); Assert.IsTrue(taxObject.ErrorMessages.Count > 0); mLstTaxObjectErrors = taxObject.ErrorMessages.Where(err => err.Topic == Constants.TOPIC_OTHER_INCOME && err.MessageType.StartsWith("ER")); foreach (var actualOtherIncome in mLstTaxObjectErrors) { Assert.IsNotNull(actualOtherIncome.ErrorCode); } }
public double GetFederalSummaryDetails(UserDTO userDTO) { //Retreiving TaxObject from database double totalAmount = 0; try { BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId); if (taxObject.PersonalDetails != null) { dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments(); input.Tax1040Object = taxObject; var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary( WorkflowInvoker.Invoke(new FederalSummaryWithNoValidation(), input)); if (taxObject.OutputForms.Tax1040EZPage1.RefundAmount > 0) { totalAmount = -Math.Abs(taxObject.OutputForms.Tax1040EZPage1.RefundAmount); } else { totalAmount = taxObject.OutputForms.Tax1040EZPage1.TaxOweAmount; } } } catch (Exception ex) { ExceptionHandling.LogException(userDTO.UserId, "Class:PaymentRepository,Method Name:GetFederalSummaryDetails", ex); } return(totalAmount); }
//public void BusinessValidationFederalTaxSummary(BusinessObject.Tax1040 taxObject, List<ErrorMessage> errorMessageList, ErrorMessages errorMessages) //{ // if (taxObject != null) // { // if (taxObject.OutputForms != null && taxObject.TaxesAndPenalties != null) // { // ErrorMessage errorMessage; // if (taxObject.OutputForms != null && taxObject.OutputForms.Tax1040EZPage1 != null) // { // //18Aug2014-Condition Changed By Thileep as per Spec Change Taxesandwrpup(V1.5) // if (taxObject.OutputForms.Tax1040EZPage1.RefundAmount > Constants.intZero && // (taxObject.TaxesAndPenalties == null || taxObject.TaxesAndPenalties.HasToDepositTaxRefundsToBankAccount == null)) // { // taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_REQUIRED_REFUND_DETAIL); // errorMessage = errorMessages[Constants.TAX_AND_WRAP_UP_REQUIRED_REFUND_DETAIL]; // if (errorMessage != null) // errorMessageList.Add(errorMessage); // } // else // { // taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_REQUIRED_REFUND_DETAIL); // } // //To DO // //if (taxObject.OutputForms.Tax1040EZPage1.AdjustedGrossIncome <= Constants.intZero && // // taxObject.OutputForms.Tax1040EZPage1.TotalPaymentsAndCredits <= Constants.intZero && // // taxObject.OutputForms.Tax1040EZPage1.TaxAmount <= Constants.intZero && // // taxObject.OutputForms.Tax1040EZPage1.RefundAmount <= Constants.intZero) // //{ // // errorMessage = errorMessages[Constants.TAX_AND_WRAP_UP_MISSING_INCOME]; // // if (errorMessage != null) // // errorMessageList.Add(errorMessage); // //} // //else // //{ // // taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_MISSING_INCOME); // //} // } // } // } //} #endregion #region Helper Method private bool HasEligibilityTaxIncome(UserDTO userDTO, BusinessObject.Tax1040 taxObject) { bool hasEligibilityTaxIncome = false; if (taxObject.ErrorMessages == null) { taxObject.ErrorMessages = new List <ErrorMessage>(); } if (taxObject.OutputForms != null && taxObject.OutputForms.Tax1040EZPage1 != null) { //var errorMessage = messageRepository.GetErrorMessages(); var errorMessage = HttpRuntime.Cache["ErrorMessageCollection"] as Dictionary <string, ErrorMessage>; var errorMessages = new ErrorMessages(errorMessage); taxObject.ErrorMessages.RemoveAll(em => em.ErrorCode == Constants.TAX_AND_WRAP_UP_TAXABLE_INCOME); ErrorMessage taxableIncomeEligibilityErrorMessage = BusinessValidationRepository.AssertIsGreater(taxObject.OutputForms.Tax1040EZPage1.TaxableIncome, Constants.TAXABLE_INCOME_ELIGIBILITY_AMOUNT, Constants.TAX_AND_WRAP_UP_TAXABLE_INCOME, errorMessages); if (taxableIncomeEligibilityErrorMessage != null) { taxObject.ErrorMessages.Add(taxableIncomeEligibilityErrorMessage); Utilities.PersistTaxObject(userDTO.UserId, userDTO.UserDataId, taxObject); hasEligibilityTaxIncome = true; } } return(hasEligibilityTaxIncome); }
public void WhoseUnEmploymentCompensationNotSelected() { var hasEligibilityDiagnostics = false; var UserDateId = 0L; //Prepare Form 1099G mTaxReturnData.TaxData = JsonConvert.SerializeObject(CreateForm1099GForRFValidations()); var filingStatus = FilingStatus.MarriedFilingJointly; var primaryTaxpayer = IT_PersonalInfo.CreatePrimaryTaxPayer(filingStatus); //Persist Primary Taxpayer var userDateId = mPersonalInfoRepository.PersistPrimaryTaxPayer(primaryTaxpayer, mUserId, UserDateId, null); mTaxReturnData.UserDataId = userDateId.Item1; //Persist Form 1099G var form1099GId = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData); //Get Form 1099G mUserInputData.userDataId = form1099GId.UserDataId; mUserInputData.currentForm1099GId = form1099GId.Form1099GId; //Get Form 1099G with all validations BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserInputData.userId, mUserInputData.userDataId); Assert.IsTrue(taxObject.ErrorMessages.Count > 0); hasEligibilityDiagnostics = taxObject.ErrorMessages.Any(em => (em.ErrorCode == "UnemploymentCompensation_RF1")); Assert.IsTrue(hasEligibilityDiagnostics); }
public System.Tuple <TaxesAndPenalties, string, DateTime, IEnumerable <ErrorMessage> > GetTaxAndWrapup(UserDTO userDTO) { IEnumerable <ErrorMessage> taxAndWrapupErrorList = null; Tuple <TaxesAndPenalties, string, DateTime, IEnumerable <ErrorMessage> > taxAndPenalties = null; try { BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId); //vivek 7-Aug-14 Added for the error message focus if (taxObject.ErrorMessages != null) { taxAndWrapupErrorList = taxObject.ErrorMessages.Where(err => err.Topic == Constants.TOPIC_TAX_AND_WRAPUP && (err.MessageType == Constants.MESSAGE_TYPE_RF || err.MessageType == Constants.MESSAGE_TYPE_V)).ToList(); } taxAndPenalties = new Tuple <TaxesAndPenalties, string, DateTime, IEnumerable <ErrorMessage> >(((taxObject != null && taxObject.TaxesAndPenalties != null) ? taxObject.TaxesAndPenalties : null), Utilities.GetTaxPayerFirstNameOrNickName(taxObject), ((taxObject != null && taxObject.TaxesAndPenalties == null || taxObject.TaxesAndPenalties.FilingDate.HasValue == false) ? DateTime.Now : DateTime.MinValue), taxAndWrapupErrorList); //Vincent, 2-sep-14, Persist Audit information string description = "Get TaxesAndWrapUpData, ClassName: {0}, Method Name: {1}"; Utilities.PersistAuditInfo(userDTO.UserId, userDTO.UserDataId, description, this.GetType().Name, Constants.Tab_TAX_AND_WRAPUP, Constants.TOPIC_TAX_AND_WRAPUP); } catch (Exception ex) { ExceptionHandling.LogException(userDTO.UserId, "Class:TaxesAndWrapUpRepository,Method Name:GetTaxAndWrapup", ex); } return(taxAndPenalties); }
public void GetUserRating() { var userDataId = 0L; // creating UserDataId by calling PersistTaxObject BusinessObject.Tax1040 tax1040 = new BusinessObject.Tax1040(); tax1040.UserDataId = 0; userDataId = Utilities.PersistTaxObject(userId, userDataId, tax1040); UserDTO userDTO = new UserDTO(); userDTO.UserDataId = userDataId; userDTO.UserId = userId; UserRating userrating = new UserRating(); userrating.Rating = 4; userrating.Comment = "good"; mTaxReturnRepository.PersistUserRating(userDTO, userrating); var result = mTaxReturnRepository.GetUserRating(userDTO); Assert.AreEqual(userrating.Rating, result.Rating); Assert.AreEqual(userrating.Comment, result.Comment); }
/// <summary> /// Persist Income Gateway CheckBox selected status into TaxObject. /// </summary> /// <param name="userId"></param> /// <param name="userDataId"></param> /// <param name="incomeGatewayCheckBoxStatus"></param> /// <returns>The User Data ID</returns> public long PersistIncomeGateway(long userId, long userDataId, Tuple <bool, bool, bool, bool> incomeGatewayCheckBoxStatus) { //Get TaxObject. BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userId, userDataId); if (taxObject == null) { taxObject = new BusinessObject.Tax1040(); taxObject.Income = new Income(); } if (taxObject.Income == null) { taxObject.Income = new Income(); } //Store the IncomeGateway check box values into Tax Object. taxObject.Income.HasW2Wages = incomeGatewayCheckBoxStatus.Item1; taxObject.Income.HasInterestIncome = incomeGatewayCheckBoxStatus.Item2; taxObject.Income.HasUnemploymentCompensation = incomeGatewayCheckBoxStatus.Item3; taxObject.Income.HasOtherIncome = incomeGatewayCheckBoxStatus.Item4; //02-Sep-2014 Bhavani Audit functionality implementation string description = "Persis Income Gateway, ClassName: {0}, Method Name: {1}"; Utilities.PersistAuditInfo(userId, userDataId, description, this.GetType().Name, Constants.Tab_INCOME, Constants.TOPIC_INCOME_GATEWAY); //Persist TaxObject. long id = Utilities.PersistTaxObject(userId, userDataId, taxObject); return(id); }
public static BusinessObject.Tax1040 CreateTaxObject() { BusinessObject.Tax1040 tax1040 = new BusinessObject.Tax1040(); tax1040.UserDataId = 0; var randomValue = Guid.NewGuid().ToString().Substring(0, 5); Random randomSecurityQuestionID = new Random(); var year = randomSecurityQuestionID.Next(-30, -20); var primaryTaxPayer = new PrimaryTaxPayer { Person = new Person { PersonId = 0, FirstName = "first name" + randomValue, MiddleInitial = 'M', LastName = "last name" + randomValue, NickName = "nick name" + randomValue, Occupation = "occupation", DateOfBirth = DateTime.Now.AddYears(year), SSN = "ssn001", PersonType = PersonType.PrimaryTaxPayer, HasPrimaryFilerEcfContributed = false, HasSpouseEcfContributed = false, IsLegallyBlind = false, IsDisabled = false, HasClaimedAsDependent = false, IsDied = false, DateOfDeath = DateTime.Now, IsStudent = false, IsFullTimeStudent = false }, FilingStatus = FilingStatus.Single }; if (tax1040.PersonalDetails == null) { tax1040.PersonalDetails = new PersonalDetails() { PrimaryTaxPayer = new PrimaryTaxPayer() { FilingStatus = FilingStatus.Single } }; } tax1040.PersonalDetails.PrimaryTaxPayer = primaryTaxPayer; tax1040.Income = new Income(); tax1040.Income.Form1099INT = CreateForm1099INT(OwnerType.PrimaryTaxPayer); tax1040.Income.Form1099OID = CreateForm1099OID(); tax1040.Income.W2Wages = CreateW2(); return(tax1040); }
public void GetIncomeSummaryWithOutData() { var userDataId = 0L; // creating UserDataId by calling PersistTaxObject BusinessObject.Tax1040 tax1040 = new BusinessObject.Tax1040(); tax1040.UserDataId = 0; userDataId = Utilities.PersistTaxObject(userId, userDataId, tax1040); var result = mTaxReturnRepository.GetIncomeSummary(userId, userDataId); Assert.AreEqual(0, result.Item1); }
public void GetUserDataIdByUserId() { var userDataId = 0L; // creating UserDataId by calling PersistTaxObject BusinessObject.Tax1040 tax1040 = new BusinessObject.Tax1040(); tax1040.UserDataId = 0; userDataId = Utilities.PersistTaxObject(userId, userDataId, tax1040); long useedataresult = mTaxReturnRepository.GetUserDataIdByUserId(userId); // getting UserDataId by calling GetUserDataIdByUserId Assert.AreEqual(userDataId, useedataresult); }
public void TaxableIncomeGreatherthanLakhDollars() { //Persist Personal Info const long mUserDataId = 0L; var primaryTaxPayer = IT_PersonalInfo.CreatePrimaryTaxPayer(FilingStatus.Single); var expectedPrimaryTaxpayer = mPersonalInfoRepository.PersistPrimaryTaxPayer(primaryTaxPayer, mUserId, mUserDataId); //Persist W2 var wages = IT_W2Repository.CreateW2(EmploymentType.RegularW2Wages, OwnerType.PrimaryTaxPayer); wages.WagesAmount = 41812.00; mTaxReturnData.TaxData = JsonConvert.SerializeObject(wages); mTaxReturnData.UserDataId = expectedPrimaryTaxpayer.Item1; var expectedWages = mW2Repository.PersistW2TaxReturnData(mUserId, mTaxReturnData); //Persist Interest Income INT var expectedForm1099INT = IT_InterestIncomeForm1099INTRepository.CreateForm1099INT(OwnerType.PrimaryTaxPayer); expectedForm1099INT.InterestIncome = 100000.00; mTaxReturnData.UserDataId = expectedWages.UserDataId; mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedForm1099INT); mUserData.userId = mUserId; mUserData.TaxReturnData = JsonConvert.SerializeObject(mTaxReturnData); var expectedUserData = mInterestIncomeRepository.PersistTaxReturnForm1099INTData(mUserData); //Persist Form 1099G var expectedForm1099G = IT_UnemploymentRepository.CreateForm1099G(); expectedForm1099G.UnEmploymentCompensation = 1580.00; mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedForm1099G); mTaxReturnData.UserDataId = expectedUserData.UserDataId; var expectedForm1099GData = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData); //Persist Taxes and Wrap Up var expectedTaxesAndWrapUp = CreateTaxesAndWrapWithoutData(); mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedTaxesAndWrapUp); mTaxReturnData.UserDataId = expectedForm1099GData.UserDataId; var expectedTaxesAndWrapUpData = mTaxesAndWrapUpRepository.PersistTaxesAndWrapUpData(mUserId, mTaxReturnData); var userDTO = new UserDTO() { UserId = mUserId, UserDataId = expectedTaxesAndWrapUpData.Item1 }; //Get Taxes and Wrap Up var actualTaxesAndWrapUp = mTaxesAndWrapUpRepository.GetFederalTaxSummary(userDTO); BusinessObject.Tax1040 actualTaxesAndWrapUpData = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserId, expectedTaxesAndWrapUpData.Item1); Assert.IsTrue(actualTaxesAndWrapUpData.ErrorMessages.Any(er => er.ErrorCode.Equals("TaxesAndWrapUp_ER5"))); }
public static Form1099OID GetForm1099OID(dynamic userInputData) { Form1099OID form1099OID = null; BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userInputData.userId, userInputData.userDataId); if (taxObject != null) { if (taxObject.Income != null && taxObject.Income.Form1099OID != null) { form1099OID = taxObject.Income.Form1099OID.Find(frm => frm.Form1099OIDId == userInputData.currentForm1099OIDId); } } return(form1099OID); }
//Vincent-26/06/14- Genernating 1040EZ Output Form public void Genernate1040EZForm(UserDTO userDTO) { userDTO.UserDataId = userDTO.UserDataId == null ? 0 : userDTO.UserDataId; BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId); dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments(); input.Tax1040Object = taxObject; var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary( WorkflowInvoker.Invoke(new FederalSummaryWithNoValidation(), input)); if (userDTO.UserDataId != 0) { Utilities.PersistTaxObject(userDTO.UserId, userDTO.UserDataId, taxObject); } }
public void GetTaxReturnDatabyUserDataId() { var userDataId = 0L; // for getting UserDataId BusinessObject.Tax1040 tax1040 = new BusinessObject.Tax1040(); tax1040 = CreateTaxObject(); // persist taobject with filled Person data long userDataID = Utilities.PersistTaxObject(userId, userDataId, tax1040); string taxData = mTaxReturnRepository.GetTaxReturnDatabyUserDataId(userDataID, userId); var resultaxobject = Utilities.ConvertJsonToTaxObject(taxData); // check whether person object is saved and retrieved Assert.AreEqual(resultaxobject.PersonalDetails.PrimaryTaxPayer.Person.SSN, tax1040.PersonalDetails.PrimaryTaxPayer.Person.SSN); Assert.AreEqual(resultaxobject.Income.Form1099INT[0].AccountNumber, tax1040.Income.Form1099INT[0].AccountNumber); Assert.AreEqual(resultaxobject.Income.Form1099OID[0].AccountNumber, tax1040.Income.Form1099OID[0].AccountNumber); }
public Tuple <Tax1040EZPage1, List <ErrorMessage>, bool, string, long> GetFederalTaxSummary(UserDTO userDTO) { Tuple <Tax1040EZPage1, List <ErrorMessage>, bool, string, long> federalTaxSummary = null; try { BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId); dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments(); input.Tax1040Object = taxObject; var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary( WorkflowInvoker.Invoke(new FederalSummaryWithNoValidation(), input)); var hasEligibilityDiagnostics = HasEligibilityTaxIncome(userDTO, taxObject); // 09Jun2014 Sathish Persisted tax object to updated eligibility rule addd for taxable income is more that $100,000 userDTO.UserDataId = Utilities.PersistTaxObject(userDTO.UserId, userDTO.UserDataId, taxObject); //var errorMessage = messageRepository.GetErrorMessages(); //var errorMessages = new ErrorMessages(errorMessage); // BusinessValidationFederalTaxSummary(taxObject != null ? taxObject : null, taxObject.ErrorMessages, errorMessages); //Praveen 17 July 2014 Error Message displayed based on Error Type(Properly Shuffled) federalTaxSummary = new Tuple <Tax1040EZPage1, List <ErrorMessage>, bool, string, long>( ((taxObject != null && taxObject.OutputForms != null && taxObject.OutputForms.Tax1040EZPage1 != null) ? taxObject.OutputForms.Tax1040EZPage1 : null), taxObject.ErrorMessages.FindAll(em => em.ErrorCode.StartsWith(Constants.TOPIC_TAX_AND_WRAPUP)).OrderBy(x => x.ErrorType).ToList(), hasEligibilityDiagnostics, Utilities.GetTaxPayerFirstNameOrNickName(taxObject), userDTO.UserDataId); //userDTO.UserDataId = Utilities.PersistTaxObject(userDTO.UserId, userDTO.UserDataId, taxObject); //Vincent, 2-sep-14, Persist Audit information string description = "Get FederalTaxSummary, ClassName: {0}, Method Name: {1}"; Utilities.PersistAuditInfo(userDTO.UserId, userDTO.UserDataId, description, this.GetType().Name, Constants.Tab_TAX_AND_WRAPUP, Constants.TOPIC_TAX_AND_WRAPUP); } catch (Exception ex) { ExceptionHandling.LogException(userDTO.UserId, "Class:TaxesAndWrapUpRepository,Method Name:GetFederalTaxSummary", ex); } return(federalTaxSummary); }
public void AccountTypeRFCheck() { //var hasEligibilityDiagnostics = false; //Persist Payment Options var persistPaymentDTO = PersistPaymentDTO(); TaxReturnData taxReturnData = new TaxReturnData(); taxReturnData.TaxData = JsonConvert.SerializeObject(persistPaymentDTO); var persistPaymentDetails = mEfileRepository.PersistIRSPaymentOption(persistPaymentDTO); Assert.IsTrue(persistPaymentDetails.Item1 > 0); //persistPaymentDetails.Item2 BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(persistPaymentDTO.UserId, persistPaymentDetails.Item1); //Required Field validation #1 bool hasAccountType = persistPaymentDetails.Item2.Any(em => (em.ErrorCode == "Efile_RF1")); Assert.IsTrue(hasAccountType); //Required Field validation #2 bool hasAccountNumber = persistPaymentDetails.Item2.Any(em => (em.ErrorCode == "Efile_RF2")); Assert.IsTrue(hasAccountNumber); //Required Field validation #3 bool hasRoutingNumber = persistPaymentDetails.Item2.Any(em => (em.ErrorCode == "Efile_RF3")); Assert.IsTrue(hasRoutingNumber); //Required Field validation #4 bool hasBankName = persistPaymentDetails.Item2.Any(em => (em.ErrorCode == "Efile_RF4")); Assert.IsTrue(hasBankName); //Required Field validation #5 bool hasIRSPaymentOptionAgreedWithPaymentDebit = persistPaymentDetails.Item2.Any(em => (em.ErrorCode == "Efile_RF5")); Assert.IsTrue(hasIRSPaymentOptionAgreedWithPaymentDebit); //Required Field validation #6 bool hasIRSPaymentOptionAgreedWithPaymentEFTS = persistPaymentDetails.Item2.Any(em => (em.ErrorCode == "Efile_RF6")); Assert.IsTrue(hasIRSPaymentOptionAgreedWithPaymentEFTS); //Required Field validation #7 bool hasIRSPaymentOptionAgreedWithPaymentCheckByMail = persistPaymentDetails.Item2.Any(em => (em.ErrorCode == "Efile_RF7")); Assert.IsTrue(hasIRSPaymentOptionAgreedWithPaymentCheckByMail); }
public void StateTaxWithheldHasValueStateCodeMustBeSelected() { var hasEligibilityDiagnostics = false; //Prepare Form 1099G mTaxReturnData.TaxData = JsonConvert.SerializeObject(CreateForm1099GForRFValidations()); //Persist Form 1099G var form1099GId = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData); //Get Form 1099G mUserInputData.userDataId = form1099GId.UserDataId; mUserInputData.currentForm1099GId = form1099GId.Form1099GId; //Get Form 1099G with all validations BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserInputData.userId, mUserInputData.userDataId); Assert.IsTrue(taxObject.ErrorMessages.Count > 0); hasEligibilityDiagnostics = taxObject.ErrorMessages.Any(em => (em.ErrorCode == "UnemploymentCompensation_RF12")); Assert.IsTrue(hasEligibilityDiagnostics); }
public void ReportedRepaidUnEmploymentCompensationBenefitsReceived() { var hasEligibilityDiagnostics = false; //Prepare Form 1099G mTaxReturnData.TaxData = JsonConvert.SerializeObject(CreateForm1099GForRFValidations()); //Persist Form 1099G var form1099GId = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData); //Get Form 1099G mUserInputData.userDataId = form1099GId.UserDataId; mUserInputData.currentForm1099GId = form1099GId.Form1099GId; //Get Form 1099G with all validations BusinessObject.Tax1040 actualForm1099GData = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserInputData.userId, mUserInputData.userDataId); Assert.IsTrue(actualForm1099GData.ErrorMessages.Count > 0); hasEligibilityDiagnostics = actualForm1099GData.ErrorMessages.Any(em => (em.ErrorCode == "UnemploymentCompensation_RF11")); Assert.IsTrue(hasEligibilityDiagnostics); }
public void GetFederalSummaryDetailsWithoutData() { var userDataId = 0L; // creating UserDataId by calling PersistTaxObject BusinessObject.Tax1040 tax1040 = new BusinessObject.Tax1040(); tax1040.UserDataId = 0; userDataId = Utilities.PersistTaxObject(userId, userDataId, tax1040); UserDTO userDTO = new UserDTO(); userDTO.UserDataId = userDataId; userDTO.UserId = userId; var result = mTaxReturnRepository.GetFederalSummaryDetails(userDTO); // result will be 0 since no data is passed Assert.AreEqual(0, result); }
public void ValidateEicBR3BR5BR6BR7() { //Persist Personal Info var primaryTaxPayer = IT_PersonalInfo.CreatePrimaryTaxPayer(FilingStatus.Single); var expectedPrimaryTaxpayer = mPersonalInfoRepository.PersistPrimaryTaxPayer(primaryTaxPayer, mUserId, mUserDataId); //Persist W2 var wages = IT_W2Repository.CreateW2(EmploymentType.RegularW2Wages, OwnerType.PrimaryTaxPayer); wages.FederalTaxWithholdingAmount = 10000.00; mTaxReturnData.TaxData = JsonConvert.SerializeObject(wages); mTaxReturnData.UserDataId = expectedPrimaryTaxpayer.Item1; var expectedWages = mW2Repository.PersistW2TaxReturnData(mUserId, mTaxReturnData); //Persist EIC var expectedEic = CreateEIC(); expectedEic.HasValidSSN = false; expectedEic.IsInUSMorethanHalfYear = false; expectedEic.HasClaimedAsQualifyingChild = true; expectedEic.HasReceivedIRSNoticeOnEICNotEligible = true; mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedEic); mTaxReturnData.UserDataId = expectedWages.UserDataId; var expectedEicUserDataId = mEarnedIncomeCreditRepository.PersitEarnedIncomeCredit(mUserId, mTaxReturnData, mYear); //Get EIC mUserDTO.UserDataId = expectedEicUserDataId; mUserDTO.UserId = mUserId; BusinessObject.Tax1040 actualEicData = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserDTO.UserId, mUserDTO.UserDataId); // When "You & your Spouse(MFJ) have a valid SSN that allows you to work" check box not checked Assert.IsTrue(actualEicData.ErrorMessages.Any(er => er.ErrorCode.Equals("EarnedIncomeCredit_BR3"))); // when "You & your Spouse (MFJ) lived in the United States for more than half of the year(2014)" check box not checked Assert.IsTrue(actualEicData.ErrorMessages.Any(er => er.ErrorCode.Equals("EarnedIncomeCredit_BR5"))); // When "You are claimed as Qualified Child in another person's tax return" check box not chenked Assert.IsTrue(actualEicData.ErrorMessages.Any(er => er.ErrorCode.Equals("EarnedIncomeCredit_BR6"))); // When "You received notice from IRS as 'Not to Claim EIC" check box not chenked Assert.IsTrue(actualEicData.ErrorMessages.Any(er => er.ErrorCode.Equals("EarnedIncomeCredit_BR7"))); }
//Saravanan N - 20th May, 2014 - Code refactored from its Controller. /// <summary> /// Get OtherIncome /// </summary> /// <param name="userInputData"></param> /// <returns></returns> public Tuple <OtherIncome, FilingStatus, IEnumerable <ErrorMessage> > GetOtherIncome(UserDTO userDTO) { try { FilingStatus filingStatus = FilingStatus.None; IEnumerable <ErrorMessage> otherIncomeErrorList = null; OtherIncome otherIncome = null; BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId.ConvertToLong(), userDTO.UserDataId.ConvertToLong()); if (taxObject != null) { if (taxObject.Income != null && taxObject.Income.OtherIncome != null) { otherIncome = taxObject.Income.OtherIncome; } if (taxObject.PersonalDetails != null && taxObject.PersonalDetails.PrimaryTaxPayer != null) { filingStatus = taxObject.PersonalDetails.PrimaryTaxPayer.FilingStatus; } //vivek - 6-Aug-14 -Added the error message list for the error message focus if (taxObject.ErrorMessages != null) { otherIncomeErrorList = taxObject.ErrorMessages.Where(err => (err.Topic == Constants.TOPIC_OTHER_INCOME || err.Topic == Constants.TOPIC_OTHER_INCOME_Alaska || err.Topic == Constants.TOPIC_OTHER_INCOME_SSB_RRB || err.Topic == Constants.TOPIC_OTHER_INCOME_State_And_Local) && (err.MessageType == Constants.MESSAGE_TYPE_RF || err.MessageType == Constants.MESSAGE_TYPE_V)).ToList(); } } //02-Sep-2014 Bhavani Audit functionality implementation var description = "Get OtherIncome, ClassName: {0}, Method Name: {1}"; Utilities.PersistAuditInfo(userDTO.UserId, userDTO.UserDataId, description, GetType().Name, Constants.Tab_INCOME, Constants.TOPIC_OTHER_INCOME); return(new Tuple <OtherIncome, FilingStatus, IEnumerable <ErrorMessage> >(otherIncome, filingStatus, otherIncomeErrorList)); } catch (Exception ex) { throw ex; } }
public bool GetHasEarnedIncomeCredits(UserDTO userDTO) { bool hasEarnedIncomeCredits = false; try { BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId); if (taxObject != null && taxObject.Credits != null && taxObject.Credits.HasEarnedIncomeCredits.HasValue) { hasEarnedIncomeCredits = taxObject.Credits.HasEarnedIncomeCredits.Value; } //Vincent, 2-sep-14, Persist Audit information string description = "Has EarnedIncomeCredits, ClassName: {0}, Method Name: {1}"; Utilities.PersistAuditInfo(userDTO.UserId, userDTO.UserDataId, description, this.GetType().Name, Constants.Tab_EARNED_INCOME_CREDITS, Constants.TOPIC_EARNED_INCOME_CREDIT); } catch (Exception ex) { ExceptionHandling.LogException(userDTO.UserId, "Class:W2Repository,Method Name:GetHasEarnedIncomeCredits", ex); } return(hasEarnedIncomeCredits); }
public void RepaidUnemploymentCompensationReported() { //Prepare Form 1099G var expectedForm1099G = CreateForm1099G(); expectedForm1099G.IsPriorYearUnEmploymentRepaid = true; expectedForm1099G.PriorYearUnEmploymentRepaid = Utilities.CreateRandomNumber(0, 20); mTaxReturnData.TaxData = JsonConvert.SerializeObject(expectedForm1099G); //Persist Form 1099G var actualForm1099GData = mUnemploymentRepository.CreateAndPersistUnemployment(mUserId, mTaxReturnData); //Get Form 1099G with all validations BusinessObject.Tax1040 actualForm1099G = Utilities.GetTaxObjectByUserIdAndUserDataId(mUserInputData.userId, actualForm1099GData.UserDataId); Assert.IsTrue(actualForm1099G.ErrorMessages.Count > 0); mLstTaxObjectErrors = actualForm1099G.ErrorMessages.Where(err => err.Topic == Constants.TOPIC_UNEMPLOYMENT_COMPENSATION && err.MessageType.StartsWith("ER")); foreach (var errorMsg in mLstTaxObjectErrors) { Assert.IsNotNull(errorMsg.ErrorCode); } }
public void PersistUserReferral() { var userDataId = 0L; // creating UserDataId by calling PersistTaxObject BusinessObject.Tax1040 tax1040 = new BusinessObject.Tax1040(); tax1040.UserDataId = 0; userDataId = Utilities.PersistTaxObject(userId, userDataId, tax1040); UserDTO userDTO = new UserDTO(); userDTO.UserDataId = userDataId; userDTO.UserId = userId; ReferralRating ReferralRating = new BusinessObject.ReferralRating(); UserRating userrating = new UserRating(); userrating.Rating = 4; userrating.Comment = "good"; ReferralRating.UserRating = userrating; ReferralRating.UserReferral = new List <UserReferral>(); UserReferral userreferral = new UserReferral(); userreferral.ReferralEmailId = "*****@*****.**"; UserReferral userreferral1 = new UserReferral(); userreferral1.ReferralEmailId = "*****@*****.**"; ReferralRating.UserReferral.Add(userreferral); ReferralRating.UserReferral.Add(userreferral1); mTaxReturnRepository.PersistUserReferral(userDTO, ReferralRating); }