-
Notifications
You must be signed in to change notification settings - Fork 6
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
47 changed files
with
11,528 additions
and
673 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
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,22 @@ | ||
using System.Reflection; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.IdentityModel.Tokens; | ||
using Serilog; | ||
using Serilog.Events; | ||
using Serilog.Sinks.Datadog.Logs; | ||
|
||
namespace CoffeeSpace.Core.Extensions; | ||
|
||
public static class SerilogExtensions | ||
{ | ||
public static LoggerConfiguration AddDatadogLogging(this LoggerConfiguration loggerConfiguration) | ||
{ | ||
string solutionName = AppDomain.CurrentDomain.FriendlyName; | ||
loggerConfiguration.WriteTo.DatadogLogs(Environment.GetEnvironmentVariable("DD_API_KEY"), | ||
service: solutionName, | ||
host: "CoffeeSpace", | ||
configuration: new DatadogConfiguration(" https://http-intake.logs.us5.datadoghq.com", 443)); | ||
|
||
return loggerConfiguration; | ||
} | ||
|
||
public static LoggerConfiguration AddDatadogLogging(this LoggerConfiguration loggerConfiguration, string serviceName) | ||
{ | ||
loggerConfiguration.WriteTo.DatadogLogs(Environment.GetEnvironmentVariable("DD_API_KEY"), | ||
if (!Environment.GetEnvironmentVariable(Environments.Staging).IsNullOrEmpty()) | ||
{ | ||
return loggerConfiguration; | ||
} | ||
|
||
return loggerConfiguration.WriteTo.DatadogLogs(Environment.GetEnvironmentVariable("DD_API_KEY"), | ||
service: serviceName, | ||
host: "CoffeeSpace", | ||
configuration: new DatadogConfiguration(" https://http-intake.logs.us5.datadoghq.com", 443)); | ||
|
||
return loggerConfiguration; | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
CoffeeSpace.OrderingApi/Application/Repositories/BuyerRepository.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
6 changes: 3 additions & 3 deletions
6
CoffeeSpace.OrderingApi/Application/Repositories/OrderRepository.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
19 changes: 19 additions & 0 deletions
19
CoffeeSpace.OrderingApi/Persistence/Abstractions/IOrderingDbContext.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using CoffeeSpace.Domain.Ordering.BuyerInfo; | ||
using CoffeeSpace.Domain.Ordering.Orders; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace CoffeeSpace.OrderingApi.Persistence.Abstractions; | ||
|
||
public interface IOrderingDbContext | ||
{ | ||
DbSet<Order> Orders { get; init; } | ||
|
||
DbSet<OrderItem> OrderItems { get; init; } | ||
|
||
DbSet<Buyer> Buyers { get; init; } | ||
|
||
DbSet<Address> Addresses { get; init; } | ||
|
||
|
||
Task<int> SaveChangesAsync(CancellationToken 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
14 changes: 14 additions & 0 deletions
14
CoffeeSpace.PaymentService/Persistence/Abstractions/IPaymentDbContext.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using CoffeeSpace.PaymentService.Models; | ||
using Microsoft.EntityFrameworkCore; | ||
using PayPalCheckoutSdk.Orders; | ||
|
||
namespace CoffeeSpace.PaymentService.Persistence.Abstractions; | ||
|
||
public interface IPaymentDbContext | ||
{ | ||
DbSet<PaypalOrderInformation> PaypalOrders { get; init; } | ||
|
||
DbSet<Order> Orders { get; init; } | ||
|
||
Task<int> SaveChangesAsync(CancellationToken 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
6 changes: 3 additions & 3 deletions
6
CoffeeSpace.ProductApi/Application/Repositories/ProductRepository.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
11 changes: 11 additions & 0 deletions
11
CoffeeSpace.ProductApi/Persistence/Abstractions/IProductDbContext.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using CoffeeSpace.Domain.Products; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace CoffeeSpace.ProductApi.Persistence.Abstractions; | ||
|
||
public interface IProductDbContext | ||
{ | ||
DbSet<Product> Products { get; init; } | ||
|
||
Task<int> SaveChangesAsync(CancellationToken cancellationToken); | ||
} |
Oops, something went wrong.