internal Booking(Events.V1.BookingAddedToAccount @event) { Id = BookingId.FromGuid(@event.BookingId); Date = BookingDate.FromDate(@event.Date); Payment = Payment.FromDecimal(@event.Amount, @event.CurrencyCode); Description = Description.FromString(@event.Description); }
public void ChangeBooking(BookingId id, Payment amount, BookingDate date, Description description) { Apply(new V1.BookingChanged(Id, id.Value, amount.Amount, amount.CurrencyCode, date.Value, description.Value)); }
/// <summary> /// Book a new payment /// </summary> /// <param name="id">Booking Id</param> /// <param name="amount">Amount of the payment</param> /// <param name="date">Date of the booking</param> /// <param name="description">A short description for what this payment is made</param> public void BookPayment(BookingId id, Payment amount, BookingDate date, Description description) { Apply(new V1.BookingAddedToAccount(Id, id.Value, amount.Amount, amount.CurrencyCode, date.Value, description.Value)); }
#pragma warning disable CC0068 // Unused Method #pragma warning disable IDE0051 // Remove unused private members #pragma warning disable CC0057 // Unused parameters #pragma warning disable IDE0060 // Remove unused parameter private void Handle(Events.V1.BookingChanged @event) { Date = BookingDate.FromDate(@event.Date); Payment = Payment.FromDecimal(@event.Amount, @event.CurrencyCode); Description = Description.FromString(@event.Description); }