mirror of https://github.com/abpframework/eventhub
7 changed files with 65 additions and 23 deletions
@ -0,0 +1,8 @@ |
|||
namespace Payment.PaymentRequests |
|||
{ |
|||
public static class PaymentRequestConsts |
|||
{ |
|||
public const int MaxProductIdLength = 100; |
|||
public const int MaxProductNameLength = 200; |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
namespace Payment.PaymentRequests |
|||
{ |
|||
public enum PaymentRequestState : byte |
|||
{ |
|||
Waiting = 0, |
|||
Completed, |
|||
Failed |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
|
|||
namespace Payment.PaymentRequests |
|||
{ |
|||
public class PaymentRequest : CreationAuditedAggregateRoot<Guid> |
|||
{ |
|||
public string CustomerId { get; private set; } |
|||
|
|||
public string ProductId { get; private set; } |
|||
|
|||
[NotNull] |
|||
public string ProductName { get; private set; } |
|||
|
|||
public decimal Amount { get; private set; } |
|||
|
|||
public PaymentRequestState State { get; set; } |
|||
|
|||
public PaymentRequest( |
|||
Guid id, |
|||
[NotNull] string productName, |
|||
[CanBeNull] string productId, |
|||
decimal amount) |
|||
: base(id) |
|||
{ |
|||
ProductName = Check.NotNullOrWhiteSpace(productName, nameof(productName)); |
|||
ProductId = productId; |
|||
Amount = amount; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue