Merge branch 'vapor/production' of https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0 into vapor/development

# Conflicts:
#	app/Http/Middleware/EnsureUserIsAdmin.php
This commit is contained in:
Edmond Lang
2025-07-01 12:35:43 +08:00
3 changed files with 40 additions and 7 deletions
@@ -155,12 +155,19 @@ class ExportCustomersToExcelController
$exportsTransactions = new ExportsWalletTransactions($request);
$type = $request->get('type');
$exportFileName = match ($type) {
'payment' => 'wallet-payment-transactions.xls',
'credit_note' => 'wallet-credit-note-transactions.xls',
'debit_note' => 'wallet-debit-note-transactions.xls',
default => 'wallet-topup-transactions.xls',
};
switch ($type) {
case 'payment':
$exportFileName = 'wallet-payment-transactions.xls';
break;
case 'credit_note':
$exportFileName = 'wallet-credit-note-transactions.xls';
break;
case 'debit_note':
$exportFileName = 'wallet-debit-note-transactions.xls';
break;
default:
$exportFileName = 'wallet-topup-transactions.xls';
}
$filesystemDriver = Storage::getDefaultDriver();
if ($filesystemDriver === 's3') {
@@ -171,7 +178,7 @@ class ExportCustomersToExcelController
return $response;
}
}
public function invoiceTransactions(Request $request){
$exportsTransactions = new ExportsInvoiceTransactions($request);
$exportFileName = 'invoice-transactions.xls';
@@ -22,6 +22,13 @@ class EnsureUserIsAdmin
// if(!in_array($user->type, RoleTypes::ADMIN_ROLES)){
// return response()->view('errors.503', [], 503);
// }
$maintenanceTitle = env('MAINTENANCE_MESSAGE_TITLE', null);
if (!empty($maintenanceTitle)) {
$user = JWTAuth::parseToken()->authenticate();
if(!in_array($user->type, RoleTypes::ADMIN_ROLES)){
return response()->view('errors.503', [], 503);
}
}
return $next($request);
}
}
File diff suppressed because one or more lines are too long