Skip to content

Conversation

@luismr
Copy link
Owner

@luismr luismr commented May 1, 2025

Pull Request: Simplify PingCreatedEvent and Add Message Payload Documentation

Summary

This PR includes two main changes:

  1. Simplifies the PingCreatedEvent to avoid duplicating data already present in Ping and PingDTO
  2. Adds documentation about the message payloads used in the application's pub/sub messaging system

Changes

  • Simplified PingCreatedEvent to only contain the Ping and timestamp
  • Updated PingEventPublisher to use PingMapper for DTO conversion
  • Removed redundant PingCreated event class
  • Updated tests to reflect the new PingCreatedEvent structure
  • Added new "Message Payloads" section to README.md
  • Documented PingDTO structure with all fields and types
  • Documented FlightDataDTO structure with all fields and types

Motivation

  • Reduce data duplication and potential inconsistencies
  • Improve code maintainability by centralizing data transformation in PingMapper
  • Make the event system more efficient by only passing necessary data
  • Improve developer experience by providing clear documentation of message formats
  • Make it easier for other teams to integrate with our messaging system
  • Reduce integration issues by clearly defining expected payload structures

Checklist

  • All tests updated to reflect new event structure
  • Removed redundant code and classes
  • Documentation is clear and well-formatted
  • JSON examples are properly formatted and complete
  • All fields and types are accurately documented
  • Added appropriate section headers
  • Maintained consistent style with rest of README
  • No sensitive information included in examples
  • Documentation is placed in a logical location in the README
  • Added clear descriptions of where each DTO is used
  • Used proper markdown formatting for code blocks
  • Ensured all timestamps and data types are clearly specified
  • Verified all event handling code is updated to use new structure
  • Checked for any potential performance impacts
  • Ensured backward compatibility with existing event consumers

luismr added 2 commits May 1, 2025 15:14
👀 PingCreatedEvent now is just an event to sign it is created and available on the database and then the PingEventPublisher uses the PingMapper to convert Ping into a PingDTO to be notified for all connected flight-tracker-event-app clients.
@luismr luismr requested a review from Copilot May 1, 2025 18:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the event handling system by replacing the redundant PingCreated event with a streamlined PingCreatedEvent and updates the corresponding tests and publisher logic accordingly, while adding comprehensive documentation for message payloads.

  • Replace usage of PingCreated with PingCreatedEvent
  • Update test assertions and event registration methods
  • Add new documentation for message payloads in the README

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
PingCreatedTest.java Removed obsolete test for PingCreated event
PingTest.java Updated event assertions and event retrieval logic for PingCreatedEvent
PingCreatedEventTest.java Added new test for the PingCreatedEvent record
PingEventPublisher.java Modified to use PingCreatedEvent with PingMapper for DTO conversion
Ping.java Updated to register PingCreatedEvent instead of the old PingCreated event
README.md Added a new section detailing the message payload formats

@luismr luismr self-assigned this May 1, 2025
@luismr luismr merged commit 529102f into main May 1, 2025
1 check passed
@luismr luismr deleted the feature/ping-created-event-decoupled-from-model-to-use-ping-dto branch May 1, 2025 20:53
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