-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUserSearchEvents.java
More file actions
103 lines (86 loc) · 3.29 KB
/
UserSearchEvents.java
File metadata and controls
103 lines (86 loc) · 3.29 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package com.danielagapov.spawn.shared.events;
import com.danielagapov.spawn.user.api.dto.BaseUserDTO;
import com.danielagapov.spawn.user.api.dto.FriendUser.RecommendedFriendUserDTO;
import com.danielagapov.spawn.shared.util.SearchedUserResult;
import java.util.List;
import java.util.Set;
import java.util.UUID;
/**
* Domain events for User Search module inter-module communication.
* Used to break circular dependencies and allow other modules to query user search functionality.
*/
public final class UserSearchEvents {
private UserSearchEvents() {
// Utility class - prevent instantiation
}
// ========== Recommended Friends Query Events ==========
/**
* Query event to request limited recommended friends for a user.
* Published by other modules, consumed by User module.
*/
public record GetLimitedRecommendedFriendsQuery(
UUID userId,
UUID requestId // Correlation ID for async response matching
) {}
/**
* Response event containing recommended friends list.
* Published by User module in response to GetLimitedRecommendedFriendsQuery.
*/
public record RecommendedFriendsResponse(
UUID requestId, // Correlation ID to match with query
List<RecommendedFriendUserDTO> recommendedFriends
) {}
// ========== Search Friends Query Events ==========
/**
* Query event to search for recommended friends by search query.
* Published by other modules, consumed by User module.
*/
public record GetRecommendedFriendsBySearchQuery(
UUID requestingUserId,
String searchQuery,
UUID requestId // Correlation ID for async response matching
) {}
/**
* Response event containing search results.
* Published by User module in response to GetRecommendedFriendsBySearchQuery.
*/
public record SearchedUserResultResponse(
UUID requestId, // Correlation ID to match with query
SearchedUserResult searchedUserResult
) {}
// ========== User Search Query Events ==========
/**
* Query event to search for users by query string.
* Published by other modules, consumed by User module.
*/
public record SearchByQueryEvent(
String searchQuery,
UUID requestingUserId, // Can be null
UUID requestId // Correlation ID for async response matching
) {}
/**
* Response event containing search results.
* Published by User module in response to SearchByQueryEvent.
*/
public record SearchByQueryResponse(
UUID requestId, // Correlation ID to match with query
List<BaseUserDTO> users
) {}
// ========== Excluded User IDs Query Events ==========
/**
* Query event to get excluded user IDs for a user.
* Published by other modules, consumed by User module.
*/
public record GetExcludedUserIdsQuery(
UUID userId,
UUID requestId // Correlation ID for async response matching
) {}
/**
* Response event containing excluded user IDs.
* Published by User module in response to GetExcludedUserIdsQuery.
*/
public record ExcludedUserIdsResponse(
UUID requestId, // Correlation ID to match with query
Set<UUID> excludedUserIds
) {}
}