FruitBankHybridApp/docs/GLOSSARY.md

80 lines
5.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Glossary / Fogalomtár
> For core framework glossary see: `../../../Aycode/Source/AyCode.Core/docs/GLOSSARY.md`
> For UI framework glossary see: `../../../Aycode/Source/AyCode.Blazor/docs/GLOSSARY.md`
Domain terminology for the FruitBank system. **Read this before making changes.**
## Business Domain
| English | Magyar | Definition |
|---|---|---|
| **Shipping** | Beszállítás | **INBOUND** delivery: supplier → warehouse. A truck arrival event. |
| **Order** | Megrendelés | **OUTBOUND** delivery: warehouse → customer. |
| **Pallet** (XxxItemPallet) | Mérési rekord | A **measurement record**, NOT a physical pallet. Always created, even for non-measurable products. |
| **Partner** | Partner / Beszállító | External supplier providing goods. |
| **ShippingDocument** | Szállítólevél | Supplier's delivery note or invoice, linked to a Shipping. |
| **ShippingItem** | Szállítólevél tétel | Product line on a shipping document. Tracks declared vs measured discrepancies. |
| **StockTaking** | Leltározás | Inventory session that freezes logical stock and reconciles with physical count. |
| **GenericAttribute** | Generikus attribútum | nopCommerce polymorphic key-value store. KeyGroup = owner type, EntityId = owner ID. |
## Measurement System
| Term | Definition |
|---|---|
| **IsMeasurable** | Product-level flag. If `false`: weights = 0.0, only TrayQuantity matters. A Pallet record is still created. |
| **NetWeight** | `GrossWeight PalletWeight (TrayQuantity × TareWeight)` — universal formula across all three hierarchies. |
| **TrayQuantity** | Always recorded, regardless of measurability. Count of trays/crates. |
| **GrossWeight** | Total weight including pallet and packaging. 0.0 if not measurable. |
| **PalletWeight** | Weight of the physical pallet. 0.0 if goods arrive without one. |
| **TareWeight** | Weight of a single tray/crate. Used in NetWeight calculation. |
| **AverageWeight** | Per-pallet average: `NetWeight / TrayQuantity`. Validated against threshold. |
| **MeasuringStatus** | NotStarted(0) → Started(10) → **Finnished**(20) → Audited(30). Note: "Finnished" is intentional. |
| **RevisorId** | Quality auditor's Customer ID. OrderItemPallet becomes "Audited" when RevisorId > 0. |
## Three Measurement Hierarchies
All share `MeasuringItemPalletBase` with the same NetWeight formula:
| Flow | Parent | Pallet Record | Extra |
|---|---|---|---|
| **Inbound (Shipping)** | ShippingItem | ShippingItemPallet | Declared vs measured discrepancy |
| **Outbound (Order)** | OrderItemDto | OrderItemPallet | RevisorId for audit |
| **Inventory (StockTaking)** | StockTakingItem | StockTakingItemPallet | QuantityDiff for stock adjustment |
## nopCommerce Entities
These are **NOT custom FruitBank entities** — they come from nopCommerce:
- Customer, Order, OrderItem, OrderNote, Product, GenericAttribute
FruitBank extends them via:
- **DTOs** (OrderDto, OrderItemDto, ProductDto) that wrap nopCommerce entities with measurement properties
- **GenericAttributes** for storing custom values (IsMeasurable, Tare, AverageWeight, etc.)
## Common Traps
| Trap | Correct Behavior |
|---|---|
| "Pallet" = physical pallet | ❌ It's a measurement record. Always created. |
| Shipping = outgoing | ❌ Shipping = INBOUND. Order = OUTBOUND. |
| Fix "Finnished" spelling | ❌ Intentional legacy typo. Do NOT fix. |
| IsMeasurable=false means no Pallet | ❌ Pallet is always created, weights just = 0.0 |
| NetWeight is stored | ❌ It's calculated: GrossWeight PalletWeight (TrayQuantity × TareWeight) |
| GenericAttribute is simple | ❌ It's polymorphic: KeyGroup determines which entity type owns the record |
## UI / Grid Components
| Term | Definition |
|---|---|
| **MgGridBase** | Abstract generic grid component from AyCode.Blazor. Extends DevExpress `DxGrid` with SignalR CRUD, layout persistence, master-detail, InfoPanel. See [AyCode.Blazor/docs/MGGRID.md](../../../Aycode/Source/AyCode.Blazor/docs/MGGRID.md). |
| **FruitBankGridBase** | Project-level adapter: fixes `TSignalRDataSource=SignalRDataSourceObservable`, `TId=int`, `TLoggerClient=LoggerClient`. Adds per-user layout, master/detail defaults. |
| **MgGridWithInfoPanel** | `DxSplitter` wrapper: grid (left pane) + InfoPanel (right pane), fullscreen overlay, splitter size persistence. |
| **MgGridToolbarBase** | `DxToolbar` base with `Grid` (IMgGridBase) reference and `RefreshClick` callback. |
| **MgGridDataColumn** | Extended `DxGridDataColumn` with URL template support (`{PropertyName}` placeholders in links). |
| **MgGridInfoPanel** | Default InfoPanel showing column-value pairs for the focused row, supports edit mode. |
| **IMgGridBase** | Public interface for grid: `IsSyncing`, `GridEditState`, `ParentGrid`, `StepPrevRow/NextRow`, layout persistence methods. |
| **MgGridEditState** | Enum: `None` (no edit), `New` (adding item), `Edit` (modifying item). |
| **AutoSaveLayoutName** | Base name for localStorage layout keys. Default: `"Grid{TDataItem.Name}"`. |
| **SignalRCrudTags** | Bundle of 5 integer message tags (GetAll, GetItem, Add, Update, Remove) for one entity type. |
| **IsMasterGrid** | `true` when `ParentDataItem == null` — the grid is a top-level (not detail) grid. |