using Microsoft.EntityFrameworkCore; using OnlyPrompt.Backend.Database.Core; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace OnlyPrompt.Backend.Database.Models { [Index(nameof(Level), nameof(UserId), IsUnique = true)] public class SubscriptionTierModel : EntityBase { [Required] public required string Name { get; set; } [MaxLength(1000)] public string? Description { get; set; } [Required] [ForeignKey(nameof(User))] public Guid UserId { get; set; } [DeleteBehavior(DeleteBehavior.Cascade)] public required virtual UserModel User { get; set; } public decimal MonthlyPrice { get; set; } public int Level { get; set; } public virtual IList Prompts { get; set; } = new List(); public virtual IList Subscriptions { get; set; } = new List(); } }