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;
|
||||
using Ordering.Domain.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
|
||||
{
|
||||
public class Buyer
|
||||
: Entity, IAggregateRoot
|
||||
{
|
||||
@ -52,4 +46,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
|
||||
return payment;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
|
||||
{
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||
|
||||
/// <remarks>
|
||||
/// 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
|
||||
@ -18,4 +18,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
|
||||
{
|
||||
//This is just the RepositoryContracts or Interface defined at the Domain Layer
|
||||
//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> FindByIdAsync(string id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,5 @@
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
using Ordering.Domain.Exceptions;
|
||||
using System;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate
|
||||
{
|
||||
public class PaymentMethod
|
||||
: Entity
|
||||
{
|
||||
@ -43,4 +39,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
|
||||
&& _expiration == expiration;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
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 String Street { get; private set; }
|
||||
@ -33,4 +31,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
||||
yield return ZipCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
||||
{
|
||||
//This is just the RepositoryContracts or Interface defined at the Domain Layer
|
||||
//as requisite for the Order Aggregate
|
||||
|
||||
@ -14,4 +11,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
||||
|
||||
Task<Order> GetAsync(int orderId);
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,7 @@
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
using Ordering.Domain.Events;
|
||||
using Ordering.Domain.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Ordering.Domain.Events;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
||||
{
|
||||
public class Order
|
||||
: Entity, IAggregateRoot
|
||||
{
|
||||
@ -198,5 +193,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
||||
return _orderItems.Sum(o => o.GetUnits() * o.GetUnitPrice());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
using Ordering.Domain.Exceptions;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
||||
{
|
||||
public class OrderItem
|
||||
: Entity
|
||||
{
|
||||
@ -79,4 +76,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
|
||||
_units += units;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,6 @@
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
||||
{
|
||||
using global::Ordering.Domain.Exceptions;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
|
||||
public class OrderStatus
|
||||
: Enumeration
|
||||
@ -49,4 +45,3 @@
|
||||
return state;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
using MediatR;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||
|
||||
namespace Ordering.Domain.Events
|
||||
{
|
||||
public class BuyerAndPaymentMethodVerifiedDomainEvent
|
||||
: INotification
|
||||
{
|
||||
@ -17,4 +14,3 @@ namespace Ordering.Domain.Events
|
||||
OrderId = orderId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
using MediatR;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Ordering.Domain.Events;
|
||||
|
||||
namespace Ordering.Domain.Events
|
||||
{
|
||||
public class OrderCancelledDomainEvent : INotification
|
||||
{
|
||||
public Order Order { get; }
|
||||
@ -12,4 +9,4 @@ namespace Ordering.Domain.Events
|
||||
Order = order;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
using MediatR;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||
|
||||
namespace Ordering.Domain.Events
|
||||
{
|
||||
public class OrderShippedDomainEvent : INotification
|
||||
{
|
||||
public Order Order { get; }
|
||||
@ -12,4 +9,3 @@ namespace Ordering.Domain.Events
|
||||
Order = order;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
using MediatR;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
using System;
|
||||
|
||||
namespace Ordering.Domain.Events
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Event used when an order is created
|
||||
|
@ -1,8 +1,4 @@
|
||||
namespace Ordering.Domain.Events
|
||||
{
|
||||
using MediatR;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
using System.Collections.Generic;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event used when the grace period order is confirmed
|
||||
@ -20,4 +16,3 @@
|
||||
OrderItems = orderItems;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,4 @@
|
||||
namespace Ordering.Domain.Events
|
||||
{
|
||||
using MediatR;
|
||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||
/// <summary>
|
||||
/// Event used when the order is paid
|
||||
/// </summary>
|
||||
@ -20,4 +15,3 @@
|
||||
OrderItems = orderItems;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
namespace Ordering.Domain.Events
|
||||
{
|
||||
using MediatR;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Event used when the order stock items are confirmed
|
||||
@ -13,4 +11,3 @@
|
||||
public OrderStatusChangedToStockConfirmedDomainEvent(int orderId)
|
||||
=> OrderId = orderId;
|
||||
}
|
||||
}
|
@ -1,7 +1,5 @@
|
||||
using System;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions;
|
||||
|
||||
namespace Ordering.Domain.Exceptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception type for domain exceptions
|
||||
/// </summary>
|
||||
@ -18,4 +16,3 @@ namespace Ordering.Domain.Exceptions
|
||||
: base(message, innerException)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,4 @@
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork
|
||||
{
|
||||
using MediatR;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
|
||||
public abstract class Entity
|
||||
{
|
||||
@ -89,4 +85,3 @@
|
||||
return !(left == right);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
||||
{
|
||||
public abstract class Enumeration : IComparable
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork
|
||||
{
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
|
||||
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
|
||||
{
|
||||
IUnitOfWork UnitOfWork { get; }
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,7 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork
|
||||
{
|
||||
public interface IUnitOfWork : IDisposable
|
||||
{
|
||||
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken));
|
||||
Task<bool> SaveEntitiesAsync(CancellationToken cancellationToken = default(CancellationToken));
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
||||
{
|
||||
public abstract class ValueObject
|
||||
{
|
||||
protected static bool EqualOperator(ValueObject left, ValueObject right)
|
||||
@ -45,4 +42,3 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
||||
return this.MemberwiseClone() as ValueObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user