1
0
mirror of https://github.com/bitwarden/server synced 2026-01-01 08:03:23 +00:00
Files
server/src/Core/Entities/Transaction.cs
Alex Morask 9f7e05869e [AC-1900] Update Vault DB to support provider billing (#3875)
* Add Gateway columns to Provider table

* Add ProviderId column to Transaction table

* Create ProviderPlan table

* Matt's feedback

* Rui's feedback

* Fixed Gateway parameter on Provider
2024-03-21 11:15:49 -04:00

30 lines
889 B
C#

using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Utilities;
namespace Bit.Core.Entities;
public class Transaction : ITableObject<Guid>
{
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;
public Guid? ProviderId { get; set; }
public void SetNewId()
{
Id = CoreHelpers.GenerateComb();
}
}