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

feat: Add process and precedingProcess to dialog as optional fields #1092

Merged
merged 39 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e9d05ca
Bigus commitus
Fargekritt Sep 5, 2024
159f3fb
setProcess va broken, i fix
Fargekritt Sep 6, 2024
490d351
endUser e2e complete?
Fargekritt Sep 6, 2024
df982ca
serviceowner search process, Query param added.
Fargekritt Sep 6, 2024
643aeef
Process og PrecedingProcess i data på evnets
Fargekritt Sep 6, 2024
854c8be
Added process to DialogGenerator
Fargekritt Sep 6, 2024
7983a14
Added summary to dtos
Fargekritt Sep 6, 2024
2cd279f
e2e complete
Fargekritt Sep 6, 2024
0d60085
Cleanup
Fargekritt Sep 6, 2024
7ba3ef5
Merge branch 'main' into feature/Correlation-mechanism
Fargekritt Sep 6, 2024
9977007
Fixed?
Fargekritt Sep 6, 2024
25b7dd9
Fixed swagger schema, maybe
Fargekritt Sep 6, 2024
a5a50c1
default settings
Fargekritt Sep 8, 2024
0937f04
Update tests/k6/common/dialog.js
Fargekritt Sep 8, 2024
f1d1cb8
Update src/Digdir.Tool.Dialogporten.GenerateFakeData/DialogGenerator.cs
Fargekritt Sep 8, 2024
86e9372
Update src/Digdir.Domain.Dialogporten.Application/Features/V1/Service…
Fargekritt Sep 8, 2024
21c4217
Apply suggestions from code review
Fargekritt Sep 8, 2024
ce4dd09
Merge remote-tracking branch 'origin/feature/Correlation-mechanism' i…
Fargekritt Sep 8, 2024
be818f9
Cleanup
Fargekritt Sep 8, 2024
e69d2d1
Swagger fixed again?
Fargekritt Sep 8, 2024
ea794dc
Merge branch 'main' into feature/Correlation-mechanism
Fargekritt Sep 9, 2024
cd550e2
Merge branch 'main' into feature/Correlation-mechanism
Fargekritt Sep 9, 2024
e20dbc5
Fixed test
Fargekritt Sep 9, 2024
2b17eff
Apply suggestions from code review
Fargekritt Sep 9, 2024
bf19212
process search made case insensetive
Fargekritt Sep 9, 2024
71b05d6
Merge remote-tracking branch 'origin/feature/Correlation-mechanism' i…
Fargekritt Sep 9, 2024
c72fa3a
fix
Fargekritt Sep 9, 2024
ded9b89
Merge branch 'main' into feature/Correlation-mechanism
Fargekritt Sep 9, 2024
fba74d3
Update test?
Fargekritt Sep 9, 2024
49029fb
Bigus commitus
Fargekritt Sep 5, 2024
2496369
Apply suggestions from code review
Fargekritt Sep 9, 2024
5521ef2
??
Fargekritt Sep 9, 2024
88ed1c4
removed dupes??
Fargekritt Sep 9, 2024
8d18288
Merge branch 'main' into feature/Correlation-mechanism
Fargekritt Sep 9, 2024
b846b82
Merge branch 'main' into feature/Correlation-mechanism
Fargekritt Sep 9, 2024
5918f92
removed precedingProcess from update
Fargekritt Sep 9, 2024
07192d6
Removed process from update
Fargekritt Sep 9, 2024
97a1fde
Cleanup
Fargekritt Sep 10, 2024
5af288e
Merge branch 'main' into feature/Correlation-mechanism
Fargekritt Sep 11, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task Handle(DialogDeletedDomainEvent domainEvent, CancellationToken
await CloudEventBus.Publish(cloudEvent, cancellationToken);
}

