示例#1
0
        public ReportModel[] BuildForBillingDelivery()
        {
            var lists             = taskManagerClient.GetBoardLists("58d22275df59d0815216e1f0");
            var listNames         = lists.Select(l => l.Name).ToArray();
            var doneList          = lists.First(l => l.Name.Contains("Готово"));
            var listNameToIdIndex = lists.ToDictionary(l => l.Name, l => l.Id);
            var aggregation       = cardsAggregator.Aggregate(doneList);

            var reportsList = new List <ReportModel>
            {
                new ReportModel("БД", Build(aggregation, listNames, listNameToIdIndex)),
                new ReportModel("БД.Продукты", Build(aggregation.FilterBy(KnownTaskQueuesLabels.ProductQueueLabel), listNames, listNameToIdIndex)),
                new ReportModel("БД.CRM", Build(aggregation.FilterBy(KnownTaskQueuesLabels.CrmQueueLabel), listNames, listNameToIdIndex)),
                new ReportModel("БД.Инфраструктура", Build(aggregation.FilterBy(KnownTaskQueuesLabels.InfrastructureQueueLabel), listNames, listNameToIdIndex)),
                new ReportModel("БД.Эксплуатация", Build(aggregation.FilterBy(KnownTaskQueuesLabels.SupportQueueLabel), listNames, listNameToIdIndex))
            };

            return(reportsList.ToArray());
        }
示例#2
0
        public void TestReadListsForBoard()
        {
            var actualBoards = trelloClient.GetAllBoards(testOrgId);
            var firstBoard   = actualBoards.First();
            var boardLists   = trelloClient.GetBoardLists(firstBoard.Id);

            Assert.True(boardLists.Length >= 1);

            Console.WriteLine(actualBoards.Stringify());
            Console.WriteLine(boardLists.Stringify());
        }
示例#3
0
        public CardsAggregationModel Aggregate(BoardList doneList, BoardList additionalDoneList = null)
        {
            if (additionalDoneList != null && !string.Equals(doneList.BoardId, additionalDoneList.BoardId))
            {
                throw new ArgumentException($"Both lists should be from single board! Observed boards ids: {doneList.BoardId}, {additionalDoneList.BoardId}.");
            }

            var additionalDoneListId = additionalDoneList?.Id;
            var cardIds = taskManagerClient.GetBoardLists(doneList.BoardId).Where(x => x.Id.Equals(doneList.Id) || (additionalDoneListId != null && x.Id.Equals(additionalDoneListId)))
                          .Select(l => l.Cards.Select(c => c.Id))
                          .SelectMany(i => i)
                          .ToArray();

            return(CardsAggregationModel.Create(cardIds.Select(cardId => cardStatsBuilder.Build(cardId)).ToArray()));
        }