StockControl: Warehouse Management System (WMS)
Description
Technologies used
- C#
- FastAPI
- Kotlin
- MySQL
- .NET
- PostGreSQL
- Python
- Google Cloud Run
- Docker
Responsibilities
- Product owner
- Backend developer
- Windows CE App Main developer
A comprehensive solution designed to optimize warehouse management and logistics operations. It provides real-time visibility into stock levels, managing everything from warehouses and rack locations to detailed lot tracking for FIFO/LIFO control.
Development started back in 2008 as a custom solution for an apparel factory. Currently on version 14.1.4.1.
Achievements
- System Integration: Seamless integration with SAP and other external platforms to streamline the reception process.
- Resource-Efficient Deployment: Optimized to run on Google Cloud Run (GCR) with a minimal resource footprint.
- Database Agnostic: Designed with a flexible data layer compatible with multiple database engines.
- Field-Ready Mobile App: A dedicated Android application tailored specifically for warehouse operations and staff.
- Hardware Compatibility: Full support for various industrial printers and handheld data collectors.
- High-Performance Throughput: Capable of processing 200+ complex receptions on a single small server, far exceeding the client's core requirements.
Learned
- Strongly Typed FastAPI DTOs: Implemented rigorous typing for Data Transfer Objects (DTOs) to ensure OpenAPI JSON schema compatibility, enabling seamless automated client generation for Kotlin and C# via OpenApiGenerator.
- Schema Normalization: Standardized endpoint and DTO naming conventions to eliminate conflicts and ensure predictable behavior across automated connector generators.
- Distributed UUID Synchronization: Utilized client-generated UUIDs as primary keys across both client and server applications, significantly simplifying the synchronization and "upsert" (add/update) logic.
- Modular API Architecture: Managed a high volume of endpoints by implementing dedicated APIRouters, ensuring a maintainable and scalable codebase.
- Repository Pattern with Atomic Transactions: Leveraged the Repository pattern with cascading commits to ensure data integrity, allowing for full rollbacks of complex, multistep operations.
- Granular Concurrency Control: Implemented selective row-level locking/releasing to optimize performance and prevent system freezes during high-complexity database operations.
Design
graph TB
MAIN([<b>DB</b> </br> MySQL/Postgres])
API[<b>API</b></br>]
DESKTOP[<b>PC</b> </br>Windows 7 or higher]
BARCODE_LABEL_PRINTERS[<b>Printers</b> </br>Zebra/Honeywell/etc]
RFID_READERS[<b>RFID Readers</b> </br>Portals / directional]
DATA_COLLECTORS[<b>Data collectors</b> </br>Android o WCE/ WEH]
ANDROID[<b>Cellphones</b> </br>Android]
SYNC[<b>Sync App</b></br>SAP/Microsoft Dynamics/Other]
MAIN <--> API
API <--> DESKTOP
API <--> DATA_COLLECTORS
API <--> ANDROID
API <--> SYNC
DESKTOP --> BARCODE_LABEL_PRINTERS
DATA_COLLECTORS --> BARCODE_LABEL_PRINTERS
ANDROID --> BARCODE_LABEL_PRINTERS
API <--> RFID_READERS
Components
-
API
- Enterprise-Grade Backend: Built with Python and FastAPI, focusing on high concurrency and asynchronous performance.
- Extensive API Architecture: Successfully architected and maintained a large-scale system featuring 200+ endpoints.
- Rigorous Code Coverage: Achieved an 89% coverage rate, ensuring that all core business logic and edge cases are thoroughly validated.
- Comprehensive Quality Assurance: Developed a robust testing framework with 600+ automated tests to ensure long-term maintainability.
-
Windows APP
- Platform: Developed using .NET C#
- Operating System Compatibility: Engineered for Windows 7 and above
-
Windows CE APP
- Developed for Windows CE and Windows Embedded Handheld (WEH) environments.
- Lifecycle Management: Currently in the maintenance phase of its lifecycle, providing critical support until the transition to updated customer hardware is complete.
- Offline-First Architecture: Designed as a standalone application capable of full functionality without a network connection, enabling audits in high-security or zero-coverage areas.
-
PlayStore Android App (deprecated)
We currently do strategic distribution managed via a private repository. We are addressing specific dependency constraints and ensure compatibility with legacy data collection hardware.
- Modern Kotlin Development: Leveraged Kotlin to build a robust, performant mobile application.
- Offline-First Architecture: Designed as a standalone application capable of full functionality without a network connection, enabling audits in high-security or zero-coverage areas.
- Continuous Integration & Deployment (CI/CD): Implemented automated pipelines for web builds.
-
Website
Product page
Video
Main advantages
Complex items / Variable Unit of Measure (UoM) & Multi-Quantity Tracking
The core strength of the system is the ability to manage bulk containers—such as drums or fabric rolls. These are tracked as individual units but consumed based on their internal volume or length.
- Multi-Axis Tracking: Seamlessly manage inventory by both count (number of units) and capacity (volume or length). This allows for precise real-time visibility into both physical containers and the raw materials they hold.
- Partial Consumption Management: The system supports incremental withdrawals from a container. It automatically calculates and tracks the remaining volume, ensuring that inventory levels are always accurate down to the milliliter or millimeter.
- Dynamic Content Validation: Accommodates variances in container capacity (e.g., drums containing between 180–200 liters), allowing for precise receiving and valuation based on actual content rather than theoretical averages.
Flexible reception within quality control
Deliveries from providers in real life differ from perfect. We encounter problems like:
- Partial delivery
- Damaged items
- Wrong items
- Missing items
- Expiration dates
- Quality issues
Workflow Optimization
- Autonomous Receiving Process: Decoupled the reception workflow from the purchasing department, eliminating bottlenecks and allowing warehouse operations to proceed without administrative delays.
- Flexible Inventory Inbound: Enables the reception and placement of any product regardless of its initial categorization, providing maximum operational flexibility.
- Discrepancy Reporting & Reconciliation: Integrated a post-reception reporting feature to identify inventory differences and perform accurate stock adjustments.
- Purchase Order (PO) Validation: Automated matching logic ensures that when linked to a Purchase Order, only authorized items are processed and reconciled.
Batch & Lot Traceability
StockControl features a comprehensive lot-tracking module designed for inventory requiring high accountability. This system is essential for managing products with strict expiration dates or batch-specific requirements.
StockControl uses a versatile item-type architecture to accommodate diverse warehouse requirements:
- Standard (Non-Lot Tracked): Optimized for high-turnover consumables where individual batch tracking is not required.
- Lot-Controlled: Enables strict batch-level traceability, essential for perishable goods and products with expiration dates.
- Serialized (Unique): Provides 1:1 tracking for high-value assets or electronics using unique serial numbers.
- Containerized (UIDC): Supports logical grouping of items into "Unique ID Container" (UIDC) containers for streamlined bulk movement and storage.
1. Standard (Non-Lot Tracked)
Standard items are high-volume, generic products that do not require individual batch tracking or serialization. For these materials, the system aggregates all stock under a single system-generated identifier at each location.
- The interface displays a single line per location for these products, consolidating all units into one pool.
- Designed for products where individual units are indistinguishable, meaning they do not require specific FIFO (First-In-First-Out) or LIFO (Last-In-First-Out) rotation policies.
2. Lot-Controlled
Lot-Controlled items are managed by specific batches to ensure traceability across different reception or production cycles. This classification is essential for products where characteristics—such as manufacturing date or chemical composition—differ between groups.
- Automated Batch Segregation: Every receipt or production run triggers the generation of a unique lot number. This ensures that multiple shipments of the same SKU remain distinct within the system.
- Granular Stock Visibility: If a single location contains two different lots, the system maintains them as separate line items. This precision allows for the strict application of FIFO (First-In-First-Out) or FEFO (First-Expired-First-Out) rotation policies
3. Serialized (Unique)
Serialized items are managed with the highest degree of granularity, where every unit is uniquely identified and tracked throughout its lifecycle. In this configuration, each unit is assigned a "Lot Size" of exactly one, ensuring that no two items are ever merged in the system.
- Unit-Level Accountability: Designed for high-value assets where individual tracking is required for security, warranty, or maintenance purposes.
- Variable Characteristic Management: Ideal for products that may share a common SKU but possess unique physical attributes—such as weight, length, or serial number—that must be recorded and managed independently.
Examples:
- High-Value Electronics: Laptop Computer: Beyond the model number, each laptop possesses a manufacturer-assigned serial number. To ensure security and precise asset tracking, the system generates a unique, non-repeatable identifier for every unit.
- Industrial Raw Materials: Fabric Roll: Even if two rolls are from the same production line, their actual length or weight may vary. Serializing each roll allows the warehouse to manage these specific physical variations, ensuring precise inventory valuation and consumption.
4. Containerized (UIDC)
Unique Identification Containers (UIDC) are specialized system entities used to aggregate multiple products into a single manageable unit. Each UIDC is assigned a unique, non-repeatable identifier. This identifier allows users to perform bulk movements, transfers, or audits on the entire group by scanning only the container code, significantly reducing manual data entry.
Example:
Any aggregation unit. Including boxes, bags, and pallets—as well as virtual groupings for logical inventory management.
Key Features
- Integrated assembly/disassembly modules, automated barcode label design, and a multi-platform environment supporting Windows Desktop, Android, and Windows CE.
- SAP Integration: The system features a dedicated Synchronization Panel to integrate seamlessly with SAP, managing purchase orders, stock adjustments, and supplier data.
- Industrial Impact: It facilitates high-speed logistics by grouping orders into picking flows, significantly reducing human error through industrial data collector integration.
- Support to all mayor barcode label printers. Zebra, Datamax, Honeywell. Support printer languages natively. ZPL, EPL, DPL, IPL, Fingerprint.
- Dedicated Android APP for warehouse operations in real time. ons in real time.
Synchronization with other systems.
Easy deliveries to other branches
sequenceDiagram
SAP->>Sync: New delivery order to outside warehouse
Sync-->>StockControl: Export order to SC
StockControl-->>Process: Picking
StockControl-->>Process: Packaging
StockControl-->>Process: Place on vehicle
StockControl->>Sync: Move to `On delivery`
Sync->>SAP: Move to `On delivery`
StockControl-->>Process: Unload from vehicle
StockControl->>Sync: Update delivery Order
Sync->>SAP: Update Delivery Order
Non-stop reception processes
Here is a diagram of the link between SAP logic and StockControl
erDiagram
PROVIDER ||--o{ RECEPTION : "Received"
PROVIDER ||--o{ PURCHASE_ORDER : "PO Generated"
RECEPTION ||--o{ DELIVERY_NOTE : "Composed by `N` Delivery notes"
DELIVERY_NOTE }o--o{ PURCHASE_ORDER : "N delivery notes linked with `N` PO"
RECEPTION ||--o{ RECEPTION_PACKAGES : "Contains"
RECEPTION_PACKAGES ||--|{ PACKAGE_CONTENT : Contains
PACKAGE_CONTENT {
string uuid
string description
string EAN
status ok_damaged_rejected_over
}
PURCHASE_ORDER ||--|{ PURCHASE_ORDER_LINE_ITEM : "Which contains `N`"
PURCHASE_ORDER_LINE_ITEM {
string uuid
string description
string EAN
}
PACKAGE_CONTENT ||--|| PURCHASE_ORDER_LINE_ITEM: "QC approved goods"



