public async Task Handle(AppointmentMembersCheckedIn notification, CancellationToken cancellationToken)
        {
            var snapshot = await _db.AppointmentSnapshots.FindAsync(notification.AppointmentId);

            snapshot.State = notification.State;
            await _db.SaveChangesAsync(cancellationToken);
        }
        public async Task Handle(AppointmentRejected notification, CancellationToken cancellationToken)
        {
            var snapshot = await _db.AppointmentSnapshots.FindAsync(notification.AppointmentId);

            snapshot.State           = notification.State;
            snapshot.RejectionReason = notification.RejectionReason;
            await _db.SaveChangesAsync(cancellationToken);
        }
예제 #3
0
        public async Task Handle(AppointmentRescheduled notification, CancellationToken cancellationToken)
        {
            var snapshot = await _db.AppointmentSnapshots.FindAsync(notification.AppointmentId);

            snapshot.State       = notification.State;
            snapshot.ScheduledOn = notification.Date;
            await _db.SaveChangesAsync(cancellationToken);
        }
 public Task Handle(AppointmentCreated notification, CancellationToken cancellationToken)
 {
     _db.AppointmentSnapshots.Add(new AppointmentSnapshot
     {
         Id                      = notification.AppointmentId,
         State                   = notification.Data.State,
         ScheduledOn             = notification.Data.ScheduledOn,
         AttendingVeterinarianId = notification.Data.AttendingVeterinarianId,
         Owner                   = notification.Data.Owner,
         Pet                     = notification.Data.Pet,
         CancellationReason      = notification.Data.CancellationReason,
         RejectionReason         = notification.Data.RejectionReason,
         ReasonForVisit          = notification.Data.ReasonForVisit
     });
     return(_db.SaveChangesAsync(cancellationToken));
 }