Moved namespaces to ordering.domain project
This commit is contained in:
parent
46dad7ac75
commit
4758530f1f
@ -1,11 +1,5 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||||
using Ordering.Domain.Events;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
|
|
||||||
{
|
|
||||||
public class Buyer
|
public class Buyer
|
||||||
: Entity, IAggregateRoot
|
: Entity, IAggregateRoot
|
||||||
{
|
{
|
||||||
@ -52,4 +46,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
|
|||||||
return payment;
|
return payment;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||||
{
|
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Card type class should be marked as abstract with protected constructor to encapsulate known enum types
|
/// Card type class should be marked as abstract with protected constructor to encapsulate known enum types
|
||||||
/// this is currently not possible as OrderingContextSeed uses this constructor to load cardTypes from csv file
|
/// this is currently not possible as OrderingContextSeed uses this constructor to load cardTypes from csv file
|
||||||
@ -18,4 +18,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
|
|
||||||
{
|
|
||||||
//This is just the RepositoryContracts or Interface defined at the Domain Layer
|
//This is just the RepositoryContracts or Interface defined at the Domain Layer
|
||||||
//as requisite for the Buyer Aggregate
|
//as requisite for the Buyer Aggregate
|
||||||
|
|
||||||
@ -13,4 +10,4 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
|
|||||||
Task<Buyer> FindAsync(string BuyerIdentityGuid);
|
Task<Buyer> FindAsync(string BuyerIdentityGuid);
|
||||||
Task<Buyer> FindByIdAsync(string id);
|
Task<Buyer> FindByIdAsync(string id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||||
using Ordering.Domain.Exceptions;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
|
|
||||||
{
|
|
||||||
public class PaymentMethod
|
public class PaymentMethod
|
||||||
: Entity
|
: Entity
|
||||||
{
|
{
|
||||||
@ -43,4 +39,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
|
|||||||
&& _expiration == expiration;
|
&& _expiration == expiration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
{
|
|
||||||
public class Address : ValueObject
|
public class Address : ValueObject
|
||||||
{
|
{
|
||||||
public String Street { get; private set; }
|
public String Street { get; private set; }
|
||||||
@ -33,4 +31,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
|||||||
yield return ZipCode;
|
yield return ZipCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
|
||||||
{
|
|
||||||
//This is just the RepositoryContracts or Interface defined at the Domain Layer
|
//This is just the RepositoryContracts or Interface defined at the Domain Layer
|
||||||
//as requisite for the Order Aggregate
|
//as requisite for the Order Aggregate
|
||||||
|
|
||||||
@ -14,4 +11,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
|||||||
|
|
||||||
Task<Order> GetAsync(int orderId);
|
Task<Order> GetAsync(int orderId);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
using Microsoft.eShopOnContainers.Services.Ordering.Ordering.Domain.Events;
|
||||||
using Ordering.Domain.Events;
|
|
||||||
using Ordering.Domain.Exceptions;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
|
||||||
{
|
|
||||||
public class Order
|
public class Order
|
||||||
: Entity, IAggregateRoot
|
: Entity, IAggregateRoot
|
||||||
{
|
{
|
||||||
@ -198,5 +193,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
|||||||
return _orderItems.Sum(o => o.GetUnits() * o.GetUnitPrice());
|
return _orderItems.Sum(o => o.GetUnits() * o.GetUnitPrice());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
using Ordering.Domain.Exceptions;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
|
||||||
{
|
|
||||||
public class OrderItem
|
public class OrderItem
|
||||||
: Entity
|
: Entity
|
||||||
{
|
{
|
||||||
@ -79,4 +76,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
|||||||
_units += units;
|
_units += units;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||||
{
|
|
||||||
using global::Ordering.Domain.Exceptions;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
public class OrderStatus
|
public class OrderStatus
|
||||||
: Enumeration
|
: Enumeration
|
||||||
@ -49,4 +45,3 @@
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using MediatR;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
|
||||||
|
|
||||||
namespace Ordering.Domain.Events
|
|
||||||
{
|
|
||||||
public class BuyerAndPaymentMethodVerifiedDomainEvent
|
public class BuyerAndPaymentMethodVerifiedDomainEvent
|
||||||
: INotification
|
: INotification
|
||||||
{
|
{
|
||||||
@ -17,4 +14,3 @@ namespace Ordering.Domain.Events
|
|||||||
OrderId = orderId;
|
OrderId = orderId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using MediatR;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Ordering.Domain.Events;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
|
|
||||||
namespace Ordering.Domain.Events
|
|
||||||
{
|
|
||||||
public class OrderCancelledDomainEvent : INotification
|
public class OrderCancelledDomainEvent : INotification
|
||||||
{
|
{
|
||||||
public Order Order { get; }
|
public Order Order { get; }
|
||||||
@ -12,4 +9,4 @@ namespace Ordering.Domain.Events
|
|||||||
Order = order;
|
Order = order;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using MediatR;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
|
|
||||||
namespace Ordering.Domain.Events
|
|
||||||
{
|
|
||||||
public class OrderShippedDomainEvent : INotification
|
public class OrderShippedDomainEvent : INotification
|
||||||
{
|
{
|
||||||
public Order Order { get; }
|
public Order Order { get; }
|
||||||
@ -12,4 +9,3 @@ namespace Ordering.Domain.Events
|
|||||||
Order = order;
|
Order = order;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using MediatR;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace Ordering.Domain.Events
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event used when an order is created
|
/// Event used when an order is created
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
namespace Ordering.Domain.Events
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||||
{
|
|
||||||
using MediatR;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event used when the grace period order is confirmed
|
/// Event used when the grace period order is confirmed
|
||||||
@ -20,4 +16,3 @@
|
|||||||
OrderItems = orderItems;
|
OrderItems = orderItems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,9 +1,4 @@
|
|||||||
namespace Ordering.Domain.Events
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||||
{
|
|
||||||
using MediatR;
|
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event used when the order is paid
|
/// Event used when the order is paid
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -20,4 +15,3 @@
|
|||||||
OrderItems = orderItems;
|
OrderItems = orderItems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,6 +1,4 @@
|
|||||||
namespace Ordering.Domain.Events
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||||
{
|
|
||||||
using MediatR;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Event used when the order stock items are confirmed
|
/// Event used when the order stock items are confirmed
|
||||||
@ -13,4 +11,3 @@
|
|||||||
public OrderStatusChangedToStockConfirmedDomainEvent(int orderId)
|
public OrderStatusChangedToStockConfirmedDomainEvent(int orderId)
|
||||||
=> OrderId = orderId;
|
=> OrderId = orderId;
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,7 +1,5 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions;
|
||||||
|
|
||||||
namespace Ordering.Domain.Exceptions
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Exception type for domain exceptions
|
/// Exception type for domain exceptions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -18,4 +16,3 @@ namespace Ordering.Domain.Exceptions
|
|||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
{ }
|
{ }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||||
{
|
|
||||||
using MediatR;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public abstract class Entity
|
public abstract class Entity
|
||||||
{
|
{
|
||||||
@ -89,4 +85,3 @@
|
|||||||
return !(left == right);
|
return !(left == right);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
|
||||||
{
|
|
||||||
public abstract class Enumeration : IComparable
|
public abstract class Enumeration : IComparable
|
||||||
{
|
{
|
||||||
public string Name { get; private set; }
|
public string Name { get; private set; }
|
||||||
@ -67,4 +62,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
|||||||
|
|
||||||
public int CompareTo(object other) => Id.CompareTo(((Enumeration)other).Id);
|
public int CompareTo(object other) => Id.CompareTo(((Enumeration)other).Id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||||
{
|
|
||||||
|
|
||||||
public interface IAggregateRoot { }
|
public interface IAggregateRoot { }
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||||
{
|
|
||||||
public interface IRepository<T> where T : IAggregateRoot
|
public interface IRepository<T> where T : IAggregateRoot
|
||||||
{
|
{
|
||||||
IUnitOfWork UnitOfWork { get; }
|
IUnitOfWork UnitOfWork { get; }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
using System;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork
|
|
||||||
{
|
|
||||||
public interface IUnitOfWork : IDisposable
|
public interface IUnitOfWork : IDisposable
|
||||||
{
|
{
|
||||||
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken));
|
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken));
|
||||||
Task<bool> SaveEntitiesAsync(CancellationToken cancellationToken = default(CancellationToken));
|
Task<bool> SaveEntitiesAsync(CancellationToken cancellationToken = default(CancellationToken));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
|
||||||
{
|
|
||||||
public abstract class ValueObject
|
public abstract class ValueObject
|
||||||
{
|
{
|
||||||
protected static bool EqualOperator(ValueObject left, ValueObject right)
|
protected static bool EqualOperator(ValueObject left, ValueObject right)
|
||||||
@ -45,4 +42,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
|||||||
return this.MemberwiseClone() as ValueObject;
|
return this.MemberwiseClone() as ValueObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user