akun dibekukan

dev
Aji Kamaludin 1 year ago
parent 07eb68c042
commit 3123971f2b
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -3,7 +3,7 @@
## Note
[x] Kerjakan dulu semua yang terkait penjualan normal, deposit normal dan bonus poin transaksi dan downline
[ ] setelah itu baru penukaran voucher -> sedang ngerjain ini
[x] setelah itu baru penukaran voucher -> sedang ngerjain ini
[ ] baru setelah itu yang berhubungan dengan mitrawbb dan hutang
## Front
@ -11,7 +11,8 @@
- [x] transaksi pembelian
- [x] transaksi pembelian + dapat poin downline
- [x] [BUG] pembelian voucher lebih dari 1 mendapat kode yang sama
- [ ] penuakaran voucher
- [x] penuakaran voucher
- [x] akun dibekukan tidak dapat melakukan transaksi
- [x] tambah metode topup deposit dengan setor tunai kantor wbb
- [x] mengubah metode pembayaran deposit dengan daftar bank seperti deposit dan tampil logo bank
- [x] tampilan keranjang jadi lebih seperti tokped dengan metode pembayaran deposit atau hutang jika tersedia

@ -54,6 +54,12 @@ class CartController extends Controller
$operator = $request->param ?? 'add'; //delete, sub, add
$customer = $request->user('customer');
if (!$customer->allow_transaction) {
$customer->carts()->delete();
return redirect()->back()
->with('message', ['type' => 'error', 'message' => 'akun anda dibekukan tidak dapat melakukan transaksi',]);
}
$item = $customer->carts()->where(['entity_id' => $profile->id])->first();
if ($item !== null) {
if ($operator == 'delete') {

@ -41,8 +41,14 @@ class DepositController extends Controller
]);
}
public function create()
public function create(Request $request)
{
$customer = $request->user('customer');
if (!$customer->allow_transaction) {
return redirect()->back()
->with('message', ['type' => 'error', 'message' => 'akun anda dibekukan tidak dapat melakukan transaksi',]);
}
return inertia('Deposit/Topup', [
'payments' => GeneralService::getEnablePayment(),
]);

@ -62,8 +62,14 @@ class PoinExchangeController extends Controller
]);
}
public function exchange(LocationProfile $profile)
public function exchange(Request $request, LocationProfile $profile)
{
$customer = $request->user('customer');
if (!$customer->allow_transaction) {
return redirect()->back()
->with('message', ['type' => 'error', 'message' => 'akun anda dibekukan tidak dapat melakukan transaksi',]);
}
$batchCount = $profile->count_unsold();
if ($batchCount < 1) {
return redirect()->route('customer.poin.exchange')

@ -221,6 +221,16 @@ class Customer extends Authenticatable
});
}
public function allowTransaction(): Attribute
{
return Attribute::make(get: function () {
if ($this->status == self::STATUS_SUSPEND) {
return false;
}
return true;
});
}
public function level()
{
return $this->belongsTo(CustomerLevel::class, 'customer_level_id');

@ -12,6 +12,7 @@ import { useModalState } from '@/hooks'
import CustomerLayout from '@/Layouts/CustomerLayout'
import ModalConfirm from '@/Components/ModalConfirm'
import BalanceBanner from '../Index/Partials/BalanceBanner'
import { STATUS_SUSPEND } from '@/constant'
export default function Index({
auth: { user },
@ -84,21 +85,37 @@ export default function Index({
{/* saldo */}
<BalanceBanner user={user} />
</div>
<div className="p-4 pb-0">
<div
className="p-4 text-blue-800 rounded-lg bg-blue-50 flex flex-row space-x-2 w-full items-center"
role="alert"
onClick={() =>
handleReferalCopyToClipboard(user.referral_code)
}
>
<div>Referral Code: </div>
<div className="font-bold">{user.referral_code}</div>
<div>
<HiClipboardDocumentList className="text-blue-600" />
{user.status === STATUS_SUSPEND ? (
<div className="p-4 pb-0">
<div
className="font-semibold p-4 text-red-800 rounded-lg bg-red-50 flex flex-row space-x-2 w-full items-center"
role="alert"
>
<div>
Akun sedang dibekukan / suspend tidak dapat
melakukan transaksi
</div>
</div>
</div>
</div>
) : (
<div className="p-4 pb-0">
<div
className="p-4 text-blue-800 rounded-lg bg-blue-50 flex flex-row space-x-2 w-full items-center"
role="alert"
onClick={() =>
handleReferalCopyToClipboard(user.referral_code)
}
>
<div>Referral Code: </div>
<div className="font-bold">
{user.referral_code}
</div>
<div>
<HiClipboardDocumentList className="text-blue-600" />
</div>
</div>
</div>
)}
<div className="p-4 flex flex-col">
{user.is_allow_paylater && (
<div

@ -21,3 +21,5 @@ export const PAYED_WITH_DEPOSIT = 'deposit'
export const PAYED_WITH_PAYLATER = 'paylater'
export const PAYED_WITH_POIN = 'poin'
export const STATUS_SUSPEND = 2

Loading…
Cancel
Save