示例#1
0
        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
                                   ));
            }
        }
示例#2
0
        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
                                       ));
                }
            }
        }
示例#3
0
 public BookedRecordToBeChangedMustBeUnfinishedRule(BookedRecord bookingService)
 {
     this.bookedRecord = bookingService;
 }