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

Add Recipient to user in GetCorrespondenceHistory #415

Merged

Conversation

CelineTrammi
Copy link
Collaborator

@CelineTrammi CelineTrammi commented Oct 30, 2024

Description

Adds contactinformation about the user in the GET call for displayment in the A2 GUI solution.

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Summary by CodeRabbit

  • New Features

    • Enhanced notification status handling by including recipient information for SMS and Email notifications.
    • Added a new property to the LegacyUser class to store recipient details.
  • Bug Fixes

    • Improved context in responses related to notification statuses.
  • Documentation

    • Updated method signatures to reflect the inclusion of recipient parameters.

Copy link
Contributor

coderabbitai bot commented Oct 30, 2024

📝 Walkthrough

Walkthrough

The changes in this pull request involve modifications to the LegacyGetCorrespondenceHistoryHandler and LegacyUser classes. The Process method now includes a Recipient parameter in calls to GetNotificationStatus, which has also been updated to accept a Recipient object. Additionally, a new property for Recipient has been added to the LegacyUser class. These updates enhance the handling of notification statuses while maintaining existing control flow and error handling.

Changes

File Change Summary
src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryHandler.cs Updated Process method to include Recipient parameter in GetNotificationStatus calls; modified GetNotificationStatus method signature to accept Recipient.
src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryResponse.cs Added new property Recipient of type Recipient to LegacyUser class.

Possibly related PRs

Suggested labels

ignore-for-release

Suggested reviewers

  • Andreass2
  • Ceredron

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@CelineTrammi CelineTrammi marked this pull request as ready for review October 30, 2024 09:20
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryResponse.cs (1)

19-23: Consider comprehensive validation strategy for LegacyUser.

Given that PartyId and AuthenticationLevel are still under development and validation requirements are not yet determined, it would be beneficial to plan a comprehensive validation strategy for all properties in the LegacyUser class, including this new Recipient property.

src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryHandler.cs (1)

Line range hint 93-106: Consider documenting the recipient information structure

Since this change introduces recipient information that will be displayed in the A2 GUI solution, it would be valuable to document the expected structure and format of the recipient information. This will help future maintainers understand the contract between the backend and frontend.

Consider:

  1. Adding XML documentation comments to describe the recipient property
  2. Documenting any validation requirements or formatting expectations
  3. Including examples of how this information will be displayed in the GUI
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 9fa181f and 0313740.

📒 Files selected for processing (2)
  • src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryHandler.cs (3 hunks)
  • src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryResponse.cs (2 hunks)
🧰 Additional context used
📓 Learnings (1)
src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryResponse.cs (1)
Learnt from: CelineTrammi
PR: Altinn/altinn-correspondence#413
File: src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryResponse.cs:17-21
Timestamp: 2024-10-29T13:10:17.164Z
Learning: The `PartyId` and `AuthenticationLevel` properties in the `LegacyUser` class (in `src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryResponse.cs`) are still under development, and the correct validation has not been determined yet.
🔇 Additional comments (4)
src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryResponse.cs (2)

1-1: LGTM!

The using directive is correctly added to support the new Recipient type.


22-22: Add XML documentation for the new property.

Since this property is used in the A2 GUI, adding XML documentation would help API consumers understand its purpose and usage.

+    /// <summary>
+    /// Gets or sets the recipient information for correspondence history.
+    /// Used to display contact information in the A2 GUI solution.
+    /// </summary>
     public Recipient Recipient { get; set; }

Consider null safety and validation.

Since this property is used for display purposes, consider:

  1. Initializing the property to avoid potential null reference exceptions
  2. Adding null checks in consuming code

Let's verify the property usage:

src/Altinn.Correspondence.Application/GetCorrespondenceHistory/LegacyGetCorrespondenceHistoryHandler.cs (2)

69-73: LGTM! Recipient parameter correctly added to notification status handling

The changes consistently enhance both SMS and Email notification blocks by including recipient information, which aligns well with the PR objective of displaying contact information in the A2 GUI solution.

Also applies to: 77-81


Line range hint 93-104: LGTM! Recipient parameter properly integrated

The GetNotificationStatus method cleanly incorporates the new recipient information while maintaining its existing functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release pull request wont be included in release notes kind/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants