[LOADED_DOCS: 3 files, no new loads]

Rename ShallowCopy to FlatCopy, add polymorph support

- Renamed all "ShallowCopy" serializer presets and references to "FlatCopy" for clarity and consistency.
- Expanded documentation to clarify flat serialization use cases, especially for delta-update and partial-write scenarios.
- Added EnablePolymorphDetectFeature to AcBinarySerializableAttribute and updated all constructor overloads.
- Set UsePolymorphType = true in AcBinarySourceGenerator to enable polymorphic type support by default.
- Updated all [AcBinarySerializable(...)] usages to include new feature flags, explicitly disabling property filter and polymorph detection for affected types.
- Improved comments and documentation for maintainability.
This commit is contained in:
Loretta 2026-05-15 08:40:53 +02:00
parent 40d6567f29
commit 5b0b080b5a
18 changed files with 18 additions and 18 deletions

View File

@ -6,7 +6,7 @@ using Nop.Core.Domain.Orders;
namespace FruitBank.Common.Dtos; namespace FruitBank.Common.Dtos;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[LinqToDB.Mapping.Table(Name = nameof(GenericAttribute))] [LinqToDB.Mapping.Table(Name = nameof(GenericAttribute))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(GenericAttribute))] [System.ComponentModel.DataAnnotations.Schema.Table(nameof(GenericAttribute))]
[ToonDescription($"Data transfer object for {nameof(GenericAttribute)}", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(GenericAttribute)])] [ToonDescription($"Data transfer object for {nameof(GenericAttribute)}", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(GenericAttribute)])]

View File

@ -22,7 +22,7 @@ using System.Linq.Expressions;
namespace FruitBank.Common.Dtos; namespace FruitBank.Common.Dtos;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[LinqToDB.Mapping.Table(Name = nameof(Order))] [LinqToDB.Mapping.Table(Name = nameof(Order))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(Order))] [System.ComponentModel.DataAnnotations.Schema.Table(nameof(Order))]
[ToonDescription($"Data transfer object for {nameof(Order)}", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(Order)])] [ToonDescription($"Data transfer object for {nameof(Order)}", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(Order)])]

View File

@ -16,7 +16,7 @@ using System.Linq.Expressions;
namespace FruitBank.Common.Dtos; namespace FruitBank.Common.Dtos;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[LinqToDB.Mapping.Table(Name = nameof(OrderItem))] [LinqToDB.Mapping.Table(Name = nameof(OrderItem))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(OrderItem))] [System.ComponentModel.DataAnnotations.Schema.Table(nameof(OrderItem))]
[ToonDescription("Order item with measurements, pallets, and validation", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(OrderItem)])] [ToonDescription("Order item with measurements, pallets, and validation", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(OrderItem)])]

View File

@ -16,7 +16,7 @@ using System.Linq.Expressions;
namespace FruitBank.Common.Dtos; namespace FruitBank.Common.Dtos;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[LinqToDB.Mapping.Table(Name = nameof(Product))] [LinqToDB.Mapping.Table(Name = nameof(Product))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(Product))] [System.ComponentModel.DataAnnotations.Schema.Table(nameof(Product))]
[ToonDescription("Product data with measurements and generic attributes", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(Product)])] [ToonDescription("Product data with measurements and generic attributes", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(Product)])]

View File

