feat(shayegan): per-product item code and auto customer Account/Put
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user