コード例 #1
0
 protected TransactionItem(TransactionEntity transaction, Guid userId, Guid applicationId)
 {
     Id                     = Guid.NewGuid();
     ApplicationId          = applicationId;
     TransactionId          = transaction.Id;
     TransactionName        = transaction.Name;
     TransactionDescription = transaction.Description;
     OutgoingStatusId       = transaction.OutgoingStatusId;
     TransactionAt          = DateTime.UtcNow;
     TransactionBy          = userId;
 }
コード例 #2
0
        public void ApplyTransaction(TransactionEntity transaction, Guid userId)
        {
            if (StatusId != null && transaction.IncomingStatusId != StatusId)
            {
                throw new AggregateIllegalLogicException("Wrong transaction. Check configuration.");
            }

            if (userId == Guid.Empty)
            {
                throw new AggregateValidationException("Invalid user id.");
            }

            TransactionItems.Add(TransactionItem.Create(transaction, userId, Id));
            UpdatedAt = DateTime.UtcNow;
        }
コード例 #3
0
 public static TransactionItem Create(TransactionEntity transaction, Guid userId, Guid applicationId) =>
 new TransactionItem(transaction, userId, applicationId);