DONE: feature flags by branches

This commit is contained in:
ISMAIL MASSERAN
2026-09-08 14:48:13 +08:00
parent f58a0cf702
commit 22279af86c
9 changed files with 298 additions and 2 deletions
@@ -3,6 +3,7 @@
namespace App\Services\PembiayaanOnline;
use App\Cawangan;
use App\Feature;
use App\ModalOnline;
use App\RequestModalOnline;
use Carbon\Carbon;
@@ -208,6 +209,10 @@ class ModalOnlineService
return $resolved;
}
if (!Feature::enabled($kodcaw, Feature::PEMBIAYAAN_ONLINE)) {
return Feature::denied('Pembiayaan online tidak diaktifkan untuk cawangan ini');
}
$mysql = $resolved['mysql'];
$amaun = round((float) $amaun, 2);
@@ -294,6 +299,10 @@ class ModalOnlineService
}
$mysql = $resolved['mysql'];
if (!Feature::enabled($kodcaw, Feature::PEMBIAYAAN_ONLINE)) {
return Feature::denied('Pembiayaan online tidak diaktifkan untuk cawangan ini');
}
$amaun = round((float) $amaun, 2);
$dimohonOleh = trim((string) $dimohonOleh);
@@ -7,6 +7,7 @@ use App\Bank;
use App\BatchPembiayaanOnline;
use App\Cawangan;
use App\Customer;
use App\Feature;
use App\Gadai;
use App\PembiayaanOnline;
use Carbon\Carbon;
@@ -67,6 +68,10 @@ class PembiayaanOnlineService
}
$mysql = $resolved['mysql'];
if (!Feature::enabled($kodcaw, Feature::PEMBIAYAAN_ONLINE)) {
return Feature::denied('Pembiayaan online tidak diaktifkan untuk cawangan ini');
}
$norujukan = trim((string) ($data['norujukan'] ?? ''));
$nokp = trim((string) ($data['nokp'] ?? ''));
$pinjaman = round((float) ($data['pinjaman'] ?? 0), 2);