2021-08-23 03:21:08 +01:00
|
|
|
using System;
|
2021-08-28 18:41:22 +01:00
|
|
|
using System.Collections.Generic;
|
2021-08-23 03:21:08 +01:00
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2021-08-28 18:41:22 +01:00
|
|
|
using Newtonsoft.Json;
|
2021-08-23 03:21:08 +01:00
|
|
|
|
|
|
|
|
namespace isnd.Data.Catalog
|
|
|
|
|
{
|
|
|
|
|
public enum PackageAction
|
|
|
|
|
{
|
|
|
|
|
DeletePackage,
|
|
|
|
|
PublishPackage
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class Commit : IObject
|
|
|
|
|
{
|
2021-08-28 18:41:22 +01:00
|
|
|
[Key,
|
|
|
|
|
DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
|
|
|
[JsonIgnore]
|
2021-08-23 03:21:08 +01:00
|
|
|
public long Id { get; set; }
|
|
|
|
|
|
2021-08-28 18:41:22 +01:00
|
|
|
[Required][JsonIgnore]
|
2021-08-23 03:21:08 +01:00
|
|
|
public DateTime TimeStamp{ get; set; }
|
|
|
|
|
|
|
|
|
|
[Required]
|
|
|
|
|
public PackageAction Action { get; set; }
|
|
|
|
|
|
2021-08-28 18:41:22 +01:00
|
|
|
[NotMapped]
|
2021-08-23 03:21:08 +01:00
|
|
|
public string CommitId { get => Id.ToString(); }
|
2021-08-28 18:41:22 +01:00
|
|
|
|
|
|
|
|
[NotMapped]
|
2021-08-23 03:21:08 +01:00
|
|
|
public DateTime CommitTimeStamp { get => TimeStamp; }
|
2021-08-28 18:41:22 +01:00
|
|
|
|
|
|
|
|
[ForeignKey("CommitNId")]
|
|
|
|
|
|
|
|
|
|
public virtual List<PackageVersion> Versions { get; set; }
|
2021-08-23 03:21:08 +01:00
|
|
|
}
|
|
|
|
|
}
|