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

fix(graphql): Add missing activity types #1684

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions docs/schema/V1/schema.verified.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -304,20 +304,32 @@ input SetSystemLabelInput {
}

enum ActivityType {
"Refers to a dialog that has been created."
"Indicates that a dialog has been created."
DIALOG_CREATED
"Refers to a dialog that has been closed."
"Indicates that a dialog has been closed."
DIALOG_CLOSED
"Information from the service provider, not (directly) related to any transmission."
INFORMATION
"Refers to a transmission that has been opened."
"Indicates that a transmission has been opened."
TRANSMISSION_OPENED
"Indicates that payment has been made."
PAYMENT_MADE
"Indicates that a signature has been provided."
SIGNATURE_PROVIDED
"Refers to a dialog that has been opened."
"Indicates that a dialog has been opened."
DIALOG_OPENED
"Indicates that a dialog has been deleted."
DIALOG_DELETED
"Indicates that a dialog has been restored."
DIALOG_RESTORED
"Indicates that a dialog has been sent to signing."
SENT_TO_SIGNING
"Indicates that a dialog has been sent to form fill."
SENT_TO_FORM_FILL
"Indicates that a dialog has been sent to send in."
SENT_TO_SEND_IN
"Indicates that a dialog has been sent to payment."
SENT_TO_PAYMENT
}

enum ActorType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ public enum ActorType

public enum ActivityType
{
[GraphQLDescription("Refers to a dialog that has been created.")]
[GraphQLDescription("Indicates that a dialog has been created.")]
DialogCreated = 1,

[GraphQLDescription("Refers to a dialog that has been closed.")]
[GraphQLDescription("Indicates that a dialog has been closed.")]
DialogClosed = 2,

[GraphQLDescription("Information from the service provider, not (directly) related to any transmission.")]
Information = 3,

[GraphQLDescription("Refers to a transmission that has been opened.")]
[GraphQLDescription("Indicates that a transmission has been opened.")]
TransmissionOpened = 4,

[GraphQLDescription("Indicates that payment has been made.")]
Expand All @@ -70,8 +70,26 @@ public enum ActivityType
[GraphQLDescription("Indicates that a signature has been provided.")]
SignatureProvided = 6,

[GraphQLDescription("Refers to a dialog that has been opened.")]
[GraphQLDescription("Indicates that a dialog has been opened.")]
DialogOpened = 7,

[GraphQLDescription("Indicates that a dialog has been deleted.")]
DialogDeleted = 8,

[GraphQLDescription("Indicates that a dialog has been restored.")]
DialogRestored = 9,

[GraphQLDescription("Indicates that a dialog has been sent to signing.")]
SentToSigning = 10,

[GraphQLDescription("Indicates that a dialog has been sent to form fill.")]
SentToFormFill = 11,

[GraphQLDescription("Indicates that a dialog has been sent to send in.")]
SentToSendIn = 12,

[GraphQLDescription("Indicates that a dialog has been sent to payment.")]
SentToPayment = 13,
}

public enum DialogStatus
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Digdir.Domain.Dialogporten.Domain.Dialogs.Entities.Activities;
using Digdir.Domain.Dialogporten.GraphQL.EndUser.Common;

namespace Digdir.Domain.Dialogporten.GraphQl.Unit.Tests.ObjectTypes;

public class ActivityTests
{
[Fact]
public void Activity_Types_In_GraphQl_Must_Match_Domain_Types()
{
// Arrange
var domainTypes = Enum.GetValues(typeof(DialogActivityType.Values)).Cast<DialogActivityType.Values>().ToList();
var graphQlTypes = Enum.GetValues(typeof(ActivityType)).Cast<ActivityType>().ToList();

// Assert
Assert.Equal(domainTypes.Count, graphQlTypes.Count);

for (var i = 0; i < domainTypes.Count; i++)
{
Assert.Equal(domainTypes[i].ToString(), graphQlTypes[i].ToString());
}
}
}
Loading