namespace GuestOps.Web; public static class Demo { public static async Task Seed(IStore store) { var hotel = new Hotel { Name = "The Willow House", Signature = "Warm regards,\nThe Willow House team" }; hotel.HotelId = hotel.Id; var user = new StaffUser { HotelId = hotel.Id, Name = "Alex Morgan", Email = hotel.Id + "@example.invalid" }; await store.Insert(hotel); await store.Insert(user); await store.Insert(new Mailbox{HotelId=hotel.Id,Email="reservations@example.invalid",Status="NeedsReconnect",SyncErrorCode="ReconnectRequired",SyncError="Sample recovery state: a hotel owner would reconnect Google here. No real mailbox is connected.",LastSyncAt=DateTime.UtcNow.AddHours(-2),LastAttemptAt=DateTime.UtcNow.AddMinutes(-5)}); var questions = new[] { ("Emma Wilson", "A little question before our weekend stay", "Hello! We're looking forward to staying with you on Friday. Is there somewhere to park our car, and do we need to book a space?\n\nMany thanks,\nEmma", "Parking", "Hello Emma,\n\nWe're looking forward to welcoming you on Friday. Complimentary parking is available in our courtyard, subject to availability. There is no need to reserve a space.\n\nWarm regards,\nThe Willow House team"), ("James & Sophie", "Arriving a little earlier on Saturday", "Hi there, our train gets in at 12:30. Would it be possible to leave our bags with you before check-in? Thank you!", "Arrival", ""), ("Oliver Brooks", "Changing the dates of our booking", "Our plans have changed. Could we move reservation WH-2481 to the following weekend? Please let me know whether there is a charge.", "Booking change", ""), ("Charlotte Reed", "Breakfast options for our stay", "Good morning, do you offer vegetarian breakfast options? My partner also has a nut allergy.", "Dietary request", ""), ("Amelia Patel", "Thank you for a lovely stay", "We had a wonderful weekend. Please pass on our thanks to the team!", "General", "") }; for (int i = 0; i < questions.Length; i++) { var q = questions[i]; await store.Insert(new Conversation { HotelId = hotel.Id, ProviderMessageId = Guid.NewGuid().ToString("N"), From = q.Item1 + " ", Subject = q.Item2, Body = q.Item3, Category = q.Item4, Draft = q.Item5, Status = i == 0 ? "DraftReady" : i == 4 ? "Completed" : "NeedsAttention", ReceivedAt = DateTime.UtcNow.AddMinutes(-i * 28 - 12), Note = i == 2 ? "A booking change needs a member of your team." : i == 3 ? "Check dietary requirements with the hotel team." : "" }); } foreach (var k in new[] { ("Parking", "Complimentary parking is available in our courtyard, subject to availability. Spaces cannot be reserved.", "parking, car"), ("Check-in and luggage", "Check-in is from 3pm. Guests may leave their luggage with reception before check-in.", "check-in, luggage"), ("Breakfast", "Breakfast is served from 7am to 10am. Please ask our team about dietary requirements.", "breakfast") }) await store.Insert(new KnowledgeEntry { HotelId = hotel.Id, Title = k.Item1, Category = "Your stay", Answer = k.Item2, Keywords = k.Item3, Approved = true }); await store.Insert(new Activity { HotelId = hotel.Id, UserName = "GuestOps", Action = "Opened an isolated preview workspace" }); var sample = new PmsSnapshot { HotelId=hotel.Id,ReservationId="sample-reservation",Confirmation="WH-2481",GuestName="Oliver Brooks",Arrival=DateTime.UtcNow.AddDays(10).ToString("yyyy-MM-dd"),Departure=DateTime.UtcNow.AddDays(12).ToString("yyyy-MM-dd"),RoomType="Garden King",Status="Reserved",Total="320 GBP" }; await store.Insert(new PmsChange { HotelId=hotel.Id,ReservationId=sample.ReservationId,Before=sample,Kind="StayDates",Arrival=DateTime.UtcNow.AddDays(17).ToString("yyyy-MM-dd"),Departure=DateTime.UtcNow.AddDays(19).ToString("yyyy-MM-dd"),ProposedBy=user.Id,Detail="Sample proposal for interface review only. No PMS connection or update is available in this workspace." }); await store.Insert(new PaymentRequest {HotelId=hotel.Id,Reference="WH-2481-DEPOSIT",Email="guest@example.invalid",Description="Deposit for Oliver Brooks ยท WH-2481",Amount=80,Currency="GBP",ProposedBy=user.Id,Detail="Sample proposal only. No invoice or email can be created in preview."}); return user; } }