From f1d7966e2fafc42600078cbfc37de1a9dd256e0f Mon Sep 17 00:00:00 2001 From: Adnan Zahir Date: Fri, 24 Apr 2026 15:55:59 +0700 Subject: [PATCH] cmd: add disticnt farm warehouse validation --- cmd/auto-transfer-products-to-farm/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/auto-transfer-products-to-farm/main.go b/cmd/auto-transfer-products-to-farm/main.go index 221b5ad3..865c554d 100644 --- a/cmd/auto-transfer-products-to-farm/main.go +++ b/cmd/auto-transfer-products-to-farm/main.go @@ -316,7 +316,7 @@ func loadFarmWarehouseMap(ctx context.Context, db *gorm.DB, opts *commandOptions Select(` kw.location_id AS location_id, l.name AS location_name, - COUNT(fw.id) AS farm_count, + COUNT(DISTINCT fw.id) AS farm_count, MIN(fw.id) AS warehouse_id, MIN(fw.name) AS warehouse_name `).