This commit is contained in:
2025-09-10 16:15:21 +05:00
parent d157c21883
commit a1521ace7a
3 changed files with 17 additions and 33 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Jobs; namespace App\Jobs;
use App\Modules\SberPaymentOrder\Models\SberPaymentOrderItem;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Foundation\Bus\Dispatchable;
@@ -25,6 +26,16 @@ class SendSberToSystem implements ShouldQueue
*/ */
public function handle(): void public function handle(): void
{ {
// $orderItem = SberPaymentOrderItem::query()
->where('paid', true)
->where('synced_with_system', false)
->whereDate('created_at', '>', '2025-09-05')
->first();
if (! $orderItem) {
return;
}
} }
} }

View File

@@ -24,10 +24,6 @@ trait NovaSberPaymentOrderAuth
return; return;
} }
// if ($user->isMe() || $user->isSuperAdmin()) {
// return;
// }
/** @var SberPaymentOrder $resource */ /** @var SberPaymentOrder $resource */
$resource = $this->resource; $resource = $this->resource;
if ($resource->user_id == auth()->id()) { if ($resource->user_id == auth()->id()) {
@@ -47,17 +43,9 @@ trait NovaSberPaymentOrderAuth
{ {
$user = auth()->user(); $user = auth()->user();
if ($user->isSystemUser()) {
return true; return true;
} }
if ($user->isMe() || $user->isSuperAdmin()) {
return true;
}
return false;
}
/** View */ /** View */
public function authorizeToView(Request $request) public function authorizeToView(Request $request)
{ {
@@ -67,10 +55,6 @@ trait NovaSberPaymentOrderAuth
return; return;
} }
if ($user->isMe() || $user->isSuperAdmin()) {
return;
}
/** @var SberPaymentOrder $resource */ /** @var SberPaymentOrder $resource */
$resource = $this->resource; $resource = $this->resource;
if ($resource->user_id == auth()->id()) { if ($resource->user_id == auth()->id()) {
@@ -89,10 +73,6 @@ trait NovaSberPaymentOrderAuth
return true; return true;
} }
if ($user->isMe() || $user->isSuperAdmin()) {
return true;
}
return false; return false;
} }
@@ -101,9 +81,6 @@ trait NovaSberPaymentOrderAuth
{ {
$user = auth()->user(); $user = auth()->user();
if ($user->isMe()) {
return;
}
if ($user->isSystemUser()) { if ($user->isSystemUser()) {
return; return;
@@ -127,10 +104,6 @@ trait NovaSberPaymentOrderAuth
return true; return true;
} }
if ($user->isMe() || $user->isSuperAdmin()) {
return true;
}
return false; return false;
} }
@@ -143,10 +116,6 @@ trait NovaSberPaymentOrderAuth
return; return;
} }
if ($user->isMe() || $user->isSuperAdmin()) {
return;
}
throw new AuthorizationException; throw new AuthorizationException;
} }

View File

@@ -15,6 +15,10 @@ return new class extends PulseMigration
return; return;
} }
Schema::dropIfExists('pulse_values');
Schema::dropIfExists('pulse_entries');
Schema::dropIfExists('pulse_aggregates');
Schema::create('pulse_values', function (Blueprint $table) { Schema::create('pulse_values', function (Blueprint $table) {
$table->id(); $table->id();
$table->unsignedInteger('timestamp'); $table->unsignedInteger('timestamp');