Blog
08 · Industry Tech (Logistics & MedTech)Part 0120 min read

Software Architecture in Logistics & Supply Chain: Warehouse Management (WMS), UHF RFID, and FEFO Allocation

Explore the software engineering behind modern logistics: WMS bin-location addressing, FEFO (First Expired, First Out) C# stock allocation algorithms, UHF RFID dock door portals, and cold-chain fleet telemetry.

Emirhan Uluksar
Emirhan Uluksar

Founder & Principal Software Architect · Digital HAT

0 views
Software Architecture in Logistics & Supply Chain: Warehouse Management (WMS), UHF RFID, and FEFO Allocation

Software engineering is far more than rendering web forms on a screen—it is the invisible nervous system orchestrating thousands of refrigerated trucks, 50,000-pallet distribution centers, bonded customs warehouses, and automated conveyor sorters in real time. In Part 1 of our Industry Technology Series, we architect an enterprise logistics and supply chain platform from the ground up, covering Warehouse Management System (WMS) bin topologies, FEFO allocation engines, UHF RFID dock portals, and cold-chain telemetry validation in C# (.NET 9).

What You Will Master Step by Step in This Logistics Architecture Guide:
1. WMS (Warehouse Management System) solution folder layout, domain entities, and 5-tier bin-location addressing (Zone → Aisle → Rack → Level → Bin).
2. 1D Barcode vs. 2D GS1 DataMatrix vs. Passive UHF RFID (EPC Gen2) vs. Active BLE Beacons compared.
3. Writing a production FEFO (First Expired, First Out) stock allocation algorithm in C# enforcing customer Minimum Remaining Shelf-Life constraints.
4. UHF RFID Dock Door Portal Engine: Filtering 800 tag reads/sec with RSSI signal-strength thresholds (-62 dBm) to detect missing or stray boxes and trigger PLC dock alarms.
5. Cold-Chain Telemetry Compliance: Auditing refrigerated fleet trips for freezing or thermal excursions upon delivery.
Logistics WMS, RFID Gate Portals, Fleet Routing and Industry Software Architecture

1. WMS Solution Directory Tree & 5-Tier Warehouse Bin Addressing

A traditional ERP or accounting database only knows "We have 1,000 units of SKU-X in inventory." An enterprise Warehouse Management System (WMS) tracks which specific production batch (Lot Number), expiration date, temperature zone, physical rack coordinate (Bin Location), and 18-digit pallet license plate (GS1 SSCC-18) holds every single unit:

WAREHOUSE BIN ADDRESSING TOPOLOGY:  [ C01 - A04 - R18 - L03 - B02 ]
                                       │     │     │     │     └── BinSlot: Pallet position 02
                                       │     │     │     └──────── Level: 3rd vertical beam (Height: 4.5m)
                                       │     │     └────────────── RackBay: 18th vertical rack bay
                                       │     └──────────────────── Aisle: 4th reach-truck aisle
                                       └────────────────────────── Zone: C01 (+2°C/+8°C Cold Room)

DigitalHat.Logistics.Wms/
├── 1. Domain/
│   ├── Entities/
│   │   ├── BinLocation.cs                    # Rack bin dimensions, weight capacity & thermal zone
│   │   ├── LicensePlatePallet.cs             # GS1 SSCC-18 pallet ID, Lot/Batch, Expiry & quarantine flag
│   │   └── OutboundShipmentOrder.cs          # Customer shipment manifest & expected EPC tag set
│   └── Enums/
│       └── StorageZoneType.cs                # Ambient (+15/+25°C), Chilled (+2/+8°C), Frozen (-20°C)
├── 2. Features/
│   ├── Allocation/
│   │   └── FefoStockAllocator.cs             # FEFO + Customer Min Shelf-Life + Aisle path optimization
│   ├── RfidPortal/
│   │   └── RfidDockDoorVerificationService.cs # UHF RFID (865-868 MHz) dock portal verification engine
│   └── FleetRouting/
│       └── ColdChainDeliveryValidator.cs     # Refrigerated trailer thermal excursion auditor

