feat(transport): manifest summary counts + schemaVersion 1.1 (M8 B3)

This commit is contained in:
Joseph Doherty
2026-06-18 05:52:12 -04:00
parent 0e507052a1
commit aefdb9f4b6
3 changed files with 70 additions and 4 deletions
@@ -95,7 +95,15 @@ public sealed class BundleExporter : IBundleExporter
DbConnections: resolved.DatabaseConnections.Count,
NotificationLists: resolved.NotificationLists.Count,
SmtpConfigs: resolved.SmtpConfigs.Count,
ApiMethods: resolved.ApiMethods.Count);
ApiMethods: resolved.ApiMethods.Count,
// M8 (B3): additive site/dataConnection/instance counts. Sourced from
// the serialized content DTO — the same arrays the importer reads —
// so the manifest summary always matches the packed payload. These
// arrays default to empty until B1/B2 populate them, so the counts
// are 0 today and become correct once those waves land.
Sites: contentDto.Sites.Count,
DataConnections: contentDto.DataConnections.Count,
Instances: contentDto.Instances.Count);
// 4. Build a TEMPLATE manifest. BundleSerializer.Pack re-stamps both
// ContentHash and EncryptionMetadata against the bytes it actually
@@ -12,7 +12,12 @@ namespace ZB.MOM.WW.ScadaBridge.Transport.Serialization;
public sealed class ManifestBuilder
{
public const int CurrentBundleFormatVersion = 1;
public const string CurrentSchemaVersion = "1.0";
// Schema minor version. Bumped 1.0 → 1.1 in M8 to carry the additive
// site/dataConnection/instance summary counts (and their content arrays).
// Minor bumps are additive-only: ManifestValidator gates solely on
// BundleFormatVersion, so an older "1.0" bundle still validates Ok.
public const string CurrentSchemaVersion = "1.1";
/// <summary>
/// Builds a <see cref="BundleManifest"/> with the current format version, a SHA-256 content hash,