Expense.cs
1,417 bytes
| 1 | using System.ComponentModel.DataAnnotations; |
|---|---|
| 2 | using System.ComponentModel.DataAnnotations.Schema; |
| 3 | using SplitApp.Modules.Expenses.Domain.Enums; |
| 4 | using SplitApp.Shared.Contracts.Users; |
| 5 | using SplitApp.Shared.Kernel.Domain; |
| 6 | |
| 7 | namespace SplitApp.Modules.Expenses.Domain.Entities; |
| 8 | |
| 9 | public class Expense : BaseEntity |
| 10 | { |
| 11 | /// <summary>FK to trips.Trip.</summary> |
| 12 | public Guid TripId { get; set; } |
| 13 | /// <summary>Cross-module nav — populated by WebApp facade, never by EF (NotMapped).</summary> |
| 14 | [NotMapped] public object? Trip { get; set; } |
| 15 | |
| 16 | /// <summary>FK to users.AspNetUsers.</summary> |
| 17 | public Guid PaidByUserId { get; set; } |
| 18 | /// <summary>Cross-module nav — populated by WebApp facade, never by EF (NotMapped).</summary> |
| 19 | [NotMapped] public UserDto? PaidByUser { get; set; } |
| 20 | |
| 21 | /// <summary>FK to trips.BudgetCategory.</summary> |
| 22 | public Guid? BudgetCategoryId { get; set; } |
| 23 | /// <summary>Cross-module nav — populated by WebApp facade, never by EF (NotMapped).</summary> |
| 24 | [NotMapped] public object? BudgetCategory { get; set; } |
| 25 | |
| 26 | public Guid? CurrencyId { get; set; } |
| 27 | public Currency? Currency { get; set; } |
| 28 | |
| 29 | public decimal Amount { get; set; } |
| 30 | |
| 31 | [MaxLength(500)] |
| 32 | public string? Description { get; set; } |
| 33 | |
| 34 | public DateTime ExpenseDate { get; set; } |
| 35 | |
| 36 | public ESplitMethod SplitMethod { get; set; } |
| 37 | |
| 38 | public ICollection<ExpenseSplit>? Splits { get; set; } |
| 39 | } |
| 40 | |