private static Dictionary<string, object>? GetCloudEventData(DialogDomainEventBase domainEvent)
private static Dictionary<string, object>? GetCloudEventData(IProcessEvent domainEvent)
{
var data = new Dictionary<string, object>();
if (domainEvent.Process is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public async Task<SearchDialogResult> Handle(SearchDialogQuery request, Cancella
.AsSingleQuery()
.AsNoTracking()
.Include(x => x.Content)
.ThenInclude(x => x.Value.Localizations)
.ThenInclude(x => x.Value.Localizations)
.WhereIf(!request.Org.IsNullOrEmpty(), x => request.Org!.Contains(x.Org))
.WhereIf(!request.ServiceResource.IsNullOrEmpty(), x => request.ServiceResource!.Contains(x.ServiceResource))
.WhereIf(!request.Party.IsNullOrEmpty(), x => request.Party!.Contains(x.Party))
Expand All @@ -170,7 +170,7 @@ public async Task<SearchDialogResult> Handle(SearchDialogQuery request, Cancella
.WhereIf(request.UpdatedBefore.HasValue, x => x.UpdatedAt <= request.UpdatedBefore)
.WhereIf(request.DueAfter.HasValue, x => request.DueAfter <= x.DueAt)
.WhereIf(request.DueBefore.HasValue, x => x.DueAt <= request.DueBefore)
.WhereIf(request.Process is not null, x => x.Process == request.Process)
.WhereIf(request.Process is not null, x => x.Process != null && EF.Functions.ILike(x.Process, request.Process!))
Fargekritt marked this conversation as resolved.
Show resolved Hide resolved
.WhereIf(request.Search is not null, x =>
x.Content.Any(x => x.Value.Localizations.AsQueryable().Any(searchExpression)) ||
x.SearchTags.Any(x => EF.Functions.ILike(x.Value, request.Search!))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public CreateDialogCommandValidator(

RuleFor(x => x.Process)
.NotEmpty()
.WithMessage(dto => $"{{PropertyName}} must not be empty when {nameof(dto.PrecedingProcess)} is set.")
.WithMessage($"{{PropertyName}} must not be empty when {nameof(CreateDialogCommand.PrecedingProcess)} is set.")
.When(x => x.PrecedingProcess is not null);

RuleFor(x => x.PrecedingProcess)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public UpdateDialogDtoValidator(

RuleFor(x => x.Process)
.NotEmpty()
.WithMessage(dto => $"{{PropertyName}} must not be empty when {nameof(dto.PrecedingProcess)} is set.")
.WithMessage($"{{PropertyName}} must not be empty when {nameof(UpdateDialogDto.PrecedingProcess)} is set.")
.When(x => x.PrecedingProcess is not null);

RuleFor(x => x.PrecedingProcess)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public async Task<SearchDialogResult> Handle(SearchDialogQuery request, Cancella
.WhereIf(request.UpdatedBefore.HasValue, x => x.UpdatedAt <= request.UpdatedBefore)
.WhereIf(request.DueAfter.HasValue, x => request.DueAfter <= x.DueAt)
.WhereIf(request.DueBefore.HasValue, x => x.DueAt <= request.DueBefore)
.WhereIf(request.Process is not null, x => x.Process == request.Process)
.WhereIf(request.Process is not null, x => x.Process != null && EF.Functions.ILike(x.Process, request.Process!))
Fargekritt marked this conversation as resolved.
Show resolved Hide resolved
.WhereIf(request.VisibleAfter.HasValue, x => request.VisibleAfter <= x.VisibleFrom)
.WhereIf(request.VisibleBefore.HasValue, x => x.VisibleFrom <= request.VisibleBefore)
.WhereIf(request.Search is not null, x =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Digdir.Domain.Dialogporten.Domain.Common;
using Digdir.Library.Entity.Abstractions.Features.EventPublisher;

namespace Digdir.Domain.Dialogporten.Domain.Dialogs.Events;

public sealed record DialogCreatedDomainEvent(Guid DialogId, string ServiceResource, string Party, string? Process, string? PrecedingProcess) : DialogDomainEventBase(Process, PrecedingProcess);
public sealed record DialogCreatedDomainEvent(Guid DialogId, string ServiceResource, string Party, string? Process, string? PrecedingProcess) : DomainEvent, IProcessEvent;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Digdir.Domain.Dialogporten.Domain.Common;
using Digdir.Library.Entity.Abstractions.Features.EventPublisher;

namespace Digdir.Domain.Dialogporten.Domain.Dialogs.Events;

Expand All @@ -7,4 +8,4 @@ public sealed record DialogDeletedDomainEvent(
string ServiceResource,
string Party,
string? Process,
string? PrecedingProcess) : DialogDomainEventBase(Process, PrecedingProcess);
string? PrecedingProcess) : DomainEvent, IProcessEvent;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace Digdir.Domain.Dialogporten.Domain.Dialogs.Events;

public sealed record DialogSeenDomainEvent(Guid DialogId, string ServiceResource, string Party, string? Process, string? PrecedingProcess) : DialogDomainEventBase(Process, PrecedingProcess);
public sealed record DialogSeenDomainEvent(Guid DialogId, string ServiceResource, string Party, string? Process, string? PrecedingProcess) : DomainEvent, IProcessEvent;
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace Digdir.Domain.Dialogporten.Domain.Dialogs.Events;

public sealed record DialogUpdatedDomainEvent(Guid DialogId, string ServiceResource, string Party, string? Process, string? PrecedingProcess) : DialogDomainEventBase(Process, PrecedingProcess);
public sealed record DialogUpdatedDomainEvent(Guid DialogId, string ServiceResource, string Party, string? Process, string? PrecedingProcess) : DomainEvent, IProcessEvent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Digdir.Domain.Dialogporten.Domain.Dialogs.Events;

public interface IProcessEvent
{
string? Process { get; }
string? PrecedingProcess { get; }
}
2 changes: 1 addition & 1 deletion tests/k6/tests/enduser/dialogSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default function () {
expectStatusFor(r).to.equal(400);
expect(r, 'response').to.have.validJsonBody();
expect(r.json(), 'response json').to.have.property("errors");
expect(r.json().errors[""], 'errors').with.lengthOf(1);
expect(r.json().errors, 'errors').to.have.property("Process").with.lengthOf(1);
})

describe('List with process filter', () => {
Expand Down
Loading