feat(templates): GetTemplateStubsAsync untracked identity/edge projection
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Scripts;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types.Templates;
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Repositories;
|
||||
|
||||
@@ -55,6 +56,12 @@ public interface ITemplateEngineRepository
|
||||
/// <returns>A task that resolves to a read-only list of all templates without script bodies.</returns>
|
||||
Task<IReadOnlyList<Template>> GetAllTemplatesForAnalysisAsync(CancellationToken cancellationToken = default);
|
||||
/// <summary>
|
||||
/// Returns an untracked identity/edge projection of every template (no children), ordered by name.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>A task that resolves to a read-only list of template stubs.</returns>
|
||||
Task<IReadOnlyList<TemplateStub>> GetTemplateStubsAsync(CancellationToken cancellationToken = default);
|
||||
/// <summary>
|
||||
/// Database-side paged listing of templates as row summaries (child
|
||||
/// collections reduced to counts, no script bodies). Backs the
|
||||
/// <c>ListTemplates</c> management command, which previously materialised
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Types.Templates;
|
||||
|
||||
/// <summary>
|
||||
/// Lightweight template identity/edge projection (no attributes, alarms, scripts or compositions)
|
||||
/// for callers that only need names and the inheritance/folder/ownership edges.
|
||||
/// </summary>
|
||||
/// <param name="Id">Template ID.</param>
|
||||
/// <param name="Name">Template name.</param>
|
||||
/// <param name="ParentTemplateId">Base template, if any.</param>
|
||||
/// <param name="FolderId">Containing folder, if any.</param>
|
||||
/// <param name="IsDerived">True for auto-derived composition templates.</param>
|
||||
/// <param name="OwnerCompositionId">Owning composition row for derived templates.</param>
|
||||
public sealed record TemplateStub(
|
||||
int Id,
|
||||
string Name,
|
||||
int? ParentTemplateId,
|
||||
int? FolderId,
|
||||
bool IsDerived,
|
||||
int? OwnerCompositionId);
|
||||
Reference in New Issue
Block a user