Fixed bug where deletes of artifact groupings would not cascade
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text;
|
||||
using NpgsqlTypes;
|
||||
using Persic;
|
||||
|
||||
namespace OpenArchival.DataAccess;
|
||||
|
||||
@@ -11,22 +9,22 @@ public class ArtifactEntry
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This value gets appended on the end of the contianing ArtifactGrouping's
|
||||
/// Category value
|
||||
/// </summary>
|
||||
public string? ArtifactIdentifier
|
||||
public string? ArtifactIdentifier
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ArtifactGrouping is not null)
|
||||
? ModelHelpers.MakeIdentifier(ArtifactGrouping.IdentifierFields.Values, ArtifactGrouping.Category.FieldSeparator, ArtifactNumber)
|
||||
return (ArtifactGrouping is not null)
|
||||
? ModelHelpers.MakeIdentifier(ArtifactGrouping.IdentifierFields.Values, ArtifactGrouping.Category.FieldSeparator, ArtifactNumber)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
public string? ArtifactNumber { get; set; }
|
||||
public string? ArtifactNumber { get; set; }
|
||||
|
||||
public required string Title { get; set; }
|
||||
|
||||
@@ -45,7 +43,7 @@ public class ArtifactEntry
|
||||
public List<ArtifactDefect>? Defects { get; set; } = [];
|
||||
|
||||
public List<string>? Links { get; set; } = [];
|
||||
|
||||
|
||||
public required List<FilePathListing> Files { get; set; } = [];
|
||||
|
||||
public string? FileTextContent { get; set; } = null;
|
||||
@@ -54,6 +52,8 @@ public class ArtifactEntry
|
||||
|
||||
public bool IsPubliclyVisible { get; set; }
|
||||
|
||||
public int Quantity { get; set; }
|
||||
|
||||
|
||||
// Relationships this artifact has TO other artifacts
|
||||
public List<ArtifactEntry> RelatedTo { get; set; } = [];
|
||||
@@ -61,14 +61,10 @@ public class ArtifactEntry
|
||||
// Relationships other artifacts have TO this artifact
|
||||
public List<ArtifactEntry> RelatedBy { get; set; } = [];
|
||||
|
||||
|
||||
public int ArtifactGroupingId { get; set; }
|
||||
|
||||
public required ArtifactGrouping ArtifactGrouping { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// For keeping track of how many of this artifact are owned
|
||||
/// </summary>
|
||||
public int Quantity { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user