AyCode.Core/AyCode.Core.Tests/TestModels/SharedTestOrderModels.cs

197 lines
5.8 KiB
C#

using AyCode.Core.Extensions;
using AyCode.Core.Serializers.Attributes;
using AyCode.Core.Serializers.Binaries;
using MemoryPack;
using MessagePack;
namespace AyCode.Core.Tests.TestModels;
// ============================================================================
// _All_True family — every leaf marked [AcBinarySerializable(true)] (opt-out).
// All sub-references are _All_True-typed via the generic closing.
// `sealed` to enable AcBinary's non-polymorphic fast-path (no type-discriminator).
// ============================================================================
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class SharedTag_All_True : SharedTagBase
{
}
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class SharedCategory_All_True : SharedCategoryBase
{
}
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class SharedUser_All_True : SharedUserBase<UserPreferences_All_True>
{
}
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class UserPreferences_All_True : UserPreferencesBase
{
}
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class MetadataInfo_All_True : MetadataInfoBase<MetadataInfo_All_True>
{
}
/// <summary>
/// Level 1: Main order - root of the hierarchy
/// </summary>
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class TestOrder_All_True
: TestOrderBase<TestOrderItem_All_True, SharedTag_All_True, SharedUser_All_True,
SharedCategory_All_True, MetadataInfo_All_True, UserPreferences_All_True>
{
}
/// <summary>
/// Level 2: Order item with pallets
/// </summary>
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class TestOrderItem_All_True
: TestOrderItemBase<TestPallet_All_True, SharedTag_All_True, SharedUser_All_True,
MetadataInfo_All_True, TestOrder_All_True, UserPreferences_All_True>
{
}
/// <summary>
/// Level 3: Pallet containing measurements
/// </summary>
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class TestPallet_All_True
: TestPalletBase<TestMeasurement_All_True, SharedTag_All_True, SharedUser_All_True,
SharedCategory_All_True, MetadataInfo_All_True, TestOrderItem_All_True,
UserPreferences_All_True>
{
}
/// <summary>
/// Level 4: Measurement with multiple points
/// </summary>
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class TestMeasurement_All_True
: TestMeasurementBase<TestMeasurementPoint_All_True, SharedTag_All_True, SharedUser_All_True,
TestPallet_All_True, UserPreferences_All_True>
{
}
/// <summary>
/// Level 5: Deepest level - measurement point
/// </summary>
[MemoryPackable]
[AcBinarySerializable(true)]
[MessagePackObject]
public sealed partial class TestMeasurementPoint_All_True
: TestMeasurementPointBase<SharedTag_All_True, SharedUser_All_True, TestMeasurement_All_True,
UserPreferences_All_True>
{
}
// ============================================================================
// _All_False family — every leaf marked [AcBinarySerializable(false)] (opt-in).
// All sub-references are _All_False-typed via the generic closing.
// `sealed` to enable AcBinary's non-polymorphic fast-path.
// ============================================================================
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class SharedTag_All_False : SharedTagBase
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class SharedCategory_All_False : SharedCategoryBase
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class SharedUser_All_False : SharedUserBase<UserPreferences_All_False>
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class UserPreferences_All_False : UserPreferencesBase
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class MetadataInfo_All_False : MetadataInfoBase<MetadataInfo_All_False>
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class TestOrder_All_False
: TestOrderBase<TestOrderItem_All_False, SharedTag_All_False, SharedUser_All_False,
SharedCategory_All_False, MetadataInfo_All_False, UserPreferences_All_False>
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class TestOrderItem_All_False
: TestOrderItemBase<TestPallet_All_False, SharedTag_All_False, SharedUser_All_False,
MetadataInfo_All_False, TestOrder_All_False, UserPreferences_All_False>
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class TestPallet_All_False
: TestPalletBase<TestMeasurement_All_False, SharedTag_All_False, SharedUser_All_False,
SharedCategory_All_False, MetadataInfo_All_False, TestOrderItem_All_False,
UserPreferences_All_False>
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class TestMeasurement_All_False
: TestMeasurementBase<TestMeasurementPoint_All_False, SharedTag_All_False, SharedUser_All_False,
TestPallet_All_False, UserPreferences_All_False>
{
}
[MemoryPackable]
[AcBinarySerializable(false)]
[MessagePackObject]
public sealed partial class TestMeasurementPoint_All_False
: TestMeasurementPointBase<SharedTag_All_False, SharedUser_All_False, TestMeasurement_All_False,
UserPreferences_All_False>
{
}