Deduplicate property overrides; Shipping carrier nullable
- Fix property enumeration to dedupe overridden/shadowed properties, ensuring only the most-derived is included (affects serialization and schema). - Update TOON_ISSUES.md: close duplicate property issue, document root cause and resolution. - Make CargoPartnerId nullable in Shipping and IShipping; clarify ToonDescription for carrier/truck/trailer fields. - Refine ShippingDocument ToonDescription for clarity. - Minor null-safety and style cleanup in GridShipping.razor.
This commit is contained in:
parent
3cb5efe2d2
commit
254ef5ef4c
|
|
@ -8,12 +8,12 @@ using Mango.Nop.Core.Entities;
|
|||
namespace FruitBank.Common.Entities;
|
||||
|
||||
[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 = "Inbound delivery event (truck arrival) at the warehouse. Created early and filled progressively — carrier, truck and trailer are assigned later.")]
|
||||
[Table(Name = FruitBankConstClient.ShippingDbTableName)]
|
||||
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDbTableName)]
|
||||
public sealed class Shipping : MgEntityBase, IShipping, IEntityComment
|
||||
{
|
||||
public int CargoPartnerId { get; set; }
|
||||
public int? CargoPartnerId { get; set; }
|
||||
public int? CargoTruckId { get; set; }
|
||||
public int? CargoTrailerId { get; set; }
|
||||
|
||||
|
|
@ -25,15 +25,15 @@ public sealed class Shipping : MgEntityBase, IShipping, IEntityComment
|
|||
|
||||
public DateTime? MeasuredDate { get; set; }
|
||||
|
||||
[ToonDescription(Purpose = "The transport company (carrier) that hauled this delivery — distinct from the goods supplier, which is reached via ShippingDocument.Partner.")]
|
||||
[ToonDescription(Purpose = "Carrier (transport company); assigned later, null until known. Supplier is separate — see ShippingDocument.Partner.")]
|
||||
[Association(ThisKey = nameof(CargoPartnerId), OtherKey = nameof(CargoPartner.Id), CanBeNull = true)]
|
||||
public CargoPartner CargoPartner { get; set; }
|
||||
|
||||
[ToonDescription(Purpose = "The tractor/truck unit — a CargoTruck row with IsTrailer=false.")]
|
||||
[ToonDescription(Purpose = "Tractor unit (CargoTruck, IsTrailer=false) from the carrier's fleet; assigned later, null until known.")]
|
||||
[Association(ThisKey = nameof(CargoTruckId), OtherKey = nameof(CargoTruck.Id), CanBeNull = true)]
|
||||
public CargoTruck CargoTruck { get; set; }
|
||||
|
||||
[ToonDescription(Purpose = "The trailer — the SAME CargoTruck table as CargoTruck, but the row with IsTrailer=true (CargoTrailerId → CargoTruck.Id).")]
|
||||
[ToonDescription(Purpose = "Trailer (CargoTruck table, IsTrailer=true); optional, assigned later — null if none or not yet known.")]
|
||||
[Association(ThisKey = nameof(CargoTrailerId), OtherKey = nameof(CargoTruck.Id), CanBeNull = true)]
|
||||
public CargoTruck CargoTrailer { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using System.Collections.ObjectModel;
|
|||
namespace FruitBank.Common.Entities;
|
||||
|
||||
[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 = "Supplier's delivery note or invoice for the shipment; reconciles paper data with measured reality. Populated progressively — much entered at order time, the rest as it becomes known.")]
|
||||
[Table(Name = FruitBankConstClient.ShippingDocumentDbTableName)]
|
||||
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentDbTableName)]
|
||||
public sealed class ShippingDocument : MgEntityBase, IShippingDocument
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace FruitBank.Common.Interfaces;
|
|||
|
||||
public interface IShipping : IEntityInt, ITimeStampInfo//, IMeasured
|
||||
{
|
||||
public int CargoPartnerId { get; set; }
|
||||
public int? CargoPartnerId { get; set; }
|
||||
public int? CargoTruckId { get; set; }
|
||||
public int? CargoTrailerId { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -204,10 +204,10 @@
|
|||
{
|
||||
var shipping = (Shipping)e.EditModel; // a szerkesztett sor
|
||||
|
||||
if (ValidateCargoConsistency(shipping, out string error)) return;
|
||||
if (ValidateCargoConsistency(shipping, out var error)) return;
|
||||
|
||||
e.Cancel = true;
|
||||
await DialogService.ShowMessageBoxAsync("Hibás adat", error, MessageBoxRenderStyle.Danger);
|
||||
await DialogService.ShowMessageBoxAsync("Hibás adat", error!, MessageBoxRenderStyle.Danger);
|
||||
// e.IsNew → add vs update
|
||||
|
||||
// ... before-save logika (validáció, számított mezők, CargoTrailer beállítás stb.)
|
||||
|
|
|
|||
Loading…
Reference in New Issue