DONE: use constant for min and max pinjaman

This commit is contained in:
ISMAIL MASSERAN
2026-09-20 16:28:01 +08:00
parent 918502b504
commit 8e19d0488a
2 changed files with 9 additions and 5 deletions
+5 -2
View File
@@ -22,6 +22,9 @@ use Illuminate\Support\Facades\Log;
class GadaianController extends Controller
{
const MIN_PINJAMAN = 5.00;
const MAX_PINJAMAN = 50000.00;
public $AliranTunaiController;
public $customerService;
@@ -242,8 +245,8 @@ class GadaianController extends Controller
$caraTerima = strtoupper((string) $request->input('cara_terima', 'TUNAI'));
$pinjamanAmt = round((float) $request->pinjaman, 2);
// Online only for RM5k–50k; otherwise force cash path.
if ($caraTerima === 'ONLINE' && ($pinjamanAmt < 5000 || $pinjamanAmt > 50000)) {
// Online only within min/max pinjaman; otherwise force cash path.
if ($caraTerima === 'ONLINE' && ($pinjamanAmt < self::MIN_PINJAMAN || $pinjamanAmt > self::MAX_PINJAMAN)) {
$caraTerima = 'TUNAI';
}