1.9 KiB
1.9 KiB
FruitBankHybridApp — Domain Rules
This is the single source of truth for domain rules. Do not duplicate these elsewhere. For detailed docs see:
README.md→docs/
Business Domain
- FruitBank = fruit & vegetable wholesaler. This is a nopCommerce plugin — Customer, Order, Product, GenericAttribute are nopCommerce entities.
- Shipping = INBOUND delivery (supplier → warehouse). Order = OUTBOUND delivery (warehouse → customer). Never confuse the two directions.
- "Pallet" (
XxxItemPallet) = a measurement record, NOT a physical pallet. Always created for every item, even non-measurable ones.
Measurement Logic
- IsMeasurable=false → weights are 0.0, only
TrayQuantityis recorded. A Pallet record is still created. - NetWeight = GrossWeight − PalletWeight − (TrayQuantity × TareWeight) — this formula is universal across ShippingItemPallet, OrderItemPallet, and StockTakingItemPallet.
- MeasuringStatus.Finnished — intentional legacy typo with double-n. Do NOT fix the spelling.
- MeasuringStatus progression: NotStarted(0) → Started(10) → Finnished(20) → Audited(30). OrderItemPallet adds Audited when RevisorId > 0.
Data Model
- GenericAttribute = polymorphic key-value store.
KeyGroup= owner type name,EntityId= owner ID. ProductDto reads IsMeasurable, Tare, AverageWeight, IncomingQuantity, NetWeight from GenericAttributes. - Three parallel measurement hierarchies share the same base (
MeasuringItemPalletBase):- Shipping: ShippingItem → ShippingItemPallet
- Order: OrderItemDto → OrderItemPallet (adds RevisorId for audit)
- StockTaking: StockTakingItem → StockTakingItemPallet
Technical
- SignalR uses AcBinaryHubProtocol (custom binary), not default JSON.
- Do not suggest removal/rollback as a solution — find a fix for the problem.
- All AyCode references are via DLL (not ProjectReference) — this is intentional.