2024-08-12 00:15:16 -05:00
|
|
|
|
using LANCommander.SDK.Enums;
|
2024-03-11 17:38:29 -05:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2023-01-15 03:11:51 -06:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
2024-08-04 18:44:33 -05:00
|
|
|
|
namespace LANCommander.Server.Data.Models
|
2023-01-15 03:11:51 -06:00
|
|
|
|
{
|
|
|
|
|
|
[Table("Scripts")]
|
|
|
|
|
|
public class Script : BaseModel
|
|
|
|
|
|
{
|
2024-03-11 17:38:29 -05:00
|
|
|
|
[Required]
|
2023-01-15 03:11:51 -06:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
public string? Description { get; set; }
|
|
|
|
|
|
public ScriptType Type { get; set; }
|
|
|
|
|
|
public string Contents { get; set; }
|
|
|
|
|
|
public bool RequiresAdmin { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public Guid? GameId { get; set; }
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
[ForeignKey(nameof(GameId))]
|
|
|
|
|
|
[InverseProperty("Scripts")]
|
2024-11-27 01:51:47 -06:00
|
|
|
|
public Game? Game { get; set; }
|
2023-10-18 01:14:31 -05:00
|
|
|
|
|
|
|
|
|
|
public Guid? RedistributableId { get; set; }
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
[ForeignKey(nameof(RedistributableId))]
|
|
|
|
|
|
[InverseProperty("Scripts")]
|
2024-11-27 01:51:47 -06:00
|
|
|
|
public Redistributable? Redistributable { get; set; }
|
2023-12-20 17:53:52 -06:00
|
|
|
|
|
|
|
|
|
|
public Guid? ServerId { get; set; }
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
[ForeignKey(nameof(ServerId))]
|
|
|
|
|
|
[InverseProperty("Scripts")]
|
2024-11-27 01:51:47 -06:00
|
|
|
|
public Server? Server { get; set; }
|
2023-01-15 03:11:51 -06:00
|
|
|
|
}
|
|
|
|
|
|
}
|