예제 #1
0
        public GeneralLedgerEntryModule(EventStoreClient eventStore, IMessageTypeMapper messageTypeMapper,
                                        JsonSerializerOptions eventSerializerOptions, ICommandContext commandContext)
        {
            Build <PostGeneralLedgerEntry>()
            .Log()
            .UnitOfWork(eventStore, messageTypeMapper, eventSerializerOptions, commandContext)
            .Handle((_, ct) => {
                var(unitOfWork, command) = _;
                var handlers             = new GeneralLedgerEntryHandlers(
                    new GeneralLedgerEventStoreRepository(eventStore, messageTypeMapper, unitOfWork),
                    new GeneralLedgerEntryEventStoreRepository(eventStore, messageTypeMapper, unitOfWork),
                    new ChartOfAccountsEventStoreRepository(eventStore, messageTypeMapper, unitOfWork));

                return(handlers.Handle(command, ct));
            });
        }
예제 #2
0
        public GeneralLedgerEntryModule(EventStoreClient eventStore, IMessageTypeMapper messageTypeMapper,
                                        AccountIsDeactivated accountIsDeactivated)
        {
            var handlers = new GeneralLedgerEntryHandlers(
                new GeneralLedgerEventStoreRepository(eventStore, messageTypeMapper),
                new GeneralLedgerEntryEventStoreRepository(eventStore, messageTypeMapper),
                accountIsDeactivated);

            Build <PostGeneralLedgerEntry>()
            .Log()
            .UnitOfWork(eventStore, messageTypeMapper)
            .Handle(async(command, ct) => {
                await handlers.Handle(command, ct);

                return(Checkpoint.None);
            });
        }