-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,210 additions
and
1,221 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,41 +1,40 @@ | ||
<Project> | ||
<PropertyGroup Label="Package Versions"> | ||
<NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion> | ||
<MediatRPackageVersion>11.1.0</MediatRPackageVersion> | ||
<MediatRContractsPackageVersion>1.0.1</MediatRContractsPackageVersion> | ||
<MediatRExtensionsMicrosoftDIPackageVersion>11.0.0</MediatRExtensionsMicrosoftDIPackageVersion> | ||
<ScrutorPackageVersion>3.3.0</ScrutorPackageVersion> | ||
<BenchmarkDotNetPackageVersion>0.13.1</BenchmarkDotNetPackageVersion> | ||
<MoqPackageVersion>4.16.1</MoqPackageVersion> | ||
<XunitPackageVersion>2.4.1</XunitPackageVersion> | ||
<XunitRunnerVisualStudioPackageVersion>2.4.3</XunitRunnerVisualStudioPackageVersion> | ||
<CoverletCollectorPackageVersion>3.1.0</CoverletCollectorPackageVersion> | ||
<MicrosoftNetTestSdkPackageVersion>17.0.0</MicrosoftNetTestSdkPackageVersion> | ||
<FsUnitPackageVersion>4.1.0</FsUnitPackageVersion> | ||
<FluentAssertionsPackageVersion>6.3.0</FluentAssertionsPackageVersion> | ||
<MicrosoftDataSqlClientPackageVersion>5.0.1</MicrosoftDataSqlClientPackageVersion> | ||
<MicrosoftExtensionsPackagesVersion>7.0.0</MicrosoftExtensionsPackagesVersion> | ||
<MicrosoftEntityFrameworkPackagesVersion>7.0.0</MicrosoftEntityFrameworkPackagesVersion> | ||
<MicrosoftCSharpPackageVersion>4.7.0</MicrosoftCSharpPackageVersion> | ||
<OpenTelemetryCorePackageVersion>1.5.0</OpenTelemetryCorePackageVersion> | ||
<OpenTelemetryExtensionsHostingPackageVersion>1.5.0</OpenTelemetryExtensionsHostingPackageVersion> | ||
<OpenTelemetryExtensionsPropagatorsPackageVersion>1.5.0</OpenTelemetryExtensionsPropagatorsPackageVersion> | ||
<OpenTelemetryInstrumentationAspNetCorePackageVersion>1.0.0-rc9.14</OpenTelemetryInstrumentationAspNetCorePackageVersion> | ||
<OpenTelemetryInstrumentationEFCorePackageVersion>1.0.0-beta.7</OpenTelemetryInstrumentationEFCorePackageVersion> | ||
<OpenTelemetryInstrumentationHttpPackageVersion>1.0.0-rc9.14</OpenTelemetryInstrumentationHttpPackageVersion> | ||
<OpenTelemetryInstrumentationRuntimePackageVersion>1.5.0</OpenTelemetryInstrumentationRuntimePackageVersion> | ||
<OpenTelemetryExporterPrometheusHttpListenerPackageVersion>1.5.0-rc.1</OpenTelemetryExporterPrometheusHttpListenerPackageVersion> | ||
<OpenTelemetryExporterPrometheusAspnetCorePackageVersion>1.5.0-rc.1</OpenTelemetryExporterPrometheusAspnetCorePackageVersion> | ||
<PollyVersion>7.2.2</PollyVersion> | ||
<SerilogPackageVersion>2.10.0</SerilogPackageVersion> | ||
<SerilogExtensionsLoggingPackageVersion>3.1.0</SerilogExtensionsLoggingPackageVersion> | ||
<SerilogSinksConsole>4.0.1</SerilogSinksConsole> | ||
<SerilogSinksMSSqlServerPackageVersion>5.6.1</SerilogSinksMSSqlServerPackageVersion> | ||
<SerilogAspNetCorePackageVersion>4.1.0</SerilogAspNetCorePackageVersion> | ||
<AutoMapperPackageVersion>12.0.0</AutoMapperPackageVersion> | ||
<NJsonSchemaPackageVersion>10.6.6</NJsonSchemaPackageVersion> | ||
<AutoFixturePackageVersion>4.17.0</AutoFixturePackageVersion> | ||
<JaegerPackageVersion>1.0.3</JaegerPackageVersion> | ||
<SystemIdentityModelTokensJwtPackageVersion>6.15.0</SystemIdentityModelTokensJwtPackageVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Package Versions"> | ||
<NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion> | ||
<MediatRPackageVersion>12.2.0</MediatRPackageVersion> | ||
<MediatRContractsPackageVersion>2.0.1</MediatRContractsPackageVersion> | ||
<ScrutorPackageVersion>3.3.0</ScrutorPackageVersion> | ||
<BenchmarkDotNetPackageVersion>0.13.1</BenchmarkDotNetPackageVersion> | ||
<MoqPackageVersion>4.20.69</MoqPackageVersion> | ||
<XunitPackageVersion>2.4.1</XunitPackageVersion> | ||
<XunitRunnerVisualStudioPackageVersion>2.4.3</XunitRunnerVisualStudioPackageVersion> | ||
<CoverletCollectorPackageVersion>3.1.0</CoverletCollectorPackageVersion> | ||
<MicrosoftNetTestSdkPackageVersion>17.0.0</MicrosoftNetTestSdkPackageVersion> | ||
<FsUnitPackageVersion>4.1.0</FsUnitPackageVersion> | ||
<FluentAssertionsPackageVersion>6.3.0</FluentAssertionsPackageVersion> | ||
<MicrosoftDataSqlClientPackageVersion>5.0.1</MicrosoftDataSqlClientPackageVersion> | ||
<MicrosoftExtensionsPackagesVersion>8.0.0</MicrosoftExtensionsPackagesVersion> | ||
<MicrosoftEntityFrameworkPackagesVersion>8.0.0</MicrosoftEntityFrameworkPackagesVersion> | ||
<MicrosoftCSharpPackageVersion>4.7.0</MicrosoftCSharpPackageVersion> | ||
<OpenTelemetryCorePackageVersion>1.5.0</OpenTelemetryCorePackageVersion> | ||
<OpenTelemetryExtensionsHostingPackageVersion>1.5.0</OpenTelemetryExtensionsHostingPackageVersion> | ||
<OpenTelemetryExtensionsPropagatorsPackageVersion>1.5.0</OpenTelemetryExtensionsPropagatorsPackageVersion> | ||
<OpenTelemetryInstrumentationAspNetCorePackageVersion>1.0.0-rc9.14</OpenTelemetryInstrumentationAspNetCorePackageVersion> | ||
<OpenTelemetryInstrumentationEFCorePackageVersion>1.0.0-beta.7</OpenTelemetryInstrumentationEFCorePackageVersion> | ||
<OpenTelemetryInstrumentationHttpPackageVersion>1.0.0-rc9.14</OpenTelemetryInstrumentationHttpPackageVersion> | ||
<OpenTelemetryInstrumentationRuntimePackageVersion>1.5.0</OpenTelemetryInstrumentationRuntimePackageVersion> | ||
<OpenTelemetryExporterPrometheusHttpListenerPackageVersion>1.5.0-rc.1</OpenTelemetryExporterPrometheusHttpListenerPackageVersion> | ||
<OpenTelemetryExporterPrometheusAspnetCorePackageVersion>1.5.0-rc.1</OpenTelemetryExporterPrometheusAspnetCorePackageVersion> | ||
<PollyVersion>7.2.2</PollyVersion> | ||
<SerilogPackageVersion>2.10.0</SerilogPackageVersion> | ||
<SerilogExtensionsLoggingPackageVersion>3.1.0</SerilogExtensionsLoggingPackageVersion> | ||
<SerilogSinksConsole>4.0.1</SerilogSinksConsole> | ||
<SerilogSinksMSSqlServerPackageVersion>5.6.1</SerilogSinksMSSqlServerPackageVersion> | ||
<SerilogAspNetCorePackageVersion>4.1.0</SerilogAspNetCorePackageVersion> | ||
<AutoMapperPackageVersion>12.0.0</AutoMapperPackageVersion> | ||
<NJsonSchemaPackageVersion>10.6.6</NJsonSchemaPackageVersion> | ||
<AutoFixturePackageVersion>4.17.0</AutoFixturePackageVersion> | ||
<JaegerPackageVersion>1.0.3</JaegerPackageVersion> | ||
<SystemIdentityModelTokensJwtPackageVersion>6.15.0</SystemIdentityModelTokensJwtPackageVersion> | ||
</PropertyGroup> | ||
</Project> |
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
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
50 changes: 24 additions & 26 deletions
50
...ices/NBB.Invoices/NBB.Invoices.Application/CommandHandlers/CreateInvoiceCommandHandler.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
// Copyright (c) TotalSoft. | ||
// This source code is licensed under the MIT license. | ||
|
||
using MediatR; | ||
using NBB.Data.Abstractions; | ||
using NBB.Invoices.Domain.InvoiceAggregate; | ||
using MediatR; | ||
using NBB.Data.Abstractions; | ||
using NBB.Invoices.Domain.InvoiceAggregate; | ||
using NBB.Invoices.PublishedLanguage; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace NBB.Invoices.Application.CommandHandlers | ||
{ | ||
public class CreateInvoiceCommandHandler : IRequestHandler<CreateInvoice> | ||
{ | ||
private readonly ICrudRepository<Invoice> _repository; | ||
public CreateInvoiceCommandHandler(ICrudRepository<Invoice> repository) | ||
{ | ||
this._repository = repository; | ||
} | ||
|
||
public async Task<Unit> Handle(CreateInvoice command, CancellationToken cancellationToken) | ||
{ | ||
var invoice = new Invoice(command.ClientId, command.ContractId, command.Amount); | ||
await _repository.AddAsync(invoice, cancellationToken); | ||
await _repository.SaveChangesAsync(cancellationToken); | ||
|
||
return Unit.Value; | ||
} | ||
} | ||
} | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace NBB.Invoices.Application.CommandHandlers | ||
{ | ||
public class CreateInvoiceCommandHandler : IRequestHandler<CreateInvoice> | ||
{ | ||
private readonly ICrudRepository<Invoice> _repository; | ||
public CreateInvoiceCommandHandler(ICrudRepository<Invoice> repository) | ||
{ | ||
this._repository = repository; | ||
} | ||
|
||
public async Task Handle(CreateInvoice command, CancellationToken cancellationToken) | ||
{ | ||
var invoice = new Invoice(command.ClientId, command.ContractId, command.Amount); | ||
await _repository.AddAsync(invoice, cancellationToken); | ||
await _repository.SaveChangesAsync(cancellationToken); | ||
} | ||
} | ||
} |
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
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
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
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
60 changes: 29 additions & 31 deletions
60
...ervices/NBB.Payments/NBB.Payments.Application/CommandHandlers/PayPayableCommandHandler.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
// Copyright (c) TotalSoft. | ||
// This source code is licensed under the MIT license. | ||
|
||
using MediatR; | ||
using NBB.Data.Abstractions; | ||
using NBB.Payments.Domain.PayableAggregate; | ||
using MediatR; | ||
using NBB.Data.Abstractions; | ||
using NBB.Payments.Domain.PayableAggregate; | ||
using NBB.Payments.PublishedLanguage; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace NBB.Payments.Application.CommandHandlers | ||
{ | ||
public class PayPayableCommandHandler : IRequestHandler<PayPayable> | ||
{ | ||
private readonly ICrudRepository<Payable> _repository; | ||
|
||
public PayPayableCommandHandler(ICrudRepository<Payable> repository) | ||
{ | ||
_repository = repository; | ||
} | ||
|
||
|
||
public async Task<Unit> Handle(PayPayable command, CancellationToken cancellationToken) | ||
{ | ||
var payable = await _repository.GetByIdAsync(command.PayableId, cancellationToken); | ||
if (payable != null) | ||
{ | ||
payable.Pay(); | ||
await _repository.SaveChangesAsync(cancellationToken); | ||
} | ||
|
||
return Unit.Value; | ||
} | ||
} | ||
} | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace NBB.Payments.Application.CommandHandlers | ||
{ | ||
public class PayPayableCommandHandler : IRequestHandler<PayPayable> | ||
{ | ||
private readonly ICrudRepository<Payable> _repository; | ||
|
||
public PayPayableCommandHandler(ICrudRepository<Payable> repository) | ||
{ | ||
_repository = repository; | ||
} | ||
|
||
|
||
public async Task Handle(PayPayable command, CancellationToken cancellationToken) | ||
{ | ||
var payable = await _repository.GetByIdAsync(command.PayableId, cancellationToken); | ||
if (payable != null) | ||
{ | ||
payable.Pay(); | ||
await _repository.SaveChangesAsync(cancellationToken); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.