예제 #1
0
 public void Execute(int year, int month)
 {
     if (_transactionService.Get(year, month, unMappedOnly: true).Any())
     {
         _outputWriter.WriteErrorLine("Month contains unmapped transactions");
     }
     _summaryService.Get(year, month)
     .Select(m => new
     {
         m.Key.Section,
         m.Key.Position,
         m.Key.Category,
         Total = m.Value
     })
     .OrderByDescending(g => g.Section)
     .ThenBy(g => g.Position)
     .ThenBy(g => g.Category)
     .Tabulate(_outputWriter, true, 5, new TotalColumnNames("Section", "Total"));
 }
 public IActionResult GetYear(int year)
 {
     return(Ok(_summaryService.Get(year)));
 }