Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/eShop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: ChilliCream/eShop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 7 files changed
  • 1 contributor

Commits on Mar 8, 2024

  1. Added ordering service

    michaelstaib committed Mar 8, 2024
    Copy the full SHA
    33ef985 View commit details
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<values>
<value name="VS.TelemetryApi.ChannelsDisposeLatency" type="int">1</value>
<value name="VS.TelemetryApi.TotalDisposeLatency" type="int">5</value>
<value name="VS.TelemetryApi.DroppedEventsDuringDisposing" type="int">0</value>
</values>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<values>
<value name="StillAlive" type="qword">133542134797675680</value>
</values>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<values>
<value name="StillAlive" type="qword">133543421966884880</value>
</values>
29 changes: 29 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
type Basket {
id: ID!
product: Product
quantity: Int!
}

type CatalogBrand {
id: ID!
brand: String!
}

type CatalogType {
id: ID!
type: String!
}

type CatalogItem {
id: ID!
name: String!
description: String
price: Float!
pictureFileName: String!
pictureUri: String!
catalogType: CatalogType
catalogBrand: CatalogBrand
availableStock: Int!
restockThreshold: Int!
onReorder: Boolean!
}
2 changes: 1 addition & 1 deletion src/Basket.API/Model/BasketItem.cs
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex

if (Quantity < 1)
{
results.Add(new ValidationResult("Invalid number of units", new[] { "Quantity" }));
results.Add(new ValidationResult("Invalid number of units", ["Quantity"]));
}

return results;
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ public OrderStatusChangedToStockConfirmedDomainEventHandler(

public async Task Handle(OrderStatusChangedToStockConfirmedDomainEvent domainEvent, CancellationToken cancellationToken)
{
OrderingApiTrace.LogOrderStatusUpdated(_logger, domainEvent.OrderId, OrderStatus.StockConfirmed);
_logger.LogOrderStatusUpdated(domainEvent.OrderId, OrderStatus.StockConfirmed);

var order = await _orderRepository.GetAsync(domainEvent.OrderId);
var buyer = await _buyerRepository.FindByIdAsync(order.BuyerId.Value);
2 changes: 1 addition & 1 deletion src/Ordering.API/Extensions/OrderingApiTrace.cs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
internal static partial class OrderingApiTrace
{
[LoggerMessage(EventId = 1, EventName = "OrderStatusUpdated", Level = LogLevel.Trace, Message = "Order with Id: {OrderId} has been successfully updated to status {Status}")]
public static partial void LogOrderStatusUpdated(ILogger logger, int orderId, OrderStatus status);
public static partial void LogOrderStatusUpdated(this ILogger logger, int orderId, OrderStatus status);

[LoggerMessage(EventId = 2, EventName = "PaymentMethodUpdated", Level = LogLevel.Trace, Message = "Order with Id: {OrderId} has been successfully updated with a payment method {PaymentMethod} ({Id})")]
public static partial void LogOrderPaymentMethodUpdated(ILogger logger, int orderId, string paymentMethod, int id);