2. Auto-ID Technologies Compared: 1D Barcode vs. 2D DataMatrix vs. UHF RFID

Technology Standard & Frequency Read Range & Throughput Line-of-Sight Required? Primary Supply Chain Application
1D Linear Barcode EAN-13 / GS1-128 10 cm – 1.5 m (Single scan, ~1 tag/sec) Yes (Laser must have unobstructed view) Retail point-of-sale and basic carton labeling.
2D DataMatrix / QR GS1 DataMatrix (ISO/IEC 16022) 5 cm – 2 m (Imager camera, ~3 tags/sec) Yes (Survives 30% label damage via Reed-Solomon ECC) Pharmaceutical serialization, surgical kits, encoding GTIN + Lot + Expiry + Serial in one symbol.
Passive UHF RFID EPCglobal Gen2 (ISO 18000-6C, 865–868 MHz) 0 – 12 Meters (800+ tags/sec bulk reading!) No! (Radio waves penetrate shrink-wrap and cardboard) Forklift dock door portals, high-speed conveyor tunnels, apparel inventory counts.
Active BLE Beacon Bluetooth 5.3 Low Energy (2.4 GHz, Battery) 30 – 100 Meters (Continuous telemetry broadcast) No Real-time cold-chain trailer temperature logging and yard asset tracking.

3. Production Code Walkthrough: FEFO Stock Allocation, UHF RFID Portals & Cold Chain

Step 3.1: FEFO (First Expired, First Out) Stock Allocator — FefoStockAllocator.cs

When a pharmaceutical or food distribution center receives an order for 100 cases, forklift operators are never allowed to grab whichever pallet happens to be closest. Moreover, hospital and retail contracts stipulate a Minimum Remaining Shelf-Life (e.g., "Do not ship product with fewer than 90 days remaining before expiration"). Our C# allocation engine filters out quarantined stock, enforces the customer's shelf-life threshold, sorts eligible pallets strictly by FEFO (earliest expiration date first), breaks ties by FIFO (oldest production date), and optimizes the forklift's aisle travel sequence:

// File Path: Features/Allocation/FefoStockAllocator.cs
using System;
using System.Collections.Generic;
using System.Linq;

namespace DigitalHat.Logistics.Wms.Features.Allocation;

public sealed record InventoryPallet(
    Guid PalletId,
    string Sscc18Barcode,       // Global 18-digit Serial Shipping Container Code (e.g., "003869123456789012")
    string Sku,
    string BinLocationCode,     // e.g., "C01-A04-R18-L03-B02"
    string LotNumber,
    DateOnly ProductionDate,
    DateOnly ExpirationDate,    // Product Expiration Date
    int AvailableQuantity,
    bool IsQuarantined          // Held by Quality Assurance?
);

public sealed record PickInstruction(
    Guid PalletId,
    string Sscc18Barcode,
    string BinLocationCode,
    string LotNumber,
    DateOnly ExpirationDate,
    int QuantityToPick
);

