private Booking(CustomerId customerId, FacilityId facilityId, List <BookedRecordData> records) : this() { Id = new BookingId(Guid.NewGuid()); this.customerId = customerId; this.facilityId = facilityId; this.creationDate = DateTime.Now; this.status = BookingStatus.Booked; foreach (var service in records) { var bookingService = new BookedRecord( service.EmployeeId, service.OfferId, service.Price, service.Date, service.DurationInMinutes ); bookedRecords.Add(bookingService); AddDomainEvent(new BookedEvent( bookingService.Id, customerId, facilityId, service.OfferId )); } }
private Booking(CustomerId customerId, FacilityId facilityId, BookingStatus status, List <BookedRecordData> records) : this() { Id = new BookingId(Guid.NewGuid()); this.customerId = customerId; this.FacilityId = facilityId; this.status = status; foreach (var service in records) { var bookedRecord = new BookedRecord( service.EmployeeId, service.OfferId, service.Price, service.Date, service.DurationInMinutes ); bookedRecords.Add(bookedRecord); if (status == BookingStatus.Booked) { AddDomainEvent(new BookedEvent( bookedRecord.Id, customerId, facilityId, service.OfferId )); } } }
public BookedRecordToBeChangedMustBeUnfinishedRule(BookedRecord bookingService) { this.bookedRecord = bookingService; }