Esempio n. 1
0
        private async Task SendInvitedGuestEmail(EmailDto dataToSend, InvitedGuest guest)
        {
            var url = Configuration["EmailServiceUrl"];

            var acceptUrl = string.Format(Configuration["AcceptBooking"], guest.GuestToken);
            var cancelUrl = string.Format(Configuration["CancelBooking"], guest.GuestToken);
            dataToSend.EmailType = EmailTypeEnum.InvitedGuest;
            dataToSend.ButtonActionList = new Dictionary<string, string> { { acceptUrl, "Accept" }, { cancelUrl, "Cancel" } };
            var mailService = new RestManagementService();
            await mailService.CallPostMethod(url, dataToSend);
        }
Esempio n. 2
0
 private OrderFullResponse GetOrderFullResponse(InvitedGuest invitedGuest, long orderId)
 {
     if (invitedGuest == null) return new OrderFullResponse { id = orderId };
     return new OrderFullResponse
     {
         id = orderId,
         revision = null,
         modificationCounter = 0,
         bookingToken = invitedGuest.GuestToken,
         bookingId = invitedGuest.IdBooking,
         hostId = null,
         invitedGuestId = invitedGuest.Id
     };
 }
Esempio n. 3
0
 private EmailResponseDto GetInvitedguestFullResponse(InvitedGuest invitedGuest)
 {
     if (invitedGuest == null) return new EmailResponseDto();
     return new EmailResponseDto
     {
         id = invitedGuest.Id,
         revision = 0,
         modificationCounter = 0,
         email = invitedGuest.Email,
         accepted = invitedGuest.Accepted ?? false,
         guestToken = invitedGuest.GuestToken,
         bookingId = invitedGuest.IdBooking,
         modificationDate = invitedGuest.ModificationDate != null ? JsonConvert.SerializeObject(invitedGuest.ModificationDate.Value.ConvertDateTimeToMilliseconds()) : string.Empty
     };
 }
Esempio n. 4
0
 private InvitedguestFullResponse GetInvitedguestFullResponse(InvitedGuest invitedGuest)
 {
     if (invitedGuest == null)
     {
         return(new InvitedguestFullResponse());
     }
     return(new InvitedguestFullResponse
     {
         id = invitedGuest.Id,
         revision = 0,
         modificationCounter = 0,
         email = invitedGuest.Email,
         accepted = invitedGuest.Accepted ?? false,
         guestToken = invitedGuest.GuestToken,
         bookingId = invitedGuest.IdBooking,
         modificationDate = JsonConvert.SerializeObject(invitedGuest.ModificationDate)
     });
 }
        public static InvitedguestSearchDto EntityToApi(InvitedGuest item)
        {
            if (item == null)
            {
                return(new InvitedguestSearchDto());
            }

            return(new InvitedguestSearchDto
            {
                id = item.Id,
                revision = null,
                modificationCounter = 0,
                email = item.Email,
                accepted = item.Accepted ?? false,
                guestToken = item.GuestToken,
                bookingId = item.IdBooking,
                modificationDate = JsonConvert.SerializeObject(item.ModificationDate)
            });
        }
Esempio n. 6
0
        private List <InvitedGuest> CreateInvitationGuests(long bookingId, IList <string> guestList, string userEmail)
        {
            var result = new List <InvitedGuest>();

            foreach (var mail in guestList.Distinct())
            {
                var item = new InvitedGuest()
                {
                    IdBooking        = bookingId,
                    Email            = mail,
                    Accepted         = null,
                    ModificationDate = DateTime.Now,
                    GuestToken       = GetReservationToken(BookingTypeConst.GuestBooking, userEmail)
                };

                UoW.Repository <InvitedGuest>().Create(item);
                result.Add(item);
            }
            UoW.Commit();

            return(result);
        }