feat: enhance reconciliation job processing and reporting features
- Updated ReconcileItemIndexController to include admin user validation and improved transfer order handling. - Refactored ReconcileJobStoreController to ensure date range handling is more precise with start and end of day adjustments. - Enhanced various report controllers to include currency code in responses for better financial clarity. - Introduced new methods in AdminReconcileJobService for wallet transfer job creation and improved item scanning logic. - Added wallet lookup idempotent path configuration for integration services to enhance API interactions.
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Support\PaginationTrait;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use App\Support\AdminScopePolicy;
|
||||
use App\Support\AgentNodeApiPresenter;
|
||||
use App\Support\AdminTransferOrderCapabilities;
|
||||
use App\Support\CurrencyFormatter;
|
||||
use App\Services\Wallet\LotteryTransferService;
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -117,11 +118,6 @@ final class TransferOrderListController extends Controller
|
||||
{
|
||||
$p = $o->player;
|
||||
$amount = (int) $o->amount;
|
||||
$canWriteWallet = $admin !== null && (
|
||||
$admin->hasPermissionCode('service.wallet.adjust')
|
||||
|| $admin->hasPermissionCode('service.reconcile.manage')
|
||||
|| $admin->hasPermissionCode('service.wallet.manage')
|
||||
);
|
||||
|
||||
return [
|
||||
'id' => $o->id,
|
||||
@@ -138,16 +134,7 @@ final class TransferOrderListController extends Controller
|
||||
'amount_formatted' => CurrencyFormatter::fromMinor($amount),
|
||||
'idempotent_key' => $o->idempotent_key,
|
||||
'status' => $o->status,
|
||||
'can_reverse' => $canWriteWallet
|
||||
&& $o->status === 'pending_reconcile'
|
||||
&& ($o->direction === 'out' || $this->transferService->isEligibleForTransferInReverse($o)),
|
||||
'can_complete_credit' => $canWriteWallet
|
||||
&& $o->direction === 'in'
|
||||
&& $o->status === 'pending_reconcile'
|
||||
&& $o->fail_reason === 'lottery_credit_failed'
|
||||
&& trim((string) $o->external_ref_no) !== '',
|
||||
'can_manually_process' => $canWriteWallet
|
||||
&& $this->transferService->isEligibleForManualProcess($o),
|
||||
...AdminTransferOrderCapabilities::forOrder($o, $admin, $this->transferService),
|
||||
'external_ref_no' => $o->external_ref_no,
|
||||
'external_request_payload' => $o->external_request_payload,
|
||||
'external_response_payload' => $o->external_response_payload,
|
||||
|
||||
Reference in New Issue
Block a user