mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(dir): ✨ add IsApproved query filter
This commit is contained in:
parent
73b37dec2c
commit
6e8b16dcc4
9 changed files with 9 additions and 0 deletions
|
|
@ -16,5 +16,6 @@ public virtual void Configure(EntityTypeBuilder<TAggregateRoot> builder)
|
|||
builder.Property(e => e.IsApproved)
|
||||
.IsRequired()
|
||||
.HasDefaultValue(true); // legacy json data approved via GitHub PR
|
||||
builder.HasQueryFilter(e => e.IsApproved == true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public virtual void Configure(EntityTypeBuilder<Dependent> builder)
|
|||
.WithMany(fl => fl.DependencyFilterLists)
|
||||
.HasForeignKey(d => d.DependentFilterListId)
|
||||
.HasConstraintName("fk_dependents_filter_lists_dependent_filter_list_id");
|
||||
builder.HasQueryFilter(d => d.DependencyFilterList.IsApproved == true && d.DependentFilterList.IsApproved == true);
|
||||
builder.HasDataJsonFile<Dependent>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ public virtual void Configure(EntityTypeBuilder<FilterListLanguage> builder)
|
|||
.WithMany(l => l.FilterListLanguages)
|
||||
.HasForeignKey(fll => fll.Iso6391)
|
||||
.HasConstraintName("fk_filter_list_languages_languages_iso6391");
|
||||
builder.HasQueryFilter(fll => fll.FilterList.IsApproved == true && fll.Language.IsApproved == true);
|
||||
builder.HasDataJsonFile<FilterListLanguage>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public virtual void Configure(EntityTypeBuilder<FilterListMaintainer> builder)
|
|||
|
||||
builder.ToTable($"{nr.RewriteName(nameof(FilterListMaintainer))}s");
|
||||
builder.HasKey(flm => new { flm.FilterListId, flm.MaintainerId });
|
||||
builder.HasQueryFilter(flm => flm.FilterList.IsApproved == true && flm.Maintainer.IsApproved == true);
|
||||
builder.HasDataJsonFile<FilterListMaintainer>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public virtual void Configure(EntityTypeBuilder<FilterListSyntax> builder)
|
|||
|
||||
builder.ToTable($"{nr.RewriteName(nameof(FilterListSyntax))}es");
|
||||
builder.HasKey(fls => new { fls.FilterListId, fls.SyntaxId });
|
||||
builder.HasQueryFilter(fls => fls.FilterList.IsApproved == true && fls.Syntax.IsApproved == true);
|
||||
builder.HasDataJsonFile<FilterListSyntax>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public virtual void Configure(EntityTypeBuilder<FilterListTag> builder)
|
|||
|
||||
builder.ToTable($"{nr.RewriteName(nameof(FilterListTag))}s");
|
||||
builder.HasKey(flt => new { flt.FilterListId, flt.TagId });
|
||||
builder.HasQueryFilter(flt => flt.FilterList.IsApproved == true && flt.Tag.IsApproved == true);
|
||||
builder.HasDataJsonFile<FilterListTag>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public virtual void Configure(EntityTypeBuilder<Fork> builder)
|
|||
.WithMany(fl => fl.UpstreamFilterLists)
|
||||
.HasForeignKey(f => f.ForkFilterListId)
|
||||
.HasConstraintName("fk_forks_filter_lists_fork_filter_list_id");
|
||||
builder.HasQueryFilter(f => f.UpstreamFilterList.IsApproved == true && f.ForkFilterList.IsApproved == true);
|
||||
builder.HasDataJsonFile<Fork>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public virtual void Configure(EntityTypeBuilder<Merge> builder)
|
|||
.WithMany(fl => fl.IncludedInFilterLists)
|
||||
.HasForeignKey(m => m.IncludesFilterListId)
|
||||
.HasConstraintName("fk_merges_filter_lists_includes_filter_list_id");
|
||||
builder.HasQueryFilter(m => m.IncludedInFilterList.IsApproved == true && m.IncludesFilterList.IsApproved == true);
|
||||
builder.HasDataJsonFile<Merge>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public virtual void Configure(EntityTypeBuilder<SoftwareSyntax> builder)
|
|||
|
||||
builder.ToTable($"{nr.RewriteName(nameof(SoftwareSyntax))}es");
|
||||
builder.HasKey(ss => new { ss.SoftwareId, ss.SyntaxId });
|
||||
builder.HasQueryFilter(ss => ss.Software.IsApproved == true && ss.Syntax.IsApproved == true);
|
||||
builder.HasDataJsonFile<SoftwareSyntax>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue