diff --git a/FruitBank.Common/Entities/Shipping.cs b/FruitBank.Common/Entities/Shipping.cs index b41cbbb7..2a5d5755 100644 --- a/FruitBank.Common/Entities/Shipping.cs +++ b/FruitBank.Common/Entities/Shipping.cs @@ -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; } diff --git a/FruitBank.Common/Entities/ShippingDocument.cs b/FruitBank.Common/Entities/ShippingDocument.cs index ef51c669..e75ff104 100644 --- a/FruitBank.Common/Entities/ShippingDocument.cs +++ b/FruitBank.Common/Entities/ShippingDocument.cs @@ -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 diff --git a/FruitBank.Common/Interfaces/IShipping.cs b/FruitBank.Common/Interfaces/IShipping.cs index 73bf5ab7..3f43e2af 100644 --- a/FruitBank.Common/Interfaces/IShipping.cs +++ b/FruitBank.Common/Interfaces/IShipping.cs @@ -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; } diff --git a/FruitBankHybrid.Shared/Components/Grids/Shippings/GridShipping.razor b/FruitBankHybrid.Shared/Components/Grids/Shippings/GridShipping.razor index c188f704..c668cd3a 100644 --- a/FruitBankHybrid.Shared/Components/Grids/Shippings/GridShipping.razor +++ b/FruitBankHybrid.Shared/Components/Grids/Shippings/GridShipping.razor @@ -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.)