public void TestSetup() { uint codeOrderOne = 1; uint codeOrderTwo = 1; BookParty partyOne = new BookParty(BookParty.UNKNOWN_CONTRACT, BookParty.UNKNOWN_POSITION); BookParty partyTwo = new BookParty(BookParty.UNKNOWN_CONTRACT, BookParty.UNKNOWN_POSITION); orderOne = new BookIndex(partyOne, (uint)ArticleSymbolCode.ARTICLE_INCOME_GROSS, codeOrderOne); orderTwo = new BookIndex(partyTwo, (uint)ArticleSymbolCode.ARTICLE_INCOME_GROSS, codeOrderTwo); }
public static ITargetStream CreateEmptyStream() { var targets = new Dictionary <IBookIndex, IBookTarget>(); var lastParty = BookParty.GetEmpty(); var lastIndex = BookIndex.GetEmpty(); return(new TargetStream(targets, lastParty, lastIndex)); }
public void TestSetup() { ICodeIndex contractOrderOne = new CodeIndex(PARTY_CODE_DEFAULT, 1); ICodeIndex positionOrderOne = new CodeIndex(PARTY_CODE_DEFAULT, 1); ICodeIndex contractOrderTwo = new CodeIndex(PARTY_CODE_DEFAULT, 2); ICodeIndex positionOrderTwo = new CodeIndex(PARTY_CODE_DEFAULT, 2); partyOne = new BookParty(contractOrderOne, positionOrderOne); partyTwo = new BookParty(contractOrderTwo, positionOrderTwo); }
public static IDictionary <IBookIndex, IBookTarget> BuildEvaluationStream(IDictionary <IBookIndex, IBookTarget> initialStream, IBookParty[] contracts, IBookParty[] positions, IPayrollArticle article, IProcessConfig configModule) { ITargetValues emptyValues = null; IPayrollConcept concept = configModule.FindConcept(article.ConceptCode()); IBookParty[] parties = concept.GetTargetParties(BookParty.GetEmpty(), contracts, positions); var targets = parties.Aggregate(initialStream, (agr, party) => BuildArticleTarget(initialStream, party, article, emptyValues, configModule)); return(targets); }
public ITargetStream CreateEvaluationStream(IProcessConfig configModule) { IBookParty[] contracts = CollectPartiesForContracts(); IBookParty[] positions = CollectPartiesForPositions(); var targetsInit = TargetStreamBuilder.BuildStreamCopy(__targets); var articleList = TargetStreamBuilder.BuildArticleStream(__targets); var targetsDict = articleList.Aggregate(targetsInit, (agr, article) => TargetStreamBuilder.BuildEvaluationStream(agr, contracts, positions, article, configModule)); var targetsEval = targetsDict.OrderBy(x => x.Value.Article()). ToDictionary(key => key.Key, val => val.Value); var lastParty = BookParty.GetEmpty(); var lastIndex = BookIndex.GetEmpty(); return(new TargetStream(targetsEval, lastParty, lastIndex)); }