//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); }
/// <summary> /// Business Fields Validations (Required and Validation) checked. /// </summary> /// <param name="eic"></param> /// <param name="errorMessageList"></param> /// <param name="errorMessages"></param> public void BusinessValidation(EIC eic, List <ErrorMessage> errorMessageList, ErrorMessages errorMessages, int year, FilingStatus filingStatus) { ErrorMessage errorMessage; if (eic != null) { ////Required Entry #1 //if (eic.HasTaxableScholarshipCredits != null && eic.HasTaxableScholarshipCredits == true) //{ // errorMessage = // BusinessValidationRepository.AssertIsNotNull(eic.TaxableScholarshipCredit, // Constants.EIC_TAXABLE_FELLOWSHIP_INCOME, errorMessages); // if (errorMessage != null) // errorMessageList.Add(errorMessage); //} ////Required Entry #2 //if (eic.HasPensionAnnuity != null && eic.HasPensionAnnuity == true) //{ // errorMessage = // BusinessValidationRepository.AssertIsNotNull(eic.PensionAnnuity, // Constants.EIC_PENSION_OR_ANNUITY_NOT_QUALIFIED_COMPENSATION, errorMessages); // if (errorMessage != null) // errorMessageList.Add(errorMessage); //} //Required Entry #3 if (eic.HasPenalInstitutionInmateWages != null && eic.HasPenalInstitutionInmateWages == true) { errorMessage = BusinessValidationRepository.AssertIsNotNull(eic.PenalInstitutionInmateWages, Constants.EIC_WAGES_FOR_WORK_DONE_WHILE_PENAL_INSTITUTION, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } //Required Entry #4 if (eic.HasReceivedIRSNoticeOnFiling8862 == true && eic.HasIncorrectlyReportedEarnedIncome == null && eic.HasEICForPriorYearDisallowance == true) { errorMessage = errorMessages[Constants.EIC_REDUCED_OR_DISALLOWED_FOR_INCORRECTLY_REPORTEED_INCOME]; if (errorMessage != null) { errorMessageList.Add(errorMessage); } } //Required Entry #5 if (eic.HasReceivedIRSNoticeOnFiling8862 == true && eic.HasEICForPriorYearDisallowance == null) { errorMessage = errorMessages[Constants.EIC_LIKE_TO_CLAIM_FORM_8862]; if (errorMessage != null) { errorMessageList.Add(errorMessage); } } //Required Entry #6 if (eic.HasReceivedIRSNoticeOnFiling8862 == true && eic.HasEICForPriorYearDisallowance != null && eic.HasEICForPriorYearDisallowance == true) { //Taxpayer Lived in US. int noOfDaysInTaxYear = GetDaysInYear(year); if (filingStatus != null) { if (filingStatus == FilingStatus.Single) { errorMessage = BusinessValidationRepository.AssertIsNotNull(eic.NumberOfDaysTaxPayerLivedInUS, Constants.EIC_NUMBER_OF_DAYS_TaxPayer_LIVED_IN_US, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { //07Aug2014-Validation Changed for Number Of Days errorMessage = BusinessValidationRepository.AssertIsWithinRange(Utilities.ConvertToInteger32(eic.NumberOfDaysTaxPayerLivedInUS), 1, noOfDaysInTaxYear, Constants.EIC_NUMBER_OF_DAYS_TAXPAYER_LIVED_IN_US_VALID, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } if (filingStatus == FilingStatus.MarriedFilingJointly) { errorMessage = BusinessValidationRepository.AssertIsNotNull(eic.NumberOfDaysTaxPayerLivedInUS, Constants.EIC_NUMBER_OF_DAYS_TaxPayer_LIVED_IN_US, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { errorMessage = BusinessValidationRepository.AssertIsWithinRange(Utilities.ConvertToInteger32(eic.NumberOfDaysTaxPayerLivedInUS), 1, noOfDaysInTaxYear, Constants.EIC_NUMBER_OF_DAYS_TAXPAYER_LIVED_IN_US_VALID, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } //Spouse Lived in US errorMessage = BusinessValidationRepository.AssertIsNotNull(eic.NumberOfDaysSpouseLivedInUS, Constants.EIC_NUMBER_OF_DAYS_SPOUSE_LIVED_IN_US, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { errorMessage = BusinessValidationRepository.AssertIsWithinRange(Utilities.ConvertToInteger32(eic.NumberOfDaysSpouseLivedInUS), 1, noOfDaysInTaxYear, Constants.EIC_NUMBER_OF_DAYS_SPOUSE_LIVED_IN_US_VALID, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } } } //Waring Rules //This Business rule is related to Form 8862 if (eic.HasReceivedIRSNoticeOnFiling8862 == true && eic.HasEICForPriorYearDisallowance == false) { errorMessage = errorMessages[Constants.EIC_PRIOR_YEAR_DISALLOWANCE]; if (errorMessage != null) { errorMessageList.Add(errorMessage); } } if (eic.HasReceivedIRSNoticeOnFiling8862 == true && eic.HasEICForPriorYearDisallowance == true) { if (eic.HasIncorrectlyReportedEarnedIncome == true) { errorMessage = errorMessages[Constants.EIC_INCORRECTLY_REPORTED_YOUR_EARNED_INCOME]; if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } } }
//Saravanan N - 9th April, 2014 - Business validations added. //Vincent - 15th April 2014 - Added a FormId to get F1099GID. private void BusinessFieldValidations(List <Form1099G> form1099GList, FilingStatus filingStatus, List <ErrorMessage> errorMessageList, ErrorMessages errorMessages) { Regex regex; ErrorMessage errorMessage; bool isHavingFiveChars = true; bool isHavingNineChars = true; bool isValidNumeric = true; foreach (var form1099G in form1099GList) { //Required field validations 1. if (form1099G == null || (filingStatus == FilingStatus.MarriedFilingJointly && form1099G.OwnerType == OwnerType.None)) { errorMessage = errorMessages[Constants.F1099G_WHOSE_UNEMPLOYMENT_COMPENSATION_IS_THIS]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Required field validations 2 if (form1099G == null || form1099G.Payer == null || string.IsNullOrEmpty(form1099G.Payer.PayerName.Trim())) { errorMessage = errorMessages[Constants.F1099G_PAYER_NAME_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Required field validations 3 if (form1099G == null || form1099G.Payer == null || form1099G.Payer.Address == null || form1099G.Payer.Address.PayerAddress == null || string.IsNullOrEmpty(form1099G.Payer.Address.PayerAddress.StreetAddress.Trim())) { errorMessage = errorMessages[Constants.F1099G_PAYER_ADDRESS_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Required field validations 4 if (form1099G == null || form1099G.Payer == null || form1099G.Payer.Address == null || form1099G.Payer.Address.PayerAddress == null || string.IsNullOrEmpty(form1099G.Payer.Address.PayerAddress.City.Trim())) { errorMessage = errorMessages[Constants.F1099G_PAYER_CITY_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Required field validations 5 if (form1099G == null || form1099G.Payer == null || form1099G.Payer.Address == null || form1099G.Payer.Address.PayerAddress == null || form1099G.Payer.Address.PayerAddress.State == null || //10Jul2014 Sathish changed to new state bo form1099G.Payer.Address.PayerAddress.State.StateId == 0) { errorMessage = errorMessages[Constants.F1099G_PAYER_STATE_CODE_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Required field validations 6 if (form1099G == null || form1099G.Payer == null || form1099G.Payer.Address == null || form1099G.Payer.Address.PayerAddress == null || string.IsNullOrEmpty(form1099G.Payer.Address.PayerAddress.ZipCode)) { errorMessage = errorMessages[Constants.F1099G_PAYER_ZIP_CODE_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Required field validations 7 if (form1099G == null || form1099G.Payer == null || string.IsNullOrEmpty(form1099G.Payer.PayerIdentificationNumber.Trim())) { errorMessage = errorMessages[Constants.F1099G_PAYER_IDENTIFIQATION_NUMBER_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Required field validations 8 if (form1099G == null || (!form1099G.UnEmploymentCompensation.HasValue)) { errorMessage = errorMessages[Constants.F1099G_UNEMPLOYMENT_COMPENSATION_AMOUNT_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Removed by prasana on 15.07.2014 as per spec V2.3 modification //Required field validations 9 //if (form1099G == null || (!form1099G.FederalTaxWithHoldingAmount.HasValue)) //{ // errorMessage = errorMessages[Constants.F1099G_BOX_4_FEDERAL_TAX_WITHHELD_MISSING]; // Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); //} //Required field validations 10 if (form1099G == null || (form1099G.IsCurrentYearUnemploymentRepaid == true && (!form1099G.CurrentYearUnemploymentRepaid.HasValue))) { errorMessage = errorMessages[Constants.F1099G_REPAID_AMOUNT_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Required field validations 11 if (form1099G == null || (form1099G.IsPriorYearUnEmploymentRepaid == true && !form1099G.PriorYearUnEmploymentRepaid.HasValue)) { errorMessage = errorMessages[Constants.F1099G_REPAID_AMOUNT_PRIOR_YEAR_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } //Yogalakshmi - 29th May 2014 - Added a error message for RF12 if (form1099G.Form1099StateInfo != null) { foreach (var stateInfo in form1099G.Form1099StateInfo) { if (stateInfo.StateTaxWithholdingAmount != null && stateInfo.State != null && //10Jul2014 Sathish changed to new state bo stateInfo.State.StateId == 0) { errorMessage = errorMessages[Constants.F1099G_STATE_CODE_MISSING]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } } } //Validations if (form1099G != null && form1099G.Payer != null) { //validataion #1 //Defect Key : TAX1040-13964 - Saravanan N - 5th June, 2014. - NULL or Empty check handled. if (!String.IsNullOrEmpty(form1099G.Payer.PayerName.Trim())) { errorMessage = BusinessValidationRepository.AssertIsNumbersLettersAndHyphen(form1099G.Payer.PayerName, Constants.F1099G_PAYER_NAME_HAS_SPECIAL_CHARACTERS, errorMessages); Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } if (form1099G.Payer.Address != null && form1099G.Payer.Address.PayerAddress != null) { //Saravanan N - 23rd May, 2014 - As discussed with BA, Address will allow AlphaNumeric, hence commented this. //validataion #2 - StreetAddress if (!string.IsNullOrEmpty(form1099G.Payer.Address.PayerAddress.StreetAddress.Trim())) { regex = new Regex("^[a-zA-Z0-9- ]+$"); if (!regex.IsMatch(form1099G.Payer.Address.PayerAddress.StreetAddress)) { errorMessage = errorMessages[Constants.F1099G_PAYER_ADDRESS_HAS_SPECIAL_CHARACTERS]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } } //validataion #3 - PayerCity if (!string.IsNullOrEmpty(form1099G.Payer.Address.PayerAddress.City.Trim())) { regex = new Regex("^[a-zA-Z ]+$"); // 15May2014 Sathish Changed rejex to allow space character if (!regex.IsMatch(form1099G.Payer.Address.PayerAddress.City)) { errorMessage = errorMessages[Constants.F1099G_PAYER_CITY_HAS_SPECIAL_CHARACTERS]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } } //validataion # 4 - ZipCode //Saravanan N - 26th May, 2014 - Code inherited from PersonalInfoRepository. if (!string.IsNullOrEmpty(form1099G.Payer.Address.PayerAddress.ZipCode)) { bool isValidZipcodeForState = true; if (form1099G.Payer.Address.PayerAddress.State != null && //10Jul2014 Sathish changed to new state bo form1099G.Payer.Address.PayerAddress.State.StateId > 0) { //Get the first 5 chars (i.e., til Hyphen -) //Modified by prasana made changes for validating zipcode in DB on 14.07.2014 var zipCodeFromUI = form1099G.Payer.Address.PayerAddress.ZipCode.Substring(0, 5); if (!string.IsNullOrEmpty(zipCodeFromUI)) { ////Thileep - 27.05.14 - Changed Zip Code Validation //var zipCodeToCheckWithState = zipCodeFromUI.Contains('-') ? zipCodeFromUI.Substring(0, // (zipCodeFromUI.IndexOf('-'))) : zipCodeFromUI; isValidZipcodeForState = Utilities.ValidateZipCodeByStateId(form1099G.Payer.Address.PayerAddress.State.StateId, //10Jul2014 Sathish changed to new state bo zipCodeFromUI); } } else { //State ID not selected, then check the Zip Code format. string zipCode = form1099G.Payer.Address.PayerAddress.ZipCode; zipCode = Utilities.RemoveHiphen(zipCode); isValidNumeric = Utilities.IsValidRegexPattern(zipCode, "^[0-9]+$"); isHavingNineChars = (zipCode.Trim().Length == 9); isHavingFiveChars = (zipCode.Trim().Length == 5); } //Defect Key TAX1040-13961 on 5th June, 2014 - By Saravanan if (!isValidZipcodeForState || !isValidNumeric || (!isHavingNineChars && !isHavingFiveChars)) { errorMessage = errorMessages[Constants.F1099G_PAYER_ZIP_CODE_INVALID]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } } } //validataion #5 - PayerIdentificationNumber if (!string.IsNullOrEmpty(form1099G.Payer.PayerIdentificationNumber)) { string payerIdentificationNumber = form1099G.Payer.PayerIdentificationNumber; payerIdentificationNumber = Utilities.RemoveHiphen(payerIdentificationNumber); isValidNumeric = Utilities.IsValidRegexPattern(payerIdentificationNumber, "^[0-9]+$"); isHavingNineChars = (payerIdentificationNumber.Trim().Length == 9); if (!isValidNumeric || !isHavingNineChars || payerIdentificationNumber == Constants.NineZeros || payerIdentificationNumber == Constants.NineNines) { errorMessage = errorMessages[Constants.F1099G_PAYER_IDENTIFIQATION_NUMBER_INVALID]; //Yogalakshmi - 22nd May 2014 - Object name was wrongly placed while returning so changed it from errormessage to error Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } } //Added by prasana on 15.07.2014 after Income spec update 2.3 if (form1099G.CurrentYearUnemploymentRepaid != null && form1099G.UnEmploymentCompensation != null) { if (form1099G.CurrentYearUnemploymentRepaid > form1099G.UnEmploymentCompensation) { errorMessage = errorMessages[Constants.F1099G_UnEmploymentCompensation_Validation]; Utilities.AddErrorToTaxObjectWithFormId(errorMessageList, form1099G.Form1099GId, errorMessage); } } } } }
//// 28May2014 Check Taxable income eligibility //public Tuple<string, bool> TaxableIncomeEligibilityCheck(UserDTO userDTO) //{ // Tuple<string, bool> taxableIncomeEligibility = null; // try // { // BusinessObject.Tax1040 taxObject = Utilities.GetTaxObjectByUserIdAndUserDataId(userDTO.UserId, userDTO.UserDataId); // if (taxObject != null) // { // dynamic input = new Microsoft.Activities.Extensions.WorkflowArguments(); // input.Tax1040Object = taxObject; // var output = Microsoft.Activities.Extensions.WorkflowArguments.FromDictionary( // WorkflowInvoker.Invoke(new FederalSummaryWithNoValidation(), input)); // hasEligibilityDiagnostics = HasEligibilityTaxIncome(userDTO, taxObject); // } // taxableIncomeEligibility = new Tuple<string, bool>(Utilities.GetTaxPayerFirstNameOrNickName(taxObject), hasEligibilityDiagnostics); // } // catch (Exception ex) // { // ExceptionHandling.LogException(userDTO.UserId, "Class:TaxesAndWrapUpRepository,Method Name:TaxableIncomeEligibilityCheck", ex); // } // return taxableIncomeEligibility; //} #endregion #region Validation public void BusinessValidation(TaxesAndPenalties taxesAndPenalties, List <ErrorMessage> errorMessageList, ErrorMessages errorMessages) { if (taxesAndPenalties != null) { ErrorMessage errorMessage; if (taxesAndPenalties.HasFiledForm4868.HasValue && taxesAndPenalties.HasFiledForm4868.Value) { errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( Convert.ToString(taxesAndPenalties.FederalExtensionFiledDate), Constants.TAX_AND_WRAP_UP_REQUIRED_EXTENSION_FILED_DATE, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } if (taxesAndPenalties.FederalExtensionFiledDate.HasValue && taxesAndPenalties.FederalExtensionFiledDate.Value != null) { errorMessage = BusinessValidationRepository.AssertDateIsLesser(taxesAndPenalties.FederalExtensionFiledDate.Value, DUE_DATE, Constants.TAX_AND_WRAP_UP_VALIDATION_EXTENSION_FILED_DATE, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } if (taxesAndPenalties.HasPaidFederalExtensionWithForm4868.HasValue && taxesAndPenalties.HasPaidFederalExtensionWithForm4868.Value) { errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( Convert.ToString(taxesAndPenalties.FederalExtensionAmount), Constants.TAX_AND_WRAP_UP_EXTENSTION_AMOUNT, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( Convert.ToString(taxesAndPenalties.FederalExtensionAmountPaidDate), Constants.TAX_AND_WRAP_UP_EXTENSION_DATE, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } if (taxesAndPenalties.FederalExtensionAmountPaidDate.HasValue && taxesAndPenalties.FederalExtensionAmountPaidDate.Value != null) { errorMessage = BusinessValidationRepository.AssertDateIsLesser(taxesAndPenalties.FederalExtensionAmountPaidDate.Value, DUE_DATE, Constants.TAX_AND_WRAP_UP_VALIDATION_EXTENSION_DATE, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } if (taxesAndPenalties.IsFilingReturnAfterDueDate.HasValue && taxesAndPenalties.IsFilingReturnAfterDueDate.Value) { errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( Convert.ToString(taxesAndPenalties.FilingDate), Constants.TAX_AND_WRAP_UP_FILING_DATE, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } if (taxesAndPenalties.FilingDate.HasValue && taxesAndPenalties.FilingDate.Value != null) { errorMessage = BusinessValidationRepository.AssertDateIsGreater(taxesAndPenalties.FilingDate.Value, DUE_DATE, Constants.TAX_AND_WRAP_UP_VALIDATION_FILED_DATE, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } if (taxesAndPenalties.BankDetails != null) { errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( taxesAndPenalties.BankDetails.BankName, Constants.TAX_AND_WRAP_UP_BANK_NAME, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { errorMessage = BusinessValidationRepository.AssertIsNumbersLettersAndHyphen( taxesAndPenalties.BankDetails.BankName, Constants.TAX_AND_WRAP_UP_INVALID_BANK_NAME, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( taxesAndPenalties.BankDetails.RoutingTransitNumber, Constants.TAX_AND_WRAP_UP_ROUTING_NUMBER, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { errorMessage = BusinessValidationRepository.AssertIsValidRTN( taxesAndPenalties.BankDetails.RoutingTransitNumber, Constants.TAX_AND_WRAP_UP_ROUTING_NUMBER_VALIDATION, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( taxesAndPenalties.BankDetails.AccountNumber, Constants.TAX_AND_WRAP_UP_ACCOUNT_NUMBER, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { errorMessage = BusinessValidationRepository.AssertIsAccountNumber( taxesAndPenalties.BankDetails.AccountNumber, Constants.TAX_AND_WRAP_UP_ACCOUNT_NUMBER_VALIDATION, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } if (Utilities.ConvertToInteger32(taxesAndPenalties.BankDetails.BankAccountTypeCode) == 0) { if (taxesAndPenalties.BankDetails.BankAccountTypeCode != AccountType.Checking && taxesAndPenalties.BankDetails.BankAccountTypeCode != AccountType.Saving) { errorMessage = BusinessValidationRepository.AssertGreaterThanZero(Utilities.ConvertToDouble(taxesAndPenalties.BankDetails.BankAccountTypeCode), Constants.TAX_AND_WRAP_UP_TYPE_OF_ACCOUNT, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } } if (taxesAndPenalties.ThirdPartyDesignee != null) { errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( taxesAndPenalties.ThirdPartyDesignee.DesigneeName, Constants.TAX_AND_WRAP_UP_DESIGNEE_NAME, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { errorMessage = BusinessValidationRepository.AssertIsNumbersLettersAndHyphen( taxesAndPenalties.ThirdPartyDesignee.DesigneeName, Constants.TAX_AND_WRAP_UP_INVALID_DESIGNEE_NAME, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( taxesAndPenalties.ThirdPartyDesignee.PIN, Constants.TAX_AND_WRAP_UP_DESIGNEE_PERSONAL_IDENTIFICATION_NUMBER, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { errorMessage = BusinessValidationRepository.AssertIsWithinRange( taxesAndPenalties.ThirdPartyDesignee.PIN, 5, 5, Constants.TAX_AND_WRAP_UP_INVALID_DESIGNEE_PERSONAL_IDENTIFICATION_NUMBER, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } errorMessage = BusinessValidationRepository.AssertIsNotNullOrEmpty( taxesAndPenalties.ThirdPartyDesignee.PhoneNumber, Constants.TAX_AND_WRAP_UP_DESIGNEE_PHONE_NO, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } else { errorMessage = BusinessValidationRepository.AssertIsWithinPhoneNoRange( taxesAndPenalties.ThirdPartyDesignee.PhoneNumber, 12, 12, Constants.TAX_AND_WRAP_UP_INVALID_DESIGNEE_PHONE_NUMBER, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } if (!Utilities.IsStringEmpty(taxesAndPenalties.InCareOf)) { errorMessage = BusinessValidationRepository.AssertIsNumbersLettersAndHyphen( taxesAndPenalties.InCareOf, Constants.TAX_AND_WRAP_UP_INVALID_INCARE_OF, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } if (!Utilities.IsStringEmpty(taxesAndPenalties.InCareOfPhoneNumber)) { errorMessage = BusinessValidationRepository.AssertIsWithinPhoneNoRange( taxesAndPenalties.InCareOfPhoneNumber, 12, 12, Constants.TAX_AND_WRAP_UP_INVALID_INCARE_PHONE_NUMBER, errorMessages); if (errorMessage != null) { errorMessageList.Add(errorMessage); } } } }