public static Result <TaxableIncomeSum, string> GetSumIncomeTaxGeneral(IEnumerable <ResultPair> results, Func <TargetItem, bool> filterTargetFunc, Func <ResultItem, bool> filterValuesFunc)
        {
            TaxableIncomeSum initialResult = new TaxableIncomeSum();

            Result <TaxableIncomeSum, string> summaryResult = results
                                                              .GetResultValuesInAggrAndError <ResultItem, IncomeTaxGeneralValue, TaxableIncomeSum>(
                initialResult, filterTargetFunc, filterValuesFunc, ResultFilters.IncomeTaxableFunc,
                GetSumResultUtils.GetSumTaxableIncome);

            return(summaryResult);
        }
Exemplo n.º 2
0
                public override EvaluateSource GetNewValues(EvaluateSource initValues)
                {
                    Result <TaxableIncomeSum, string> taxableIncome = GetTaxableIncome(InternalValues, InternalTarget);

                    if (ResultMonadUtils.HaveAnyResultFailed(taxableIncome))
                    {
                        return(ReturnFailureAndError(initValues, taxableIncome.Error));
                    }

                    TaxableIncomeSum taxableValues = taxableIncome.Value;

                    return(new EvaluateSource
                    {
                        // PROPERTIES SET
                        GeneralIncome = taxableValues.IncomeGeneral(),
                        ExcludeIncome = taxableValues.IncomeExclude(),
                        LolevelIncome = taxableValues.IncomeLolevel(),
                        TaskAgrIncome = taxableValues.IncomeTaskAgr(),
                        PartnerIncome = taxableValues.IncomePartner(),
                        // PROPERTIES SET
                    });
                }
 private static Result <TaxableIncomeSum, string> GetSumTaxableIncome(TaxableIncomeSum agr, TargetItem resultTarget, IncomeTaxGeneralValue resultValue)
 {
     return(Result.Ok <TaxableIncomeSum, string>(agr.Aggregate(resultValue.IncomeGeneral, resultValue.IncomeExclude,
                                                               resultValue.IncomeLolevel, resultValue.IncomeTaskAgr, resultValue.IncomePartner)));
 }