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 ## Note
- [ ] expired point
## Front ## Front
# Back Office # Back Office

@ -131,6 +131,7 @@ class DepositController extends Controller
]); ]);
$deposit->create_notification(); $deposit->create_notification();
$deposit->create_notification_repayment();
session()->flash('message', ['type' => 'success', 'message' => 'Upload berhasil, silahkan tunggu untuk approve']); 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->update(['payment_token' => $token]);
} }
$deposit->create_notification_repayment();
$paylater->save(); $paylater->save();
DB::commit(); DB::commit();

@ -160,6 +160,10 @@ class DepositHistory extends Model
public function create_notification() public function create_notification()
{ {
if ($this->type != self::TYPE_DEPOSIT) {
return;
}
if ($this->payment_channel == Setting::PAYMENT_MANUAL) { if ($this->payment_channel == Setting::PAYMENT_MANUAL) {
$status = ''; $status = '';
if ($this->is_valid == self::STATUS_WAIT_APPROVE) { 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([ NotificationEvent::dispatch([
'id' => $notification->id, 'id' => $notification->id,
'description' => $notification->description, 'description' => $notification->description,

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

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

Loading…
Cancel
Save