Skip to content

feat(frontend-notification): implement management features and enhance UX#278

Merged
siervo-jallaine merged 17 commits intodevelopfrom
ui
Jan 9, 2026
Merged

feat(frontend-notification): implement management features and enhance UX#278
siervo-jallaine merged 17 commits intodevelopfrom
ui

Conversation

@siervo-jallaine
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ AI Code Analysis: I found some potential issues for you to review.


return ResponseEntity.ok(paginatedResponse);
}
private final CopyOnWriteArrayList<SseEmitter> emitters = new CopyOnWriteArrayList<>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 89). Please break this line.

User authenticatedUser = (User) authentication.getPrincipal();
int userId = authenticatedUser.getUserId();

Map<String, Object> paginatedResponse = service.listByUserId(userId, page, size, status);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 93). Please break this line.

List<Notification> findByUserId(@Param("userId") int userId,
Pageable pageable);

@Query("SELECT n FROM Notification n WHERE n.user_id = :userId AND n.status = :status " +
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 91). Please break this line.

@Query("SELECT COUNT(n) FROM Notification n WHERE n.user_id = :userId")
int countByUserId(@Param("userId") int userId);

@Query("SELECT COUNT(n) FROM Notification n WHERE n.user_id = :userId AND n.status = :status")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 96). Please break this line.

int countByUserId(@Param("userId") int userId);

@Query("SELECT COUNT(n) FROM Notification n WHERE n.user_id = :userId AND n.status = :status")
int countByUserIdAndStatus(@Param("userId") int userId, @Param("status") String status);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 90). Please break this line.

@Query("SELECT COUNT(n) FROM Notification n WHERE n.user_id = :userId AND n.status = :status")
int countByUserIdAndStatus(@Param("userId") int userId, @Param("status") String status);

@Query("SELECT COUNT(n) FROM Notification n WHERE n.user_id = :userId AND n.status = 'unread'")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 97). Please break this line.


private final Map<Integer, SseConnection> userConnections =
new ConcurrentHashMap<>();
private final Map<Integer, SseConnection> userConnections = new ConcurrentHashMap<>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 88). Please break this line.

});
}

public Map<String, Object> listByUserId(int userId, int page, int size, String status) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 90). Please break this line.

List<Notification> notifications;
int totalItems;

if (status != null && !status.isEmpty() && !status.equalsIgnoreCase("all")) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 81). Please break this line.

return this.http.put(`${this.API_BASE_URL}/notifications/${id}/read`, {});
}

markAllAsRead(): Observable<any> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review: The function markAllAsRead returns Observable<any>. This violates the 'Strict Typing: Never use the any or Object type' guideline. Please define a specific type for the HTTP response, e.g., Observable<MarkAllAsReadResponse>. This also ensures compliance with the 'Always create a model/type for HTTP responses' guideline.

  markAllAsRead(): Observable<any> {

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ AI Code Analysis: I found some potential issues for you to review.


return ResponseEntity.ok(Map.of("success", true, "message", "Match status updated to " + status));
}
return ResponseEntity.ok(Map.of("success", true, "message", "Match status updated to " + status));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 102). Please break this line.


return ResponseEntity.ok(paginatedResponse);
}
private final CopyOnWriteArrayList<SseEmitter> emitters = new CopyOnWriteArrayList<>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 89). Please break this line.

User authenticatedUser = (User) authentication.getPrincipal();
int userId = authenticatedUser.getUserId();

Map<String, Object> paginatedResponse = service.listByUserId(userId, page, size, status);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 93). Please break this line.

@Query("UPDATE Match m SET m.status = :status WHERE m.matchId = :id")
int updateMatchStatus(@Param("id") int id, @Param("status") String status);

@Query("SELECT m FROM Match m WHERE m.lostReportId = :reportId OR m.foundReportId = :reportId")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 97). Please break this line.

List<Notification> findByUserId(@Param("userId") int userId,
Pageable pageable);

@Query("SELECT n FROM Notification n WHERE n.user_id = :userId AND n.status = :status " +
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 91). Please break this line.

}

@PutMapping("/notifications/read-all")
public ResponseEntity<?> markAllAsRead(Authentication authentication) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review: Strict Typing Violation: Avoid using wildcard type <?> in ResponseEntity. Always define a specific response type or a model for HTTP responses. For example, ResponseEntity<SuccessResponseDTO> or ResponseEntity<ErrorResponseDTO>.

  public ResponseEntity<?> markAllAsRead(Authentication authentication) {

}

@Transactional
public Map<String, Object> create(int userId, int reportId,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review: Strict Typing / Model Violation: Avoid using generic Map<String, Object> as a return type for service methods. Create a specific DTO (e.g., NotificationCreationResponseDTO) to represent the created notification data for better type safety and clarity.

  public Map<String, Object> create(int userId, int reportId,

return data;
}

private void broadcastToAdmins(Map<String, Object> data) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review: Strict Typing / Model Violation: Avoid using generic Map<String, Object> for method parameters. Define a specific DTO (e.g., NotificationDataDTO) to ensure type safety and clarity.

  private void broadcastToAdmins(Map<String, Object> data) {

});
}

