-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #477 from J-Tech-Japan/476-split-files
Working on the file and namespaces
- Loading branch information
Showing
125 changed files
with
1,522 additions
and
1,149 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
internalUsages/MultiTenant.Domain/Aggregates/MultiTenantDependency.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Sekiban.Pure.Aggregates; | ||
namespace Pure.Domain; | ||
|
||
public record Branch(string Name) : IAggregatePayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Sekiban.Pure.Events; | ||
namespace Pure.Domain; | ||
|
||
public record BranchCreated(string Name) : IEventPayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Sekiban.Pure.Events; | ||
namespace Pure.Domain; | ||
|
||
public record BranchNameChanged(string Name) : IEventPayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Sekiban.Pure.Aggregates; | ||
using Sekiban.Pure.Events; | ||
using Sekiban.Pure.Projectors; | ||
namespace Pure.Domain; | ||
|
||
public class BranchProjector : IAggregateProjector | ||
{ | ||
public IAggregatePayload Project(IAggregatePayload payload, IEvent ev) => | ||
(payload, ev.GetPayload()) switch | ||
{ | ||
(EmptyAggregatePayload, BranchCreated created) => new Branch(created.Name), | ||
(Branch branch, BranchNameChanged changed) => new Branch(changed.Name), | ||
_ => payload | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Sekiban.Pure.Aggregates; | ||
namespace Pure.Domain; | ||
|
||
public record BuyingShoppingCart(Guid UserId, List<ShoppingCartItems> Items) : IAggregatePayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using ResultBoxes; | ||
using Sekiban.Pure.Aggregates; | ||
using Sekiban.Pure.Command.Executor; | ||
using Sekiban.Pure.Command.Handlers; | ||
using Sekiban.Pure.Documents; | ||
using Sekiban.Pure.Events; | ||
namespace Pure.Domain; | ||
|
||
public record ChangeBranchName(Guid BranchId, string NameToChange) | ||
: ICommandWithHandler<ChangeBranchName, BranchProjector> | ||
{ | ||
public ResultBox<EventOrNone> Handle(ChangeBranchName command, ICommandContext<IAggregatePayload> context) => | ||
context.AppendEvent(new BranchNameChanged(command.NameToChange)); | ||
public PartitionKeys SpecifyPartitionKeys(ChangeBranchName command) => | ||
PartitionKeys<BranchProjector>.Existing(BranchId); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using ResultBoxes; | ||
using Sekiban.Pure.Command.Executor; | ||
using Sekiban.Pure.Command.Handlers; | ||
using Sekiban.Pure.Documents; | ||
using Sekiban.Pure.Events; | ||
namespace Pure.Domain; | ||
|
||
public record ConfirmUser(Guid UserId) : ICommandWithHandler<ConfirmUser, UserProjector, UnconfirmedUser> | ||
{ | ||
public ResultBox<EventOrNone> Handle(ConfirmUser command, ICommandContext<UnconfirmedUser> context) => | ||
EventOrNone.Event(new UserConfirmed()); | ||
public PartitionKeys SpecifyPartitionKeys(ConfirmUser command) => PartitionKeys<UserProjector>.Existing(UserId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Sekiban.Pure.Aggregates; | ||
namespace Pure.Domain; | ||
|
||
public record ConfirmedUser(string Name, string Email) : IAggregatePayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using ResultBoxes; | ||
using Sekiban.Pure.Aggregates; | ||
using Sekiban.Pure.Command.Executor; | ||
using Sekiban.Pure.Command.Handlers; | ||
using Sekiban.Pure.Documents; | ||
using Sekiban.Pure.Events; | ||
namespace Pure.Domain; | ||
|
||
public record CreateShoppingCart(Guid UserId) : ICommandWithHandlerAsync<CreateShoppingCart, ShoppingCartProjector> | ||
{ | ||
public PartitionKeys SpecifyPartitionKeys(CreateShoppingCart command) => | ||
PartitionKeys<ShoppingCartProjector>.Generate(); | ||
public Task<ResultBox<EventOrNone>> HandleAsync( | ||
CreateShoppingCart command, | ||
ICommandContext<IAggregatePayload> context) => | ||
EventOrNone.Event(new ShoppingCartCreated(command.UserId)).ToTask(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Sekiban.Pure.Events; | ||
namespace Pure.Domain; | ||
|
||
public record PaymentProcessedShoppingCart(string PaymentMethod) : IEventPayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Sekiban.Pure.Aggregates; | ||
namespace Pure.Domain; | ||
|
||
public record PaymentProcessingShoppingCart( | ||
Guid UserId, | ||
List<ShoppingCartItems> Items, | ||
int TotalPrice, | ||
string PaymentMethod) : IAggregatePayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using ResultBoxes; | ||
using Sekiban.Pure.Aggregates; | ||
using Sekiban.Pure.Command.Executor; | ||
using Sekiban.Pure.Command.Handlers; | ||
using Sekiban.Pure.Documents; | ||
using Sekiban.Pure.Events; | ||
namespace Pure.Domain; | ||
|
||
public record RegisterBranch(string Name) : ICommandWithHandler<RegisterBranch, BranchProjector> | ||
{ | ||
public PartitionKeys SpecifyPartitionKeys(RegisterBranch command) => PartitionKeys<BranchProjector>.Generate(); | ||
public ResultBox<EventOrNone> Handle(RegisterBranch command, ICommandContext<IAggregatePayload> context) => | ||
EventOrNone.Event(new BranchCreated(command.Name)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Sekiban.Pure.Command.Handlers; | ||
namespace Pure.Domain; | ||
|
||
public record RegisterBranch2(string Name) : ICommand; |
Oops, something went wrong.