@@ -13,39 +13,39 @@ public class Session extends BaseEntity {
13
13
private final Long id ;
14
14
private final Long courseId ;
15
15
private final SessionType type ;
16
- private final CoverImage coverImage ;
16
+ private final CoverImages coverImages ;
17
17
private final Period period ;
18
18
private Status status ;
19
19
private final Students students ;
20
20
private final PaidCondition paidCondition ;
21
21
22
- public static Session ofFree (Long id , Long courseId , CoverImage coverImage , LocalDate startDate , LocalDate endDate ) {
23
- return new Session (id , courseId , SessionType .FREE , coverImage , new Period (startDate , endDate ), Status .NOT_OPEN , 0 , 0L , LocalDateTime .now (), null );
22
+ public static Session ofFree (Long id , Long courseId , CoverImages coverImages , LocalDate startDate , LocalDate endDate ) {
23
+ return new Session (id , courseId , SessionType .FREE , coverImages , new Period (startDate , endDate ), Status .NOT_OPEN , 0 , 0L , LocalDateTime .now (), null );
24
24
}
25
25
26
- public static Session ofPaid (Long id , Long courseId , CoverImage coverImage , LocalDate startDate , LocalDate endDate , int maxStudents , Long fee ) {
27
- return new Session (id , courseId , SessionType .PAID , coverImage , new Period (startDate , endDate ), Status .NOT_OPEN , maxStudents , fee , LocalDateTime .now (), null );
26
+ public static Session ofPaid (Long id , Long courseId , CoverImages coverImages , LocalDate startDate , LocalDate endDate , int maxStudents , Long fee ) {
27
+ return new Session (id , courseId , SessionType .PAID , coverImages , new Period (startDate , endDate ), Status .NOT_OPEN , maxStudents , fee , LocalDateTime .now (), null );
28
28
}
29
29
30
- public static Session of (Long id , Long courseId , SessionType type , CoverImage coverImage , Status status , LocalDate startDate , LocalDate endDate , int maxStudents , Long fee , LocalDateTime createdAt , LocalDateTime updatedAt ) {
31
- return new Session (id , courseId , type , coverImage , new Period (startDate , endDate ), status , maxStudents , fee , createdAt , updatedAt );
30
+ public static Session of (Long id , Long courseId , SessionType type , CoverImages coverImages , Status status , LocalDate startDate , LocalDate endDate , int maxStudents , Long fee , LocalDateTime createdAt , LocalDateTime updatedAt ) {
31
+ return new Session (id , courseId , type , coverImages , new Period (startDate , endDate ), status , maxStudents , fee , createdAt , updatedAt );
32
32
}
33
33
34
- private Session (Long id , Long courseId , SessionType type , CoverImage coverImage , Period period , Status status , int maxStudents , Long fee , LocalDateTime createdAt , LocalDateTime updatedAt ) {
34
+ private Session (Long id , Long courseId , SessionType type , CoverImages coverImages , Period period , Status status , int maxStudents , Long fee , LocalDateTime createdAt , LocalDateTime updatedAt ) {
35
35
super (createdAt , updatedAt );
36
- validateNotNull (id , coverImage , period );
36
+ validateNotNull (id , coverImages , period );
37
37
this .id = id ;
38
38
this .courseId = courseId ;
39
39
this .type = type ;
40
- this .coverImage = coverImage ;
40
+ this .coverImages = coverImages ;
41
41
this .period = period ;
42
42
this .status = status ;
43
43
this .students = new Students ();
44
44
this .paidCondition = new PaidCondition (maxStudents , fee );
45
45
}
46
46
47
- private void validateNotNull (Long id , CoverImage coverImage , Period period ) {
48
- if (id == null || coverImage == null || period == null ) {
47
+ private void validateNotNull (Long id , CoverImages coverImages , Period period ) {
48
+ if (id == null || coverImages == null || period == null ) {
49
49
throw new InvalidSessionException ();
50
50
}
51
51
}
@@ -83,10 +83,6 @@ public Long courseId() {
83
83
return courseId ;
84
84
}
85
85
86
- public Long imageId () {
87
- return coverImage .getId ();
88
- }
89
-
90
86
public String type () {
91
87
return type .name ();
92
88
}
@@ -116,7 +112,7 @@ public String toString() {
116
112
return "Session{" +
117
113
"id=" + id +
118
114
", type=" + type +
119
- ", coverImage =" + coverImage +
115
+ ", coverImages =" + coverImages +
120
116
", period=" + period +
121
117
", status=" + status +
122
118
", students=" + students +
0 commit comments