feat: Add timestamp fields to ParsedMessage struct
The code changes in `aviation_parser.go` add the `ParsedAt` and `ReceivedAt` fields to the `ParsedMessage` struct. These fields store the timestamps when the message was parsed and received, respectively. This enhancement provides valuable information for tracking and analyzing message processing times.
The code changes in `aviation_parser_test.go` update the AFTN message parsing logic. The `ParseHeader` function now returns an additional error value, allowing for better error handling. The tests have been updated to reflect this change, ensuring that the parsing function handles errors correctly. This refactor improves the reliability and maintainability of the AFTN message parsing functionality.
The code changes rename the "Text" field in the AFTN struct to "Body" to improve clarity and consistency. This change aligns with the naming convention used in other parts of the codebase and enhances code readability.
The code changes remove the unused `SurveillanceEquipment` field in the `FPL` struct and the `TelegramCategory` field in the `DEP` struct. These fields are no longer needed and can be safely removed. This commit improves code cleanliness and reduces unnecessary complexity.
The code changes in `config.go` remove the commented code for printing a validation message and update the fields of the `FPL` struct in `fpl_test.go`. The commented code is no longer needed and can be safely removed. The updated fields in the `FPL` struct reflect the latest requirements and improve the accuracy of the test cases. This commit enhances code readability and maintainability.
The regex patterns used for parsing flight plans have been updated in the `config.go` file. The changes include adding named capture groups for each segment of the flight plan string, allowing for easier extraction of specific information. This update improves the accuracy and flexibility of the flight plan parsing functionality.
The main receiver file path in the Makefile has been updated to `./cmd/main/main.go` to reflect the correct location of the file. This change ensures that the Makefile correctly builds and runs the main receiver component of the application.
This commit adds functionality to parse FPL messages in the `aftn_parser.go` file. The `Parse` method now correctly parses the FPL message type and extracts the relevant data fields. The `FPL` struct is introduced in the `domain` package to represent FPL messages. The parsing logic is implemented to populate the `FPL` struct with the parsed data. This change enables the application to handle FPL messages and process them accordingly.
This commit adds functionality to parse AFTN messages in the `aftn_parser.go` file. The `Parse` method now correctly parses the message based on its type and extracts the relevant data. Additionally, the `FindPatterns` and `ParseBody` functions have been updated to remove the dependency on the `config` package and instead use the `config.GetBodyPatterns` function to retrieve the body patterns. This change improves the modularity and maintainability of the code.
Note: This commit message assumes that the `config` package has been refactored to use the `GetBodyPatterns` function.