public async Task <GetHotelCompanyDto> GetHotelCompanyAsync()
        {
            var hotelCompany = await _hotelCompanyRepository.GetAsync();

            var getHotelCompanyDto = _hotelCompanyConverter.HotelCompanyToGetHotelCompanyDto(hotelCompany);

            return(getHotelCompanyDto);
        }
Exemplo n.º 2
0
        public async Task <GetInvoiceDto> GetInvoiceData(int id)
        {
            var invoiceData = new GetInvoiceDto();

            var reservation = await _reservationRepository.GetAsync(id);

            reservation.Client = await _clientRepository.GetAsync(reservation.ClientId);

            reservation.Room = await _roomRepository.GetAsync(reservation.RoomId);

            var assignedMinuteServices = await _minuteServicesToReservationRepository.ListAssignedAsync(reservation.Id);

            var hotelCompany = await _hotelCompanyRepository.GetAsync();


            invoiceData.HotelCompanyDetails = _hotelCompanyConverter.HotelCompanyToGetHotelCompanyDto(hotelCompany);
            invoiceData.Positions.AddRange(assignedMinuteServices.Select(ms => _invoicePositionConverter.MinuteServiceToGetInvoicePositionDto(ms)));
            invoiceData.Positions.Add(_invoicePositionConverter.ReservationToGetInvoicePositionDto(reservation));
            invoiceData.ClientDetails = _clientConverter.ClientToGetClientDto(reservation.Client);
            invoiceData.IssueDate     = DateTime.Today;
            invoiceData.PaymentDate   = DateTime.Today;

            return(invoiceData);
        }