2
2
3
3
namespace CodelyTv . Booking
4
4
{
5
- public sealed class Booking
5
+ public class BookingDetails
6
+ {
7
+ public BookingId Id { get ; }
8
+ public DateTime StartDate { get ; }
9
+ public DateTime EndDate { get ; }
10
+ public CustomerId CustomerId { get ; }
11
+ public CustomerName CustomerName { get ; }
12
+ public EmailAddress CustomerEmail { get ; }
13
+ public BookingType BookingType { get ; }
14
+ public DiscountType DiscountType { get ; }
15
+ public DiscountValue DiscountValue { get ; }
16
+ public TaxType TaxType { get ; }
17
+ public TaxValue TaxValue { get ; }
18
+
19
+ public BookingDetails (
20
+ BookingId id , DateTime startDate , DateTime endDate , CustomerId customerId ,
21
+ CustomerName customerName , EmailAddress customerEmail , BookingType bookingType ,
22
+ DiscountType discountType , DiscountValue discountValue , TaxType taxType , TaxValue taxValue )
6
23
{
7
- private readonly BookingId id ;
8
- private readonly DateTime startDate ;
9
- private readonly DateTime endDate ;
10
- private readonly CustomerId customerId ;
11
- private readonly CustomerName customerName ;
12
- private readonly EmailAddress customerEmail ;
13
- private readonly BookingType bookingType ;
14
- private readonly DiscountType discountType ;
15
- private readonly DiscountValue discountValue ;
16
- private readonly TaxType taxType ;
17
- private readonly TaxValue taxValue ;
24
+ Id = id ;
25
+ StartDate = startDate ;
26
+ EndDate = endDate ;
27
+ CustomerId = customerId ;
28
+ CustomerName = customerName ;
29
+ CustomerEmail = customerEmail ;
30
+ BookingType = bookingType ;
31
+ DiscountType = discountType ;
32
+ DiscountValue = discountValue ;
33
+ TaxType = taxType ;
34
+ TaxValue = taxValue ;
35
+ }
18
36
19
- public Booking (
20
- BookingId id ,
21
- DateTime startDate ,
22
- DateTime endDate ,
23
- CustomerId customerId ,
24
- CustomerName customerName ,
25
- EmailAddress customerEmail ,
26
- BookingType bookingType ,
27
- DiscountType discountType ,
28
- DiscountValue discountValue ,
29
- TaxType taxType ,
30
- TaxValue taxValue
31
- )
32
- {
33
- this . id = id ;
34
- this . startDate = startDate ;
35
- this . endDate = endDate ;
36
- this . customerId = customerId ;
37
- this . customerName = customerName ;
38
- this . customerEmail = customerEmail ;
39
- this . bookingType = bookingType ;
40
- this . discountType = discountType ;
41
- this . discountValue = discountValue ;
42
- this . taxType = taxType ;
43
- this . taxValue = taxValue ;
44
- }
37
+ public Booking ( BookingDetails details )
38
+ {
39
+ this . id = details . Id ;
40
+ this . startDate = details . StartDate ;
41
+ this . endDate = details . EndDate ;
42
+ this . customerId = details . CustomerId ;
43
+ this . customerName = details . CustomerName ;
44
+ this . customerEmail = details . CustomerEmail ;
45
+ this . bookingType = details . BookingType ;
46
+ this . discountType = details . DiscountType ;
47
+ this . discountValue = details . DiscountValue ;
48
+ this . taxType = details . TaxType ;
49
+ this . taxValue = details . TaxValue ;
50
+ }
45
51
46
52
public BookingStatus StatusFor ( DateTime date )
47
53
{
@@ -58,4 +64,4 @@ public BookingStatus StatusFor(DateTime date)
58
64
return BookingStatus . FINISHED ;
59
65
}
60
66
}
61
- }
67
+ }
0 commit comments