dev
Aji Kamaludin 1 year ago
parent 26483da322
commit f48e76eda0
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -2,6 +2,8 @@
## Note
- [ ] expired point
## Front
# Back Office

@ -131,6 +131,7 @@ class DepositController extends Controller
]);
$deposit->create_notification();
$deposit->create_notification_repayment();
session()->flash('message', ['type' => 'success', 'message' => 'Upload berhasil, silahkan tunggu untuk approve']);
}

@ -130,6 +130,8 @@ class PaylaterController extends Controller
$deposit->update(['payment_token' => $token]);
}
$deposit->create_notification_repayment();
$paylater->save();
DB::commit();

@ -160,6 +160,10 @@ class DepositHistory extends Model
public function create_notification()
{
if ($this->type != self::TYPE_DEPOSIT) {
return;
}
if ($this->payment_channel == Setting::PAYMENT_MANUAL) {
$status = '';
if ($this->is_valid == self::STATUS_WAIT_APPROVE) {
@ -197,6 +201,34 @@ class DepositHistory extends Model
]);
}
NotificationEvent::dispatch([
'id' => $notification->id,
'description' => $notification->description,
'url' => $notification->url,
'type' => Notification::TYPE_DEPOSIT,
'format_created_at' => now()->translatedFormat('d F Y H:i:s'),
'deposit_notifications' => Notification::where('entity_type', User::class)
->where('type', Notification::TYPE_DEPOSIT)
->where('is_read', Notification::UNREAD)->limit(10)
->orderBy('created_at', 'desc')
->get(),
]);
}
public function create_notification_repayment()
{
if ($this->type != self::TYPE_REPAYMENT) {
return;
}
$notification = Notification::create([
'entity_type' => User::class,
'description' => $this->customer->fullname . ' melakukan pembayaran hutang sebesar ' . $this->amount,
'url' => route('paylater.repay.edit', $this),
'type' => Notification::TYPE_DEPOSIT,
]);
NotificationEvent::dispatch([
'id' => $notification->id,
'description' => $notification->description,

@ -256,7 +256,7 @@ export const FormUploadCashDeposit = () => {
<img
src={`${data.image_url}`}
loading="lazy"
className="w-full h-52 mb-1"
className="w-full mb-1"
alt="bukti Pembayaran"
/>
)}

@ -232,7 +232,7 @@ export const FormUploadManual = () => {
{isEmpty(data.image_url) == false && (
<img
src={`${data.image_url}`}
className="w-full h-52 mb-1"
className="w-full mb-1"
alt="bukti transfer"
loading="lazy"
/>

Loading…
Cancel
Save