public void sendPrivateNotification(int userId, Map<String, Object> data) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review: Strict Typing / Model Violation: Avoid using generic Map<String, Object> for method parameters. Define a specific DTO (e.g., NotificationDataDTO) to ensure type safety and clarity.

  public void sendPrivateNotification(int userId, Map<String, Object> data) {

});
}

public Map<String, Object> listByUserId(int userId, int page, int size, String status) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review: Strict Typing / Model Violation: Avoid using generic Map<String, Object> as a return type for service methods. Create a specific DTO (e.g., PaginatedNotificationsResponseDTO) to represent the paginated notification data for better type safety and clarity.

  public Map<String, Object> listByUserId(int userId, int page, int size, String status) {

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ AI Code Analysis: I found some potential issues for you to review.


return ResponseEntity.ok(Map.of("success", true, "message", "Match status updated to " + status));
}
return ResponseEntity.ok(Map.of("success", true, "message", "Match status updated to " + status));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 102). Please break this line.


return ResponseEntity.ok(paginatedResponse);
}
private final CopyOnWriteArrayList<SseEmitter> emitters = new CopyOnWriteArrayList<>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 89). Please break this line.

User authenticatedUser = (User) authentication.getPrincipal();
int userId = authenticatedUser.getUserId();

Map<String, Object> paginatedResponse = service.listByUserId(userId, page, size, status);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 93). Please break this line.

@Query("UPDATE Match m SET m.status = :status WHERE m.matchId = :id")
int updateMatchStatus(@Param("id") int id, @Param("status") String status);

@Query("SELECT m FROM Match m WHERE m.lostReportId = :reportId OR m.foundReportId = :reportId")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 97). Please break this line.

List<Notification> findByUserId(@Param("userId") int userId,
Pageable pageable);

@Query("SELECT n FROM Notification n WHERE n.user_id = :userId AND n.status = :status " +
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 91). Please break this line.

});
}

public Map<String, Object> listByUserId(int userId, int page, int size, String status) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 90). Please break this line.

List<Notification> notifications;
int totalItems;

if (status != null && !status.isEmpty() && !status.equalsIgnoreCase("all")) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 81). Please break this line.

return this.http.put(`${this.apiUrl}/match/${matchId}`, { status });
}

getMatchForReport(reportId: number): Observable<MatchResponseDTO | undefined> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 81). Please break this line.

</div>

<div class="reminder-box">
<p><strong>Note:</strong> You may be asked to provide additional proof of ownership.</p>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 102). Please break this line.

if (this.unreadCount() === 0) return;

const previousCount = this.unreadCount();
const previousStatus = this.notifications.map(n => ({ id: n.notif_id, status: n.status }));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 95). Please break this line.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ AI Code Analysis: I found some potential issues for you to review.


return ResponseEntity.ok(Map.of("success", true, "message", "Match status updated to " + status));
}
return ResponseEntity.ok(Map.of("success", true, "message", "Match status updated to " + status));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 102). Please break this line.

@Query("UPDATE Match m SET m.status = :status WHERE m.matchId = :id")
int updateMatchStatus(@Param("id") int id, @Param("status") String status);

@Query("SELECT m FROM Match m WHERE m.lostReportId = :reportId OR m.foundReportId = :reportId")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 97). Please break this line.

return userLostReports.stream()
.filter(lostReport ->
"approved".equalsIgnoreCase(lostReport.getStatus()) ||
.filter(lostReport -> "approved".equalsIgnoreCase(lostReport.getStatus()) ||
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 84). Please break this line.

);

String msgLost = String.format(
"Match Found: We found a potential match (%s) for your lost %s. Click to verify.",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 90). Please break this line.

lostReport.getUserId(), lostReport.getReportId(), msgLost, true);

String msgFound = String.format(
"Update: The %s you found has been matched to a lost report. Thank you for helping!",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 93). Please break this line.

return this.http.put(`${this.apiUrl}/match/${matchId}`, { status });
}

getMatchForReport(reportId: number): Observable<MatchResponseDTO | undefined> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 81). Please break this line.

</div>

<div class="reminder-box">
<p><strong>Note:</strong> You may be asked to provide additional proof of ownership.</p>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 102). Please break this line.

if (this.unreadCount() === 0) return;

const previousCount = this.unreadCount();
const previousStatus = this.notifications.map(n => ({ id: n.notif_id, status: n.status }));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📏 Style Violation: Line exceeds 80 characters
(Current: 95). Please break this line.

);
}

updateMatchStatus(matchId: number, status: string): Observable<any> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review: Strict Typing: The return type Observable<any> should be replaced with a more specific type to avoid using the any keyword. Define a clear type for the expected response, even if it's a simple { success: boolean; message: string; } or a custom type like UpdateMatchStatusResponse.

  updateMatchStatus(matchId: number, status: string): Observable<any> {

height: 100%;
display: flex;
justify-content: center;
align-items: center;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review: Styling: The align-items property value appears incomplete. It should likely be align-items: center;.

  align-items: cent 

@siervo-jallaine siervo-jallaine merged commit 2bcb6ec into develop Jan 9, 2026
1 check passed
@siervo-jallaine siervo-jallaine deleted the ui branch January 10, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants