public IActionResult GetAppointmentRatio(int days)
        {
            var currentUser          = GetCurrentUserProfile();
            var startdate            = DateTime.Now - TimeSpan.FromDays(days);
            var appointmentsKept     = _appointmentSessionRepo.GetAppointmentKeptTotal(currentUser.Id, startdate);
            var appointmentsBooked   = _callSessionRepo.GetAppointmentBookedTotal(currentUser.Id, startdate);
            var appointmentRatioView = new AppointmentRatioViewModel()
            {
                AppointmentsKept   = appointmentsKept,
                AppointmentsBooked = appointmentsBooked
            };

            return(Ok(appointmentRatioView));
        }
Beispiel #2
0
        public IActionResult GetAllLogTotals(int days)
        {
            var currentUser      = GetCurrentUserProfile();
            var startdate        = DateTime.Now - TimeSpan.FromDays(days);
            var presentations    = _appointmentSessionRepo.GetPresentationsTotal(currentUser.Id, startdate);
            var appointmentsKept = _appointmentSessionRepo.GetAppointmentKeptTotal(currentUser.Id, startdate);
            var calls            = _callSessionRepo.GetCallsTotal(currentUser.Id, startdate);
            var callGoal         = _callSessionRepo.GetCallGoalsTotal(currentUser.Id, startdate);
            var contacts         = _callSessionRepo.GetContactsTotal(currentUser.Id, startdate);
            var appointments     = _callSessionRepo.GetAppointmentBookedTotal(currentUser.Id, startdate);
            var closes           = _saleRepo.GetClosesTotal(currentUser.Id, startdate);
            var commission       = _saleRepo.GetCommissionTotal(currentUser.Id, startdate);

            var logTotals = new LogTotalsViewModel()
            {
                Commission       = commission,
                Calls            = calls,
                Appointments     = appointments,
                AppointmentsKept = appointmentsKept,
                Presentations    = presentations,
                Contacts         = contacts,
                Closes           = closes,
                CallGoals        = callGoal
            };

            return(Ok(logTotals));
        }