added merge wallet 2

This commit is contained in:
2026-06-10 17:31:38 +03:30
parent 285767fcd3
commit 95ee496df0
6 changed files with 180 additions and 22 deletions
+22
View File
@@ -280,6 +280,28 @@ class Controller extends BaseController
return self::productSellTitle(self::metalTypeLabel());
}
/**
* آیا محصول به کیف اصلی متصل است؟ (setting: main_wallet_products)
* موجودی این محصولات = gold کیف اصلی؛ تراکنش‌هایشان روی کیف اصلی می‌نشیند.
*/
public static function isMainWalletProduct(?int $productId): bool
{
if (!$productId) {
return false;
}
return app(ConfigService::class)->isMainWalletProduct((int) $productId);
}
/**
* شناسه کیف مؤثر برای تراکنش محصول.
* محصولات متصل به کیف اصلی → null (کیف اصلی)؛ بقیه → کیف محصول خودشان.
*/
public static function effectiveProductWalletId(?int $productId): ?int
{
return self::isMainWalletProduct($productId) ? null : $productId;
}
/** واحد وزن معاملات فلز — از ستینگ unit؛ پیش‌فرض گرم */
public static function tradeWeightUnit(): string
{