2022-06-29 19:46:41 -04:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2019-01-31 16:45:01 -05:00
|
|
|
|
using Bit.Core.Enums;
|
|
|
|
|
|
using Bit.Core.Utilities;
|
|
|
|
|
|
|
2022-08-29 14:53:16 -04:00
|
|
|
|
namespace Bit.Core.Entities;
|
|
|
|
|
|
|
|
|
|
|
|
public class Transaction : ITableObject<Guid>
|
2019-01-31 16:45:01 -05:00
|
|
|
|
{
|
2022-08-29 14:53:16 -04:00
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
|
|
public Guid? UserId { get; set; }
|
|
|
|
|
|
public Guid? OrganizationId { get; set; }
|
|
|
|
|
|
public TransactionType Type { get; set; }
|
|
|
|
|
|
public decimal Amount { get; set; }
|
|
|
|
|
|
public bool? Refunded { get; set; }
|
|
|
|
|
|
public decimal? RefundedAmount { get; set; }
|
|
|
|
|
|
[MaxLength(100)]
|
|
|
|
|
|
public string Details { get; set; }
|
|
|
|
|
|
public PaymentMethodType? PaymentMethodType { get; set; }
|
|
|
|
|
|
public GatewayType? Gateway { get; set; }
|
|
|
|
|
|
[MaxLength(50)]
|
|
|
|
|
|
public string GatewayId { get; set; }
|
|
|
|
|
|
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
|
2019-01-31 16:45:01 -05:00
|
|
|
|
|
2022-08-29 14:53:16 -04:00
|
|
|
|
public void SetNewId()
|
|
|
|
|
|
{
|
|
|
|
|
|
Id = CoreHelpers.GenerateComb();
|
2019-01-31 16:45:01 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|