Exemplo n.º 1
0
        /// <summary>
        /// Given user id get invoice
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public CabInfo GetUserInvoice(int userId)
        {
            List <Ride> rideList    = rideRepository.GetRides(userId);
            CabInfo     information = GetInvoiceSummary(rideList);

            return(information);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the invoice summary.
        /// </summary>
        /// <param name="rideList">The ride list.</param>
        /// <returns></returns>
        public CabInfo GetInvoiceSummary(List <Ride> rideList)
        {
            double  fare = CalculateFareForMultipleRides(rideList);
            CabInfo data = invoiceSummary.GetInvoice(rideList.Count, totalFare);

            return(data);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the invoice.
        /// </summary>
        /// <param name="numberOfRides">The number of rides.</param>
        /// <param name="totalFare">The total fare.</param>
        /// <returns></returns>
        public CabInfo GetInvoice(int numberOfRides, double totalFare)
        {
            double averageFare = totalFare / numberOfRides;

            information = new CabInfo(numberOfRides, totalFare, averageFare);

            return(information);
        }