DONE: use constant for min and max pinjaman
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user