Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(BREAKING) maint/dispatch-update-protocol-columns #138

Merged
merged 5 commits into from
Mar 13, 2025

Conversation

simonhir
Copy link
Member

@simonhir simonhir commented Mar 13, 2025

Description

Update dispatch protocol csv columns.

Reference

Issues closes #134

Summary by CodeRabbit

  • New Features
    • Extended protocol records to capture additional metadata (e.g., department and box ID) and support null values for page count.
    • Enhanced document type mapping with expanded alias recognition.
    • Improved protocol file processing with additional error handling for validation issues.
    • Updated the database schema to store new metadata attributes.
    • Enhanced CSV parsing to allow processing without failing on missing header columns.
  • Tests
    • Revised test cases to align with the updated protocol record structure.

@simonhir simonhir self-assigned this Mar 13, 2025
Copy link
Contributor

coderabbitai bot commented Mar 13, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request updates the protocol entry data models and related processing logic. The changes include converting the pageCount field from a primitive to a nullable type, adding new fields (department and boxId), and updating JSON annotations in the CSV variant. Additionally, the protocol processing use case now catches an extra exception type, and the SQL migration script is updated with corresponding new columns. Test cases were also modified to align with the updated constructor signatures.

Changes

File(s) Change Summary
dispatch-service/.../adapter/out/db/DbProtocolEntry.java,
dispatch-service/.../adapter/out/s3/CsvProtocolEntry.java,
dispatch-service/.../domain/model/protocol/ProtocolEntry.java
Updated pageCount from int to Integer; added department and boxId fields; in CsvProtocolEntry, added JSON property annotations and expanded @JsonAlias for documentType.
dispatch-service/.../application/usecase/ProtocolProcessingUseCase.java Added ConstraintViolationException to the catch block in the processProtocolFile method.
dispatch-service/.../resources/db/migration/V01__init_protocol.sql Added two new columns (department and box_id as VARCHAR) to the protocol table.
dispatch-service/.../application/usecase/ProtocolProcessingUseCaseTest.java Updated ProtocolEntry constructor invocations to include additional null parameters matching the new class signature.

Sequence Diagram(s)

Loading
sequenceDiagram
    participant C as Client/File System
    participant U as ProtocolProcessingUseCase
    participant L as Logger

    C->>U: Submit protocol file
    U->>U: Process file contents
    alt Successful Processing
        U->>C: Acknowledge success
    else Exception Occurs
        U->>U: Catch ProtocolException / IOException / DataIntegrityViolationException
        U->>U: Catch ConstraintViolationException
        U->>L: Log error details
        U->>C: Mark file as erroneous
    end

Possibly related PRs

  • maint/small-improvements #124: Addresses similar updates to the pageCount field and incorporation of new fields (department and boxId) in protocol entry classes.

Suggested labels

Component: Dispatch, Type: Maintenance

Suggested reviewers

  • rowe42

Poem

Oh, how the protocol carrots now grow,
With fields that gleam and data that flows.
I’ve hopped through code with joy so bright,
Adding nulls and strings, oh so light!
A happy bunny sings in code delight,
🐇 Celebrating change beneath the moonlight!
Hop on, dear coders, and code into the night!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between a63d633 and 2bc5336.

📒 Files selected for processing (1)
  • dispatch-service/src/test/java/de/muenchen/oss/swim/dispatcher/application/usecase/ProtocolProcessingUseCaseTest.java (2 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@simonhir simonhir marked this pull request as ready for review March 13, 2025 06:22
@simonhir simonhir requested a review from rowe42 March 13, 2025 06:22
@simonhir simonhir changed the title maint/dispatch-update-protocol-columns (BREAKING) maint/dispatch-update-protocol-columns Mar 13, 2025
@simonhir simonhir enabled auto-merge March 13, 2025 15:26
@simonhir simonhir merged commit b84cc17 into main Mar 13, 2025
7 of 8 checks passed
@simonhir simonhir deleted the maint/dispatch-update-protocol-columns branch March 13, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming of columns in CSV-files - needs extension / consolidation
2 participants