using Microsoft.AspNetCore.DataProtection.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using ZB.MOM.WW.OtOpcUa.Configuration.Entities;
using ZB.MOM.WW.OtOpcUa.Configuration.Enums;
namespace ZB.MOM.WW.OtOpcUa.Configuration;
///
/// Central config DB context. Schema matches docs/v2/config-db-schema.md exactly —
/// any divergence is a defect caught by the SchemaComplianceTests introspection check.
///
public sealed class OtOpcUaConfigDbContext(DbContextOptions options)
: DbContext(options), IDataProtectionKeyContext
{
/// Gets the DbSet of server clusters.
public DbSet ServerClusters => Set();
/// Gets the DbSet of cluster nodes.
public DbSet ClusterNodes => Set();
/// Gets the DbSet of cluster node credentials.
public DbSet ClusterNodeCredentials => Set();
/// Gets the DbSet of v3 Raw-tree driver-organizing folders.
public DbSet RawFolders => Set();
/// Gets the DbSet of v3 Raw-tree tag groups (nestable under a device).
public DbSet TagGroups => Set();
/// Gets the DbSet of v3 UNS tag references (equipment → raw tag projection).
public DbSet UnsTagReferences => Set();
/// Gets the DbSet of UNS areas.
public DbSet UnsAreas => Set();
/// Gets the DbSet of UNS lines.
public DbSet UnsLines => Set();
/// Gets the DbSet of driver instances.
public DbSet DriverInstances => Set();
/// Gets the DbSet of devices.
public DbSet Devices => Set();
/// Gets the DbSet of equipment.
public DbSet Equipment => Set();
/// Gets the DbSet of tags.
public DbSet Tags => Set();
/// Gets the DbSet of poll groups.
public DbSet PollGroups => Set();
/// Gets the DbSet of node ACLs.
public DbSet NodeAcls => Set();
/// OPC UA data-plane API keys. One principal per key; secret stored as a peppered hash.
public DbSet ApiKeys => Set();
/// Gets the DbSet of configuration audit logs.
public DbSet ConfigAuditLogs => Set();
/// Gets the DbSet of external ID reservations.
public DbSet ExternalIdReservations => Set();
/// Gets the DbSet of LDAP group role mappings.
public DbSet LdapGroupRoleMappings => Set();
/// Gets the DbSet of scripts.
public DbSet