public static class FefoStockAllocator
{
    public static IReadOnlyList<PickInstruction> AllocateOrderFefo(
        string requestedSku,
        int requestedQuantity,
        int minRequiredShelfLifeDays,
        IEnumerable<InventoryPallet> warehousePallets,
        DateOnly dispatchDate)
    {
        if (requestedQuantity <= 0)
            throw new ArgumentOutOfRangeException(nameof(requestedQuantity), "Order quantity must be greater than zero.");

        DateOnly minimumAcceptableExpiry = dispatchDate.AddDays(minRequiredShelfLifeDays);

        // 1. Filter unquarantined pallets meeting minimum shelf-life, ordered by FEFO -> FIFO -> Aisle proximity:
        var eligiblePallets = warehousePallets
            .Where(p => p.Sku == requestedSku
                     && !p.IsQuarantined
                     && p.AvailableQuantity > 0
                     && p.ExpirationDate >= minimumAcceptableExpiry)
            .OrderBy(p => p.ExpirationDate)      // Priority 1: FEFO (Earliest expiration date first)
            .ThenBy(p => p.ProductionDate)       // Priority 2: FIFO (Oldest manufacturing batch)
            .ThenBy(p => p.BinLocationCode)      // Priority 3: Minimize forklift travel distance
            .ToList();

        var instructions = new List<PickInstruction>();
        int remainingToAllocate = requestedQuantity;

        foreach (var pallet in eligiblePallets)
        {
            if (remainingToAllocate <= 0) break;

            int pickQty = Math.Min(pallet.AvailableQuantity, remainingToAllocate);
            instructions.Add(new PickInstruction(
                pallet.PalletId,
                pallet.Sscc18Barcode,
                pallet.BinLocationCode,
                pallet.LotNumber,
                pallet.ExpirationDate,
                pickQty
            ));

            remainingToAllocate -= pickQty;
        }

        if (remainingToAllocate > 0)
        {
            throw new InvalidOperationException(
                $"Insufficient FEFO-compliant stock for SKU '{requestedSku}' (Min Expiry: {minimumAcceptableExpiry:yyyy-MM-dd}). Shortfall: {remainingToAllocate}");
        }

        return instructions;
    }
}

Step 3.2: UHF RFID Dock Door Portal Verification Engine — RfidDockDoorVerificationService.cs

As a forklift carries an 80-case pallet through Dock Door #4 (DOCK-DOOR-04) into a waiting trailer, dual-polarized Impinj / Zebra UHF RFID portal antennas interrogate all 80 passive 96-bit EPC Gen2 tags in under one second without slowing the forklift down.

Here is the real-world RF engineering challenge: radio waves can bounce off metal racks and pick up a stray pallet sitting 4 meters away at Dock Door #5 with a weak signal (e.g., -78 dBm RSSI). Our C# verification service filters out weak stray reflections below -62.0 dBm, deduplicates multi-antenna reads, checks for both missing cartons and unexpected foreign cartons, and returns a deterministic command for the dock door's PLC light tower:

// File Path: Features/RfidPortal/RfidDockDoorVerificationService.cs
using System;
using System.Collections.Generic;
using System.Linq;

namespace DigitalHat.Logistics.Wms.Features.RfidPortal;

public sealed record RfidTagReadEvent(
    string EpcHex96,          // 24-character Hex EPC payload (e.g., "3034257BF400B7800004E201")
    string DockDoorId,        // e.g., "DOCK-DOOR-04"
    int AntennaPort,          // Portal antenna port 1..4
    double RssiDbm,           // Return Signal Strength (-42 dBm = inside portal, -78 dBm = stray reflection)
    DateTimeOffset ReadAtUtc
);

public sealed record DockVerificationResult(
    bool IsApprovedForLoading,
    int ExpectedBoxCount,
    int VerifiedBoxCount,
    IReadOnlyList<string> MissingEpcs,
    IReadOnlyList<string> UnexpectedWrongEpcs,
    string PlcLightTowerCommand   // "GREEN_LIGHT_OPEN_BARRIER" or "RED_SIREN_LOCK_DOCK"
);

public sealed class RfidDockDoorVerificationService
{
    // Minimum RSSI threshold eliminating stray RF reflections from adjacent staging lanes:
    private const double MinimumValidRssiDbm = -62.0;

