Files
Budgeteer/BudgetApp/Data/Transaction.cs
T
2026-03-05 18:57:12 +00:00

51 lines
1.1 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace BudgetApp.Data;
public enum TransactionType
{
Income,
Expense
}
public enum RecurrenceType
{
None,
Daily,
Weekly,
Monthly,
Yearly
}
public class Transaction
{
public int Id { get; set; }
[Required, MaxLength(200)]
public string Description { get; set; } = string.Empty;
public decimal Amount { get; set; }
public DateTime Date { get; set; } = DateTime.Today;
public TransactionType Type { get; set; } = TransactionType.Expense;
public RecurrenceType RecurrenceType { get; set; } = RecurrenceType.None;
public DateTime? RecurrenceEndDate { get; set; }
public int? ParentTransactionId { get; set; }
public Transaction? ParentTransaction { get; set; }
public int AccountId { get; set; }
public Account Account { get; set; } = default!;
public int? CategoryId { get; set; }
public Category? Category { get; set; }
public bool IsPaid { get; set; } = false;
public int? SalaryId { get; set; }
public Salary? Salary { get; set; }
}