Skip to main content

Repo Layout

The main repo is at C:\Dev\Plugin\WMSSyncHub. Key top-level folders:

FolderWhat it is
WmsSyncHub/The AutoCount plugin — DevExpress 22.2 Winforms, builds to WmsSyncHub.dll. Contains PluginMain.cs, the main FormWmsSync with its 5 tabs, and the per-module forms/controllers.
WmsSyncHubApi/The companion OWIN self-host console app (.exe). Hosts 5 background workers, the WMS gateway client, 4 HTTP controllers (/api/ping, /api/wms-status, /api/po-transfer, /api/wms-callback, /api/logs*), and the DB migration runner.
WMSSyncHubShadowMain/Developer-only Winforms shell that boots AutoCount, auto-logs in from App.config, and opens FormWmsSync directly. The heart of the inner-loop dev.bat workflow. Never shipped to customers.
tools/PowerShell CLI utilities for dev + testing. send-wms-callback.ps1 simulates WMS order-status callbacks from real picking-note data. send-asn-callback.ps1 does the same for ASN receipts.
reports/Living collection of audit / design / bug reports. Primary source of ground truth for anything to do with UOM, cancel flows, deep-comparison audits against the live gateway. Start with reports/README.md.
docs/Internal markdown — includes wms-haiwaicang-api.clean.md (the vendor's full API spec) and assorted design notes.
testapidoc.mdGolden curl examples for every WMS service we use. Verified end-to-end against the real gateway.
handoff.mdRunning list of known bugs + unfinished items. Check this at the start of any new session.

Inside WmsSyncHub/

SubfolderPurpose
Classes/Shared helpers — WmsSyncDataAccess.cs (DB reads/writes), Migrations.cs (versioned schema), AppLogger.cs (Serilog).
Operation Forms/The user-facing forms. FormWmsSync.* is the 5-tab main form; each tab has its own user control and data-access partner.
Report Forms/Any printable / chart forms (currently minimal).
Resources/Icons, images used in DevExpress controls.
Properties/AssemblyInfo.cs, Resources.resx, licenses.licx (DevExpress licensing).

Inside WmsSyncHubApi/

SubfolderPurpose
AutoCount/DB access layer for the AutoCount tables + the Migrations.cs runner.
WmsGateway/HTTP client + services for each GLINK call. Services/WmsItemService.cs, WmsOrderService.cs, WmsAsnService.cs, WmsCancelService.cs.
Workers/The 5 background workers — one per sync flow. See Workers.
Controllers/OWIN controllers — PingController, WmsStatusController, PoTransferController, WmsCallbackController, LogsController.
Models/Request/response DTOs for both our own HTTP surface and the WMS payloads.
Logging/Serilog configuration + the ErrorLogger helper that writes to Z_WmsErrorLog.
appsettings.jsonConfiguration — WMS credentials, DB connection, log-access API key, callback URL.

WMS-owned tables (we fully own these)

Z_WmsSyncConfig — schema version + feature flags
Z_WmsSyncLog — every sync event (push + callback)
Z_WmsSyncSetting — UI checkbox state (started, auto-sync-new, etc.)
Z_WmsPickingNoteStatus — per-order: WmsStage, WmsOrderNumber
Z_WmsPickingNoteItemStatus — per-line: ShippedQty (UOM), ShippedQtyEA (raw)
Z_WmsAsnReceiving — per-PO receipt tracking
Z_WmsPoSyncStatus — PO push state + CancelRequested flag
Z_WmsCancelHistory — audit trail of cancels
Z_WmsItemSyncConfig — per-item SyncEnabled / SyncStatus
Z_WmsErrorLog — errors from ErrorLogger.Error / Warn

Shared tables (owned by sibling plugin — never alter)

Z_PickingList — master picking list header
Z_PickingListDetail — SO assignments to a list
Z_PickingNote — per-group picking job
Z_PickingNoteDetail — per-item-per-job line
Z_ScannedHistory — live barcode scan log (read by Transfer SO to IV)

:::danger Do not alter shared tables Schema changes on these tables break the sibling "Transfer SO to IV" plugin. CRUD on the data inside them is fine (the plugin flips DtlStatus all the time); schema changes (add/rename/drop columns) are forbidden. Migrations in this codebase use CREATE TABLE IF NOT EXISTS + AddColumnIfMissing on the shared tables so we are guaranteed to be a no-op if the sibling plugin is already installed. :::