    public DockVerificationResult VerifyPalletPassThrough(
        IReadOnlySet<string> expectedOrderEpcs,
        IEnumerable<RfidTagReadEvent> rawAntennaReads)
    {
        // 1. Filter out weak stray reflections and deduplicate repeated reads across the 4 portal antennas:
        var validDistinctEpcs = rawAntennaReads
            .Where(r => r.RssiDbm >= MinimumValidRssiDbm)
            .Select(r => r.EpcHex96.Trim().ToUpperInvariant())
            .ToHashSet(StringComparer.Ordinal);

        // 2. Identify MISSING cartons that belong to the shipment but were not detected on the pallet:
        var missingEpcs = expectedOrderEpcs
            .Where(expected => !validDistinctEpcs.Contains(expected))
            .ToList();

        // 3. Identify UNEXPECTED foreign cartons accidentally placed on this pallet:
        var unexpectedWrongEpcs = validDistinctEpcs
            .Where(scanned => !expectedOrderEpcs.Contains(scanned))
            .ToList();

        bool isPerfectMatch = missingEpcs.Count == 0 && unexpectedWrongEpcs.Count == 0;

        return new DockVerificationResult(
            IsApprovedForLoading: isPerfectMatch,
            ExpectedBoxCount: expectedOrderEpcs.Count,
            VerifiedBoxCount: validDistinctEpcs.Count - unexpectedWrongEpcs.Count,
            MissingEpcs: missingEpcs,
            UnexpectedWrongEpcs: unexpectedWrongEpcs,
            PlcLightTowerCommand: isPerfectMatch ? "GREEN_LIGHT_OPEN_BARRIER" : "RED_SIREN_LOCK_DOCK"
        );
    }
}

Step 3.3: Cold-Chain Fleet Telemetry & Thermal Excursion Auditor — ColdChainDeliveryValidator.cs

Supply chain visibility extends onto the highway. Refrigerated trailers transporting biologics, vaccines, or fresh food log internal temperature every 5 minutes via BLE beacons. Upon arrival at the receiving dock, our API audits the entire trip log before allowing goods receipt:

// File Path: Features/FleetRouting/ColdChainDeliveryValidator.cs
using System;
using System.Collections.Generic;
using System.Linq;

namespace DigitalHat.Logistics.Wms.Features.FleetRouting;

public sealed record TemperatureSample(DateTimeOffset TimestampUtc, double Celsius);

public sealed record ColdChainAuditReport(
    bool IsCompliant,
    double MinTempC,
    double MaxTempC,
    int ExcursionMinutesAboveLimit,
    string ComplianceVerdict
);

public static class ColdChainDeliveryValidator
{
    public static ColdChainAuditReport EvaluateColdChainTrip(
        IReadOnlyList<TemperatureSample> samples,
        double minAllowedC = 2.0,
        double maxAllowedC = 8.0,
        int maxAllowedExcursionMinutes = 15,
        int sampleIntervalMinutes = 5)
    {
        if (samples.Count == 0)
            throw new ArgumentException("Cold-chain telemetry log cannot be empty.");

        double minTemp = samples.Min(s => s.Celsius);
        double maxTemp = samples.Max(s => s.Celsius);

        // Sub-zero freezing (< 0°C) immediately denatures biologics; also compute cumulative excursion duration:
        bool frozeBelowZero = minTemp < 0.0;
        int violationsCount = samples.Count(s => s.Celsius < minAllowedC || s.Celsius > maxAllowedC);
        int totalExcursionMinutes = violationsCount * sampleIntervalMinutes;

        bool isCompliant = !frozeBelowZero && totalExcursionMinutes <= maxAllowedExcursionMinutes;

        string verdict = isCompliant
            ? "APPROVED: Cold-chain (+2°C to +8°C) integrity verified for goods receipt."
            : $"REJECTED (QUARANTINE): Thermal excursion detected! Min: {minTemp:F1}°C, Max: {maxTemp:F1}°C, Excursion Duration: {totalExcursionMinutes} min.";

        return new ColdChainAuditReport(isCompliant, minTemp, maxTemp, totalExcursionMinutes, verdict);
    }
}

4. Up Next: Software Architecture in Healthcare & MedTech (HL7 FHIR R4 & Clinical Security)

We have designed and coded a production WMS bin hierarchy, a shelf-life-aware FEFO stock allocation engine, an RSSI-filtered UHF RFID dock door verifier, and a cold-chain telemetry auditor! In Part 2 of our Industry Technology Series, we explore Healthcare and MedTech Software Architecture: HL7 FHIR R4 JSON Interoperability, ICU Medical Device Integration, NEWS2 Clinical Early Warning Algorithms, and HIPAA/GDPR Field-Level Encryption.

Did you find this engineering guide helpful?

Give it a like or share it with your team and network.

0 views
Share This Guide: