Skip to content

Commit

Permalink
add missing activity types
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad committed Jan 14, 2025
1 parent f9f6e77 commit 0bada07
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 8 deletions.
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());
}
}
}

0 comments on commit 0bada07

Please sign in to comment.