-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Add additional types to DialogActivity #1629
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis pull request introduces new dialog activity types to the Dialogporten system. The changes span multiple files across different layers of the application, including schema definitions, domain entities, cloud event mappings, database migrations, and test coverage. Six new activity types have been added: DialogDeleted, DialogRestored, SentToSigning, SentToFormFill, SentToSendIn, and SentToPayment. These additions enhance the system's ability to track and represent various dialog-related actions and states. Changes
Possibly Related PRs
Suggested Reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/schema/V1/swagger.verified.json (1)
86-92
: Add descriptions for new activity types.Consider adding descriptions for the new activity types to maintain consistency with the documentation standards in the schema. This will help API consumers understand when each activity type is used.
Example structure to add:
"DialogsEntitiesActivities_DialogActivityType": { "description": "", "enum": [ "DialogCreated", "DialogClosed", "Information", "TransmissionOpened", "PaymentMade", "SignatureProvided", "DialogOpened", "DialogDeleted", "DialogRestored", "SentToSigning", "SentToFormFill", "SentToSendIn", "SentToPayment" ], + "descriptions": { + "DialogOpened": "Indicates that the dialog was opened by the user", + "DialogDeleted": "Indicates that the dialog was deleted", + "DialogRestored": "Indicates that a previously deleted dialog was restored", + "SentToSigning": "Indicates that the dialog was sent for digital signing", + "SentToFormFill": "Indicates that the dialog was sent for form filling", + "SentToSendIn": "Indicates that the dialog was sent for submission", + "SentToPayment": "Indicates that the dialog was sent for payment processing" + }, "type": "string", "x-enumNames": [ ... ] }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Migrations/20241222195253_AddAdditionalActivityTypes.Designer.cs
is excluded by!**/Migrations/**/*Designer.cs
src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Migrations/DialogDbContextModelSnapshot.cs
is excluded by!**/Migrations/DialogDbContextModelSnapshot.cs
📒 Files selected for processing (5)
docs/schema/V1/swagger.verified.json
(3 hunks)src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Events/CloudEventTypes.cs
(1 hunks)src/Digdir.Domain.Dialogporten.Domain/Dialogs/Entities/Activities/DialogActivityType.cs
(3 hunks)src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Migrations/20241222195253_AddAdditionalActivityTypes.cs
(1 hunks)tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/Common/Events/DomainEventsTests.cs
(1 hunks)
🧰 Additional context used
📓 Learnings (1)
src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Migrations/20241222195253_AddAdditionalActivityTypes.cs (2)
Learnt from: elsand
PR: digdir/dialogporten#1110
File: src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Migrations/20240910063003_AddDialogActivityDialogOpened.cs:13-16
Timestamp: 2024-11-12T05:32:45.312Z
Learning: Do not consider style or maintainability issues in migration files generated by Entity Framework during code reviews.
Learnt from: elsand
PR: digdir/dialogporten#1110
File: src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Migrations/20240910063003_AddDialogActivityDialogOpened.cs:13-16
Timestamp: 2024-11-12T05:32:45.312Z
Learning: Ensure that changes to domain entities are accompanied by corresponding migrations.
🔇 Additional comments (8)
src/Digdir.Domain.Dialogporten.Infrastructure/Persistence/Migrations/20241222195253_AddAdditionalActivityTypes.cs (2)
13-26
: Migration inserts for new activity types look consistent.
All newly inserted activity types match the ID values in the domain enum. Migrations are in sync with domain changes and follow best practices.
30-61
: Down migration ensures proper cleanup on rollback.
The down method correctly removes the same activity type records, preserving database integrity in case the migration is reverted.
src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Events/CloudEventTypes.cs (1)
24-29
: Consistent naming of event type strings.
Each new case follows the naming pattern used elsewhere (e.g., “dialogporten.dialog.activity.xyz”). This consistency helps maintain traceability in logging and event consumers.
src/Digdir.Domain.Dialogporten.Domain/Dialogs/Entities/Activities/DialogActivityType.cs (2)
13-13
: Documentation changes are clear and user-friendly.
Switching phrasing from “Refers to” to “Indicates that” is a minor but helpful improvement to clarity. No issues found.
Also applies to: 18-18, 28-28, 43-43
50-50
: Newly added enum values match the existing pattern.
The additional dialog activity types align with the domain definitions and help represent a broader range of events. This change is well-structured and consistent with the existing enumerations.
Also applies to: 55-55, 60-60, 65-65, 70-70, 75-75
tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/Common/Events/DomainEventsTests.cs (1)
35-47
: Excellent coverage for newly added activity types.
This test ensures every DialogActivityType
enum value has a corresponding mapping in CloudEventTypes
. It efficiently prevents missing cases and fosters confidence in event consistency.
docs/schema/V1/swagger.verified.json (2)
86-92
: LGTM! New dialog activity types added.
The new activity types follow a consistent naming pattern and cover important dialog lifecycle events and actions. The values are properly defined in both the enum and x-enumNames sections.
Also applies to: 102-108
86-92
: Verify schema references to DialogActivityType.
Ensure that all components referencing DialogsEntitiesActivities_DialogActivityType
properly handle the new activity types.
✅ Verification successful
Schema references to DialogActivityType are properly updated
The verification shows that:
- All references to
DialogsEntitiesActivities_DialogActivityType
are through$ref
schema references, ensuring consistent type usage - The enum definition includes all new activity types (
DialogOpened
,DialogDeleted
,DialogRestored
,SentToSigning
,SentToFormFill
,SentToPayment
) - Special handling for "Information" type activities is consistent across all components
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Find all references to DialogActivityType in the schema
# and verify they properly handle the new values
# Search for references to DialogActivityType
rg -A 5 "DialogsEntitiesActivities_DialogActivityType" docs/schema/V1/swagger.verified.json
# Search for any potential hardcoded lists of activity types
# that might need updating
rg -A 5 "DialogCreated|DialogClosed|Information|TransmissionOpened|PaymentMade|SignatureProvided" docs/schema/V1/swagger.verified.json
Length of output: 5715
Description
Related Issue(s)
Verification
Documentation
docs
-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)