Files
MoneyMap/MoneyMap.Core/Models/RecurringPlace.cs
T
aj 1cc0a355f2
Build MoneyMap image / build-and-push (push) Failing after 4s
feat: add recurring places and transaction pagination
2026-08-17 06:42:08 -04:00

40 lines
1.1 KiB
C#

using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace MoneyMap.Models;
[Index(nameof(MerchantId), nameof(CardId), nameof(Frequency), IsUnique = true)]
public class RecurringPlace
{
[Key]
public int Id { get; set; }
[Required]
public int MerchantId { get; set; }
public Merchant Merchant { get; set; } = null!;
[Required]
public int CardId { get; set; }
public Card Card { get; set; } = null!;
[Required]
public int CategoryId { get; set; }
public Category Category { get; set; } = null!;
[Column(TypeName = "decimal(18,2)")]
public decimal Amount { get; set; }
[Required]
[MaxLength(50)]
public string Frequency { get; set; } = string.Empty; // e.g., "Monthly", "Weekly", "Quarterly"
[Required]
public DateTime NextDueDate { get; set; }
[MaxLength(500)]
public string Notes { get; set; } = string.Empty;
[NotMapped]
public string DisplayLabel => $"{Merchant.Name} - {Card.Last4} - {Frequency} - ${Amount:N2}";
}