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

ECommerce samples alignment #118

Merged
merged 3 commits into from
Mar 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace Core.EventStoreDB.Events;

public static class StreamEventExtensions
public static class EventEnvelopeExtensions
{
public static EventEnvelope? ToStreamEvent(this ResolvedEvent resolvedEvent)
public static EventEnvelope? ToEventEnvelope(this ResolvedEvent resolvedEvent)
{
var eventData = resolvedEvent.Deserialize();
var eventMetadata = resolvedEvent.DeserializeMetadata();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private async Task HandleEvent(StreamSubscription subscription, ResolvedEvent re
{
if (IsEventWithEmptyData(resolvedEvent) || IsCheckpointEvent(resolvedEvent)) return;

var streamEvent = resolvedEvent.ToStreamEvent();
var streamEvent = resolvedEvent.ToEventEnvelope();

if (streamEvent == null)
{
Expand Down
4 changes: 2 additions & 2 deletions Core.Marten/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ private static StoreOptions SetStoreOptions(
"MartenSubscription"
);

configureOptions?.Invoke(options);

if (config.UseMetadata)
{
options.Events.MetadataConfig.CausationIdEnabled = true;
options.Events.MetadataConfig.CorrelationIdEnabled = true;
}

configureOptions?.Invoke(options);

return options;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task Put_Should_Confirm_ShoppingCart()
var cartDetails = await queryResponse.GetResultFromJson<ShoppingCartDetails>();
cartDetails.Should().NotBeNull();
cartDetails.Id.Should().Be(fixture.ShoppingCartId);
cartDetails.Status.Should().Be(ShoppingCartStatus.Confirmed);
cartDetails.Status.Should().Be(ShoppingCartStatus.Canceled);
cartDetails.ClientId.Should().Be(fixture.ClientId);
cartDetails.Version.Should().Be(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task Put_Should_Confirm_ShoppingCart()
var cartDetails = await queryResponse.GetResultFromJson<ShoppingCartDetails>();
cartDetails.Should().NotBeNull();
cartDetails.Id.Should().Be(fixture.ShoppingCartId);
cartDetails.Status.Should().Be(ShoppingCartStatus.Confirmed);
cartDetails.Status.Should().Be(ShoppingCartStatus.Canceled);
oskardudycz marked this conversation as resolved.
Show resolved Hide resolved
cartDetails.ClientId.Should().Be(fixture.ClientId);
cartDetails.Version.Should().Be(1);
}
Expand Down