@ -18,7 +18,7 @@ using FruitBank.Common.Entities;
namespace FruitBank.Common.Dtos namespace FruitBank.Common.Dtos
{ {
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[LinqToDB.Mapping.Table(Name = nameof(StockQuantityHistory))] [LinqToDB.Mapping.Table(Name = nameof(StockQuantityHistory))]
[System.ComponentModel.DataAnnotations.Schema.Table(nameof(StockQuantityHistory))] [System.ComponentModel.DataAnnotations.Schema.Table(nameof(StockQuantityHistory))]
[ToonDescription("Stock quantity history with net weight adjustments", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(StockQuantityHistory)])] [ToonDescription("Stock quantity history with net weight adjustments", TypeRelation = ToonTypeRelation.DtoOf, RelatedTypes = [typeof(StockQuantityHistory)])]

View File

@ -6,7 +6,7 @@ using Mango.Nop.Core.Entities;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Uploaded file with extracted text content", Purpose = "A centralized repository for all uploaded binary content and metadata, featuring a 'RawText' field that stores OCR-extracted information for full-text search and automated data validation across the system")] [ToonDescription("Uploaded file with extracted text content", Purpose = "A centralized repository for all uploaded binary content and metadata, featuring a 'RawText' field that stores OCR-extracted information for full-text search and automated data validation across the system")]
[Table(Name = FruitBankConstClient.FilesDbTableName)] [Table(Name = FruitBankConstClient.FilesDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.FilesDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.FilesDbTableName)]

View File

@ -12,7 +12,7 @@ using Table = LinqToDB.Mapping.TableAttribute;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Pallet measurements for order items with audit tracking", Purpose = "A measurement record for outgoing goods, used to verify that the net weight being sent to the customer is accurate and audited. NOTE: Despite the 'Pallet' name, this is a general measurement record that is ALWAYS created for every item. If the product is not measurable (IsMeasurable=false), weights are recorded as 0.0 and only TrayQuantity is stored.")] [ToonDescription("Pallet measurements for order items with audit tracking", Purpose = "A measurement record for outgoing goods, used to verify that the net weight being sent to the customer is accurate and audited. NOTE: Despite the 'Pallet' name, this is a general measurement record that is ALWAYS created for every item. If the product is not measurable (IsMeasurable=false), weights are recorded as 0.0 and only TrayQuantity is stored.")]
[Table(Name = FruitBankConstClient.OrderItemPalletDbTableName)] [Table(Name = FruitBankConstClient.OrderItemPalletDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.OrderItemPalletDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.OrderItemPalletDbTableName)]

View File

@ -7,7 +7,7 @@ using Mango.Nop.Core.Entities;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Pallet type definition with size and weight")] [ToonDescription("Pallet type definition with size and weight")]
[Table(Name = FruitBankConstClient.PalletDbTableName)] [Table(Name = FruitBankConstClient.PalletDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.PalletDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.PalletDbTableName)]

View File

@ -6,7 +6,7 @@ using Mango.Nop.Core.Entities;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Business partner with address and tax information", Purpose = "Represents an external legal entity, specifically a Supplier who provides goods or a business partner involved in the procurement chain")] [ToonDescription("Business partner with address and tax information", Purpose = "Represents an external legal entity, specifically a Supplier who provides goods or a business partner involved in the procurement chain")]
[Table(Name = FruitBankConstClient.PartnerDbTableName)] [Table(Name = FruitBankConstClient.PartnerDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.PartnerDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.PartnerDbTableName)]

View File

@ -7,7 +7,7 @@ using Mango.Nop.Core.Entities;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Shipping record with documents and measurement tracking", Purpose = "Represents a physical inbound delivery event (truck arrival) at the warehouse, tracking the vehicle and the overall measurement status of the shipment")] [ToonDescription("Shipping record with documents and measurement tracking", Purpose = "Represents a physical inbound delivery event (truck arrival) at the warehouse, tracking the vehicle and the overall measurement status of the shipment")]
[Table(Name = FruitBankConstClient.ShippingDbTableName)] [Table(Name = FruitBankConstClient.ShippingDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDbTableName)]

View File

@ -7,7 +7,7 @@ using System.Collections.ObjectModel;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Shipping document with partner, items and files", Purpose = "A digital representation of a supplier's delivery note or invoice associated with the shipment, used for reconciling paper-based data with measured reality")] [ToonDescription("Shipping document with partner, items and files", Purpose = "A digital representation of a supplier's delivery note or invoice associated with the shipment, used for reconciling paper-based data with measured reality")]
[Table(Name = FruitBankConstClient.ShippingDocumentDbTableName)] [Table(Name = FruitBankConstClient.ShippingDocumentDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentDbTableName)]

View File

@ -8,7 +8,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Links shipping documents to files with document type", Purpose = "A many-to-many link table that associates general uploaded files with specific shipping documents, assigning a functional context (DocumentType) to each file, such as identifying which PDF is the supplier's invoice versus the packing list")] [ToonDescription("Links shipping documents to files with document type", Purpose = "A many-to-many link table that associates general uploaded files with specific shipping documents, assigning a functional context (DocumentType) to each file, such as identifying which PDF is the supplier's invoice versus the packing list")]
[LinqToDB.Mapping.Table(Name = FruitBankConstClient.ShippingDocumentToFilesDbTableName)] [LinqToDB.Mapping.Table(Name = FruitBankConstClient.ShippingDocumentToFilesDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentToFilesDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentToFilesDbTableName)]

View File

@ -19,7 +19,7 @@ using Table = LinqToDB.Mapping.TableAttribute;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Shipping document item with measurements and pallets", Purpose = "Represents a specific product line item within a shipping document, storing the discrepancy between the supplier's declared weight/quantity and the warehouse's measured values")] [ToonDescription("Shipping document item with measurements and pallets", Purpose = "Represents a specific product line item within a shipping document, storing the discrepancy between the supplier's declared weight/quantity and the warehouse's measured values")]
[Table(Name = FruitBankConstClient.ShippingItemDbTableName)] [Table(Name = FruitBankConstClient.ShippingItemDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingItemDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingItemDbTableName)]

View File

@ -8,7 +8,7 @@ using System.Security.Cryptography.X509Certificates;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Pallet measurements for shipping items", Purpose = "The smallest unit of measurement tracking, representing a single physical measurement event. NOTE: Technically named 'Pallet' for legacy reasons, but it is ALWAYS created even if goods arrive without a physical pallet. For non-measurable products, weights are 0.0 and only TrayQuantity is tracked for tare-weight calculations.")] [ToonDescription("Pallet measurements for shipping items", Purpose = "The smallest unit of measurement tracking, representing a single physical measurement event. NOTE: Technically named 'Pallet' for legacy reasons, but it is ALWAYS created even if goods arrive without a physical pallet. For non-measurable products, weights are 0.0 and only TrayQuantity is tracked for tare-weight calculations.")]
[LinqToDB.Mapping.Table(Name = FruitBankConstClient.ShippingItemPalletDbTableName)] [LinqToDB.Mapping.Table(Name = FruitBankConstClient.ShippingItemPalletDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingItemPalletDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingItemPalletDbTableName)]

View File

@ -15,7 +15,7 @@ namespace FruitBank.Common.Entities
public bool IsInconsistent { get; set; } public bool IsInconsistent { get; set; }
} }
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[Table(Name = FruitBankConstClient.StockQuantityHistoryExtDbTableName)] [Table(Name = FruitBankConstClient.StockQuantityHistoryExtDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockQuantityHistoryExtDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockQuantityHistoryExtDbTableName)]
[ToonDescription("Extended weight-metadata for StockQuantityHistory", Purpose = "Validates quantity deltas against measured weight to detect inconsistencies")] [ToonDescription("Extended weight-metadata for StockQuantityHistory", Purpose = "Validates quantity deltas against measured weight to detect inconsistencies")]

