diff --git a/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs b/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs index ef09911fe..3fc04c1b0 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs @@ -3,7 +3,7 @@ using Newtonsoft.Json; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events { - public class IntegrationEvent + public record IntegrationEvent { public IntegrationEvent() { @@ -19,9 +19,9 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events } [JsonProperty] - public Guid Id { get; private set; } + public Guid Id { get; private init; } [JsonProperty] - public DateTime CreationDate { get; private set; } + public DateTime CreationDate { get; private init; } } } diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs b/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs index b78d10c05..cb4a63f32 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs @@ -5,9 +5,9 @@ namespace Basket.API.IntegrationEvents.Events // Integration Events notes: // An Event is “something that has happened in the past”, therefore its name has to be // An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems. - public class OrderStartedIntegrationEvent : IntegrationEvent + public record OrderStartedIntegrationEvent : IntegrationEvent { - public string UserId { get; set; } + public string UserId { get; init; } public OrderStartedIntegrationEvent(string userId) => UserId = userId; diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs b/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs index 6f51010be..a06947b65 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs @@ -5,13 +5,13 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even // Integration Events notes: // An Event is “something that has happened in the past”, therefore its name has to be // An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems. - public class ProductPriceChangedIntegrationEvent : IntegrationEvent + public record ProductPriceChangedIntegrationEvent : IntegrationEvent { - public int ProductId { get; private set; } + public int ProductId { get; private init; } - public decimal NewPrice { get; private set; } + public decimal NewPrice { get; private init; } - public decimal OldPrice { get; private set; } + public decimal OldPrice { get; private init; } public ProductPriceChangedIntegrationEvent(int productId, decimal newPrice, decimal oldPrice) { diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs b/src/Services/Basket/Basket.API/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs index 18d522cf6..e79e0fbdd 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs @@ -4,37 +4,37 @@ using System; namespace Basket.API.IntegrationEvents.Events { - public class UserCheckoutAcceptedIntegrationEvent : IntegrationEvent + public record UserCheckoutAcceptedIntegrationEvent : IntegrationEvent { public string UserId { get; } public string UserName { get; } - public int OrderNumber { get; set; } + public int OrderNumber { get; init; } - public string City { get; set; } + public string City { get; init; } - public string Street { get; set; } + public string Street { get; init; } - public string State { get; set; } + public string State { get; init; } - public string Country { get; set; } + public string Country { get; init; } - public string ZipCode { get; set; } + public string ZipCode { get; init; } - public string CardNumber { get; set; } + public string CardNumber { get; init; } - public string CardHolderName { get; set; } + public string CardHolderName { get; init; } - public DateTime CardExpiration { get; set; } + public DateTime CardExpiration { get; init; } - public string CardSecurityNumber { get; set; } + public string CardSecurityNumber { get; init; } - public int CardTypeId { get; set; } + public int CardTypeId { get; init; } - public string Buyer { get; set; } + public string Buyer { get; init; } - public Guid RequestId { get; set; } + public Guid RequestId { get; init; } public CustomerBasket Basket { get; } diff --git a/src/Services/Basket/Basket.API/Model/BasketCheckout.cs b/src/Services/Basket/Basket.API/Model/BasketCheckout.cs index 70173611f..410700773 100644 --- a/src/Services/Basket/Basket.API/Model/BasketCheckout.cs +++ b/src/Services/Basket/Basket.API/Model/BasketCheckout.cs @@ -2,29 +2,29 @@ namespace Basket.API.Model { - public record BasketCheckout + public class BasketCheckout { - public string City { get; init; } + public string City { get; set; } - public string Street { get; init; } + public string Street { get; set; } - public string State { get; init; } + public string State { get; set; } - public string Country { get; init; } + public string Country { get; set; } - public string ZipCode { get; init; } + public string ZipCode { get; set; } - public string CardNumber { get; init; } + public string CardNumber { get; set; } - public string CardHolderName { get; init; } + public string CardHolderName { get; set; } - public DateTime CardExpiration { get; init; } + public DateTime CardExpiration { get; set; } - public string CardSecurityNumber { get; init; } + public string CardSecurityNumber { get; set; } - public int CardTypeId { get; init; } + public int CardTypeId { get; set; } - public string Buyer { get; init; } + public string Buyer { get; set; } public Guid RequestId { get; set; } } diff --git a/src/Services/Basket/Basket.API/Model/BasketItem.cs b/src/Services/Basket/Basket.API/Model/BasketItem.cs index e0414884c..4d2e4f331 100644 --- a/src/Services/Basket/Basket.API/Model/BasketItem.cs +++ b/src/Services/Basket/Basket.API/Model/BasketItem.cs @@ -3,15 +3,15 @@ using System.ComponentModel.DataAnnotations; namespace Microsoft.eShopOnContainers.Services.Basket.API.Model { - public record BasketItem : IValidatableObject + public class BasketItem : IValidatableObject { - public string Id { get; init; } - public int ProductId { get; init; } - public string ProductName { get; init; } + public string Id { get; set; } + public int ProductId { get; set; } + public string ProductName { get; set; } public decimal UnitPrice { get; set; } public decimal OldUnitPrice { get; set; } - public int Quantity { get; init; } - public string PictureUrl { get; init; } + public int Quantity { get; set; } + public string PictureUrl { get; set; } public IEnumerable Validate(ValidationContext validationContext) { var results = new List(); diff --git a/src/Services/Basket/Basket.API/Model/CustomerBasket.cs b/src/Services/Basket/Basket.API/Model/CustomerBasket.cs index e8dc14edb..9ae495d4f 100644 --- a/src/Services/Basket/Basket.API/Model/CustomerBasket.cs +++ b/src/Services/Basket/Basket.API/Model/CustomerBasket.cs @@ -2,9 +2,9 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Model { - public record CustomerBasket + public class CustomerBasket { - public string BuyerId { get; init; } + public string BuyerId { get; set; } public List Items { get; set; } = new List(); diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs index 9787aaedd..b1061f60e 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs @@ -3,7 +3,7 @@ using BuildingBlocks.EventBus.Events; using System.Collections.Generic; - public class OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent { public int OrderId { get; } public IEnumerable OrderStockItems { get; } @@ -16,7 +16,7 @@ } } - public class OrderStockItem + public record OrderStockItem { public int ProductId { get; } public int Units { get; } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs index 881aa21fe..d5a295cc5 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent { public int OrderId { get; } public IEnumerable OrderStockItems { get; } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs index b91eaae43..6c6a3cfa4 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs @@ -2,7 +2,7 @@ { using BuildingBlocks.EventBus.Events; - public class OrderStockConfirmedIntegrationEvent : IntegrationEvent + public record OrderStockConfirmedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs index eb74af8dd..7c098edf4 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs @@ -3,7 +3,7 @@ using BuildingBlocks.EventBus.Events; using System.Collections.Generic; - public class OrderStockRejectedIntegrationEvent : IntegrationEvent + public record OrderStockRejectedIntegrationEvent : IntegrationEvent { public int OrderId { get; } @@ -17,7 +17,7 @@ } } - public class ConfirmedOrderStockItem + public record ConfirmedOrderStockItem { public int ProductId { get; } public bool HasStock { get; } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs index 00f25b9e5..004c938a1 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs @@ -5,13 +5,13 @@ // Integration Events notes: // An Event is “something that has happened in the past”, therefore its name has to be past tense // An Integration Event is an event that can cause side effects to other microservices, Bounded-Contexts or external systems. - public class ProductPriceChangedIntegrationEvent : IntegrationEvent + public record ProductPriceChangedIntegrationEvent : IntegrationEvent { - public int ProductId { get; private set; } + public int ProductId { get; private init; } - public decimal NewPrice { get; private set; } + public decimal NewPrice { get; private init; } - public decimal OldPrice { get; private set; } + public decimal OldPrice { get; private init; } public ProductPriceChangedIntegrationEvent(int productId, decimal newPrice, decimal oldPrice) { diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/GracePeriodConfirmedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/GracePeriodConfirmedIntegrationEvent.cs index 15b0aebb5..1eac25205 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/GracePeriodConfirmedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/GracePeriodConfirmedIntegrationEvent.cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class GracePeriodConfirmedIntegrationEvent : IntegrationEvent + public record GracePeriodConfirmedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderPaymentFailedIntegrationEvent .cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderPaymentFailedIntegrationEvent .cs index fec066521..a4d1c70f6 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderPaymentFailedIntegrationEvent .cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderPaymentFailedIntegrationEvent .cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderPaymentFailedIntegrationEvent : IntegrationEvent + public record OrderPaymentFailedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderPaymentSucceededIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderPaymentSucceededIntegrationEvent.cs index 9b220c7b7..8897deb31 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderPaymentSucceededIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderPaymentSucceededIntegrationEvent.cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderPaymentSucceededIntegrationEvent : IntegrationEvent + public record OrderPaymentSucceededIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs index 4a5d7db38..a47fb7988 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs @@ -9,7 +9,7 @@ namespace Ordering.API.Application.IntegrationEvents.Events // Integration Events notes: // An Event is “something that has happened in the past”, therefore its name has to be // An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems. - public class OrderStartedIntegrationEvent : IntegrationEvent + public record OrderStartedIntegrationEvent : IntegrationEvent { public string UserId { get; set; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs index a104215af..673b445cf 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } @@ -20,7 +20,7 @@ } } - public class OrderStockItem + public record OrderStockItem { public int ProductId { get; } public int Units { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs index 6ff92a1d3..34524f0c0 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents.Events { - public class OrderStatusChangedToCancelledIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToCancelledIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs index 6bcbc3494..50d6f7e72 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs index 1753fcc78..dc48ac06d 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents.Events { - public class OrderStatusChangedToShippedIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToShippedIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs index 24e51f55b..d87e30b81 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderStatusChangedToStockConfirmedIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToStockConfirmedIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedTosubmittedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedTosubmittedIntegrationEvent.cs index 816c8bddf..82f1125da 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedTosubmittedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedTosubmittedIntegrationEvent.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents.Events { - public class OrderStatusChangedToSubmittedIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToSubmittedIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs index 4bcc9aab5..2b09c8655 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderStockConfirmedIntegrationEvent : IntegrationEvent + public record OrderStockConfirmedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs index 647970581..c16148f84 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs @@ -3,7 +3,7 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using System.Collections.Generic; - public class OrderStockRejectedIntegrationEvent : IntegrationEvent + public record OrderStockRejectedIntegrationEvent : IntegrationEvent { public int OrderId { get; } @@ -17,7 +17,7 @@ } } - public class ConfirmedOrderStockItem + public record ConfirmedOrderStockItem { public int ProductId { get; } public bool HasStock { get; } diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs index 2cb49aae0..4cd74b16b 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/UserCheckoutAcceptedIntegrationEvent.cs @@ -4,7 +4,7 @@ using System; namespace Ordering.API.Application.IntegrationEvents.Events { - public class UserCheckoutAcceptedIntegrationEvent : IntegrationEvent + public record UserCheckoutAcceptedIntegrationEvent : IntegrationEvent { public string UserId { get; } diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Events/GracePeriodConfirmedIntegrationEvent.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Events/GracePeriodConfirmedIntegrationEvent.cs index 8fe92df76..e6b4f4dc7 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Events/GracePeriodConfirmedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Events/GracePeriodConfirmedIntegrationEvent.cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class GracePeriodConfirmedIntegrationEvent : IntegrationEvent + public record GracePeriodConfirmedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs index 2c5ecee27..c1a3e0a27 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; namespace Ordering.SignalrHub.IntegrationEvents { - public class OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs index e9ac5b39b..038b14a5a 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.Events { - public class OrderStatusChangedToCancelledIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToCancelledIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs index beb49965d..349c9f1a7 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.Events { - public class OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs index 0768c7f4e..4804dd504 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.Events { - public class OrderStatusChangedToShippedIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToShippedIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs index 588505c8f..137967ff6 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs @@ -2,7 +2,7 @@ namespace Ordering.SignalrHub.IntegrationEvents.Events { - public class OrderStatusChangedToStockConfirmedIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToStockConfirmedIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToSubmittedIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToSubmittedIntegrationEvent.cs index 5ea0cec71..3b1e04438 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToSubmittedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToSubmittedIntegrationEvent.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.Events { - public class OrderStatusChangedToSubmittedIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToSubmittedIntegrationEvent : IntegrationEvent { public int OrderId { get; } public string OrderStatus { get; } diff --git a/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderPaymentFailedIntegrationEvent.cs b/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderPaymentFailedIntegrationEvent.cs index d51c518c4..953e5dbaa 100644 --- a/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderPaymentFailedIntegrationEvent.cs +++ b/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderPaymentFailedIntegrationEvent.cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderPaymentFailedIntegrationEvent : IntegrationEvent + public record OrderPaymentFailedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderPaymentSucceededIntegrationEvent.cs b/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderPaymentSucceededIntegrationEvent.cs index 728b0d5a7..317ef8554 100644 --- a/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderPaymentSucceededIntegrationEvent.cs +++ b/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderPaymentSucceededIntegrationEvent.cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderPaymentSucceededIntegrationEvent : IntegrationEvent + public record OrderPaymentSucceededIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs b/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs index 88f60e0d6..caa3295d5 100644 --- a/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs +++ b/src/Services/Payment/Payment.API/IntegrationEvents/Events/OrderStatusChangedToStockConfirmedIntegrationEvent.cs @@ -2,7 +2,7 @@ { using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; - public class OrderStatusChangedToStockConfirmedIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToStockConfirmedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEvent.cs index c4adda56e..3f532ef0a 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEvent.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEvent.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Webhooks.API.IntegrationEvents { - public class OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent { public int OrderId { get; } public IEnumerable OrderStockItems { get; } @@ -19,7 +19,7 @@ namespace Webhooks.API.IntegrationEvents } } - public class OrderStockItem + public record OrderStockItem { public int ProductId { get; } public int Units { get; } diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEvent.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEvent.cs index 10693eb8b..2b03abacf 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEvent.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEvent.cs @@ -1,16 +1,12 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Webhooks.API.IntegrationEvents { - public class OrderStatusChangedToShippedIntegrationEvent : IntegrationEvent + public record OrderStatusChangedToShippedIntegrationEvent : IntegrationEvent { - public int OrderId { get; private set; } - public string OrderStatus { get; private set; } - public string BuyerName { get; private set; } + public int OrderId { get; private init; } + public string OrderStatus { get; private init; } + public string BuyerName { get; private init; } public OrderStatusChangedToShippedIntegrationEvent(int orderId, string orderStatus, string buyerName) { diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEvent.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEvent.cs index 18821f9fc..8fb860007 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEvent.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEvent.cs @@ -1,18 +1,14 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Webhooks.API.IntegrationEvents { - public class ProductPriceChangedIntegrationEvent : IntegrationEvent + public record ProductPriceChangedIntegrationEvent : IntegrationEvent { - public int ProductId { get; private set; } + public int ProductId { get; private init; } - public decimal NewPrice { get; private set; } + public decimal NewPrice { get; private init; } - public decimal OldPrice { get; private set; } + public decimal OldPrice { get; private init; } public ProductPriceChangedIntegrationEvent(int productId, decimal newPrice, decimal oldPrice) {