using BuddyFinance.Integration; using BuddyFinance.Integration.Models.ReportingServices; using BuddyFinance.Integration.Models.Statements; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; namespace BuddyFinance.WebApi.Controllers { /// /// Reporting /// [RoutePrefix("api/reporting")] public class ReportsController : BaseController { ReportServiceIntergrator reportService = new ReportServiceIntergrator(); /// /// Generate statement of transactions /// /// /// [AcceptVerbs("Get", "Post")] [Route("statement")] public GetPDF GetReport(GetStatement statement) { return reportService.GetReport(statement); } /// /// Get statement of transactions /// /// /// /// /// [HttpGet] [Route("statement")] public GetPDF GetReport(int profileId, DateTime? startDate = null, DateTime? endDate = null) { return reportService.GetReport(new GetStatement { ProfileId = profileId, StartDate = startDate ?? DateTime.Now.AddMonths(-1), EndDate = endDate ?? DateTime.Now }); } } }