feat(shayegan): per-product item code and auto customer Account/Put

This commit is contained in:
2026-10-28 16:51:47 +03:30
parent 25ee47b473
commit 9528056036
10 changed files with 344 additions and 13 deletions
@@ -62,6 +62,18 @@ class ShayeganController extends Controller
return $this->sync->recordWalletGold($data);
}
public function registerCustomer($customerId)
{
if (! app(\App\Services\ConfigService::class)->isShayeganAccounting()) {
return response()->json(['ok' => false, 'message' => 'حسابداری شایگان فعال نیست'], 422);
}
$customer = \App\Models\Customer::findOrFail($customerId);
$result = $this->sync->registerCustomer($customer);
return response()->json($result, ($result['ok'] ?? false) ? 200 : 422);
}
public function table(Request $request)
{
if (! Schema::hasTable('shayegan')) {