-
Notifications
You must be signed in to change notification settings - Fork 1
/
DomainErrors.kt
72 lines (37 loc) · 1.86 KB
/
DomainErrors.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package alo.meetups.domain.model
import java.net.MalformedURLException
import java.util.UUID
// Type of Errors
sealed interface DomainError
sealed interface CreateMeetupError : DomainError
sealed interface CancelMeetupError : DomainError
sealed interface AttendMeetupError : DomainError
sealed interface FinishMeetupError : DomainError
sealed interface RateMeetupError : DomainError
sealed interface CreateGroupError : DomainError
sealed interface IncludeMeetupError : DomainError
sealed interface JoinGroupError : DomainError
sealed interface LeaveGroupError : DomainError
// Errors
object UserNotFound : CreateMeetupError, AttendMeetupError, RateMeetupError, JoinGroupError, LeaveGroupError
// Meetup errors
object MeetupNotFound : CancelMeetupError, AttendMeetupError, FinishMeetupError, RateMeetupError, IncludeMeetupError
object MeetupAlreadyExists : CreateMeetupError
object TooLongTopic : CreateMeetupError
object TooLongDetails : CreateMeetupError
object MeetupDateAlreadyPassed : CreateMeetupError, AttendMeetupError
data class AlreadyAttendingToTheMeetup(val attendant: UUID) : AttendMeetupError
object MeetupIsNotOpenForAttendants : AttendMeetupError
object OnlyUpcomingMeetupsCanBeFinished : FinishMeetupError
object OnlyUpcomingMeetupsCanBeCancelled : CancelMeetupError
data class InvalidLinkURL(val exception: MalformedURLException) : CreateMeetupError
object InvalidScore : RateMeetupError
object MeetupNotFinishedYet : RateMeetupError
object OnlyAttendantsCanRate : RateMeetupError
// Group errors
object GroupNotFound : JoinGroupError, IncludeMeetupError, LeaveGroupError
object GroupAlreadyExists : CreateGroupError
object TooLongTitle : CreateGroupError
data class MemberWasNotPartOfTheGroup(val member: UUID) : LeaveGroupError
data class AlreadyJoined(val member: UUID) : JoinGroupError
data class AlreadyIncluded(val meetup: UUID) : IncludeMeetupError