View File

@ -5,7 +5,7 @@ using Mango.Nop.Core.Entities;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Inventory session record", Purpose = "Orchestrates inventory sessions by freezing logical stock states")] [ToonDescription("Inventory session record", Purpose = "Orchestrates inventory sessions by freezing logical stock states")]
[Table(Name = FruitBankConstClient.StockTakingDbTableName)] [Table(Name = FruitBankConstClient.StockTakingDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockTakingDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockTakingDbTableName)]

View File

@ -11,7 +11,7 @@ using Table = LinqToDB.Mapping.TableAttribute;
namespace FruitBank.Common.Entities; namespace FruitBank.Common.Entities;
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Line item for product reconciliation", Purpose = "Reconciles snapshot quantity with physical count to calculate final stock delta")] [ToonDescription("Line item for product reconciliation", Purpose = "Reconciles snapshot quantity with physical count to calculate final stock delta")]
[Table(Name = FruitBankConstClient.StockTakingItemDbTableName)] [Table(Name = FruitBankConstClient.StockTakingItemDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockTakingItemDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockTakingItemDbTableName)]

View File

@ -14,7 +14,7 @@ public interface IStockTakingItemPallet : IMeasuringItemPalletBase
public StockTakingItem? StockTakingItem{ get; set; } public StockTakingItem? StockTakingItem{ get; set; }
} }
[AcBinarySerializable(false, true, false, true)] [AcBinarySerializable(false, true, false, true, false, false)]
[ToonDescription("Weight record for inventory item", Purpose = "Granular weight-based evidence for a stock taking line item. NOTE: This record is mandatory for every inventory item. If weighing is skipped (non-measurable), it serves as a container for TrayQuantity with zeroed weight fields. The term 'Pallet' is a legacy naming convention.")] [ToonDescription("Weight record for inventory item", Purpose = "Granular weight-based evidence for a stock taking line item. NOTE: This record is mandatory for every inventory item. If weighing is skipped (non-measurable), it serves as a container for TrayQuantity with zeroed weight fields. The term 'Pallet' is a legacy naming convention.")]
[LinqToDB.Mapping.Table(Name = FruitBankConstClient.StockTakingItemPalletDbTableName)] [LinqToDB.Mapping.Table(Name = FruitBankConstClient.StockTakingItemPalletDbTableName)]
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockTakingItemPalletDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.StockTakingItemPalletDbTableName)]