Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -78,6 +78,7 @@ class MemberController extends Controller
|
||||
->leftJoin('plans', 'plans.id', '=', 'member_plans.plan_id')
|
||||
->leftJoin('services', 'services.code', '=', 'plans.service_code')
|
||||
->where('member_plans.member_id', $members->id)
|
||||
->whereNull('member_plans.deleted_at')
|
||||
->select('plans.service_code', 'services.name')
|
||||
->get();
|
||||
$res_data['services'] = $services;
|
||||
|
||||
@@ -13,12 +13,12 @@ use Illuminate\Support\Facades\DB;
|
||||
|
||||
class NotificationController extends Controller
|
||||
{
|
||||
public function getNotifications(Request $request, $hospital_id)
|
||||
public function getNotifications(Request $request, $user_id)
|
||||
{
|
||||
$data = [
|
||||
'hospital_id' => $hospital_id,
|
||||
'user_id' => $user_id,
|
||||
];
|
||||
if (!$hospital_id)
|
||||
if (!$user_id)
|
||||
{
|
||||
return ApiResponse::apiResponse('Not Found', $data, trans('Message.not_found'), 404);
|
||||
}
|
||||
@@ -36,7 +36,8 @@ class NotificationController extends Controller
|
||||
DB::raw('DATE_FORMAT(notifications.created_at, "%Y-%m-%dT%H:%i:%s.000+07:00") as createdAt'),
|
||||
'notifications.isUnRead',
|
||||
)
|
||||
->where('hospital_id', '=', $hospital_id)
|
||||
->where('user_id', '=', $user_id)
|
||||
->orderBy('id', 'DESC')
|
||||
->get();
|
||||
$res_data['notifications'] = $notifications;
|
||||
return ApiResponse::apiResponse("Success", $res_data, trans('Message.success'), 200);
|
||||
@@ -50,15 +51,15 @@ class NotificationController extends Controller
|
||||
public function setReadNotification(Request $request)
|
||||
{
|
||||
$data = [
|
||||
'hospital_id' => $request->hospital_id,
|
||||
'user_id' => $request->user_id,
|
||||
'id' => $request->id,
|
||||
'isUnRead'=> 0,
|
||||
];
|
||||
$validator = Validator::make($request->all(), [
|
||||
'hospital_id' => 'required',
|
||||
'user_id' => 'required',
|
||||
'id' => 'required'
|
||||
], [
|
||||
'hospital_id.required' => trans('Validation.required',['attribute' => 'Hospital ID']),
|
||||
'user_id.required' => trans('Validation.required',['attribute' => 'Hospital ID']),
|
||||
'id.required' => trans('Validation.required',['attribute' => 'ID']),
|
||||
]);
|
||||
if ($validator->fails())
|
||||
|
||||
@@ -12,6 +12,7 @@ use App\Helpers\Helper;
|
||||
use App\Models\File;
|
||||
use Dompdf\Dompdf;
|
||||
use Dompdf\Options;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class RequestLogController extends Controller
|
||||
{
|
||||
@@ -107,6 +108,33 @@ class RequestLogController extends Controller
|
||||
|
||||
if($response->original['statusCode'] == 200)
|
||||
{
|
||||
//send email
|
||||
// Insert data notifications
|
||||
$emailTo = 'alarm.center@linksehat.com';
|
||||
$dataNotif = [
|
||||
'email' => $emailTo,
|
||||
'title' => 'Request LOG',
|
||||
'description' => 'Request LOG from Hospital Portal',
|
||||
'type' => 1,
|
||||
'isUnRead' => true,
|
||||
'created_by' => auth()->user()->id,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
$sendNotif = Helper::insertNotification($dataNotif);
|
||||
// Send Email after insert notifications
|
||||
if($sendNotif)
|
||||
{
|
||||
//send to alarm
|
||||
$nameTo = 'Admin LinkSehat';
|
||||
$dataEmail = [
|
||||
'email' => $emailTo,
|
||||
'name' => $nameTo,
|
||||
'subject' => 'Request LOG from Hospital Portal'. ' '.date('Y-m-d H:i:s'),
|
||||
'body' => View::make('email/notif_email', ['name' => $nameTo, 'link' => 'https://primecenter.linksehat.com/'])->render(),
|
||||
];
|
||||
Helper::sendEmail($dataEmail);
|
||||
}
|
||||
return ApiResponse::apiResponse("Success", $data, trans('Message.success'), 200);
|
||||
}
|
||||
else
|
||||
@@ -352,6 +380,33 @@ class RequestLogController extends Controller
|
||||
}
|
||||
}
|
||||
DB::commit();
|
||||
//send email
|
||||
// Insert data notifications
|
||||
$emailTo = 'alarm.center@linksehat.com';
|
||||
$dataNotif = [
|
||||
'email' => $emailTo,
|
||||
'title' => 'Request Final LOG',
|
||||
'description' => 'Request Final LOG from Hospital Portal',
|
||||
'type' => 1,
|
||||
'isUnRead' => true,
|
||||
'created_by' => auth()->user()->id,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
$sendNotif = Helper::insertNotification($dataNotif);
|
||||
// Send Email after insert notifications
|
||||
if($sendNotif)
|
||||
{
|
||||
//send to alarm
|
||||
$nameTo = 'Admin LinkSehat';
|
||||
$dataEmail = [
|
||||
'email' => $emailTo,
|
||||
'name' => $nameTo,
|
||||
'subject' => 'Request Final LOG from Hospital Portal'. ' '.date('Y-m-d H:i:s'),
|
||||
'body' => View::make('email/notif_email', ['name' => $nameTo, 'link' => 'https://primecenter.linksehat.com/'])->render(),
|
||||
];
|
||||
Helper::sendEmail($dataEmail);
|
||||
}
|
||||
return ApiResponse::apiResponse('Success', $data, trans('Message.success'), 200);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
@@ -370,6 +425,7 @@ class RequestLogController extends Controller
|
||||
$dataMember = DB::table('members')
|
||||
->where('members.id', '=', $dataRequestLog->member_id)
|
||||
->select(
|
||||
'members.nric',
|
||||
'members.id',
|
||||
'members.principal_id',
|
||||
'members.name',
|
||||
@@ -517,6 +573,7 @@ class RequestLogController extends Controller
|
||||
$dataMember = DB::table('members')
|
||||
->where('members.id', '=', $dataRequestLog->member_id)
|
||||
->select(
|
||||
'members.nric',
|
||||
'members.id',
|
||||
'members.principal_id',
|
||||
'members.name',
|
||||
|
||||
@@ -60,7 +60,7 @@ Route::prefix('v1')->group(function() {
|
||||
//Notification
|
||||
Route::controller(NotificationController::class)->group(function() {
|
||||
//get notifications
|
||||
Route::get('notifications/{hospital_id}', 'getNotifications');
|
||||
Route::get('notifications/{user_id}', 'getNotifications');
|
||||
//Set read notification
|
||||
Route::post('set-read-notification', 'setReadNotification');
|
||||
});
|
||||
|
||||
@@ -977,8 +977,9 @@ class ClaimController extends Controller
|
||||
public function sendNotif($description)
|
||||
{
|
||||
// Insert data notifications
|
||||
$emailTo = 'hospitaladmin@linksehat.com';
|
||||
$dataNotif = [
|
||||
'hospital_id' => 1,
|
||||
'email' => $emailTo,
|
||||
'title' => 'Request Document',
|
||||
'description' => 'Please enter the document '.$description,
|
||||
'type' => 1,
|
||||
@@ -991,12 +992,12 @@ class ClaimController extends Controller
|
||||
// Send Email after insert notifications
|
||||
if($sendNotif)
|
||||
{
|
||||
//Beluma ada Data Users
|
||||
$nameTo = 'Hospital Admin';
|
||||
$dataEmail = [
|
||||
'email' => 'akun.kerja.ivan@gmail.com',
|
||||
'name' => 'Ivan Julian',
|
||||
'email' => $emailTo,
|
||||
'name' => $nameTo,
|
||||
'subject' => 'Enter Document '.$description,
|
||||
'body' => View::make('email/notif_email', ['name' => 'Ivan Julian', 'link' => 'https://linkmedis.com/chat'])->render(),
|
||||
'body' => View::make('email/notif_email', ['name' => $nameTo, 'link' => 'https://hospitalportal.linksehat.com/dashboard'])->render(),
|
||||
];
|
||||
Helper::sendEmail($dataEmail);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('notifications', function (Blueprint $table) {
|
||||
// Ubah nama field hospital_id ke user_id dan izinkan nilai null
|
||||
$table->renameColumn('hospital_id', 'user_id')->nullable();
|
||||
|
||||
// Tambahkan field email setelah user_id
|
||||
$table->string('email')->after('hospital_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('notifications', function (Blueprint $table) {
|
||||
// Rollback migrasi dengan mengembalikan nama field ke semula
|
||||
$table->renameColumn('user_id', 'hospital_id');
|
||||
|
||||
// Hapus field email
|
||||
$table->dropColumn('email');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -86,7 +86,7 @@ export default function DialogConfirmation({requestLog, setOpenDialog, openDialo
|
||||
const resetForm = () => {
|
||||
setFormData({
|
||||
status: approve,
|
||||
no_identitas: '',
|
||||
no_identitas: requestLog?.no_identitas ?? '',
|
||||
keterangan: '',
|
||||
hak_kamar_pasien: '',
|
||||
penempatan_kamar: '',
|
||||
|
||||
@@ -38,5 +38,7 @@
|
||||
"txtAddNew" : "Add New",
|
||||
"txtAddress" : "Address",
|
||||
"txtProvider": "Provider",
|
||||
"txtAlertProvider" : "Please enter provider"
|
||||
"txtAlertProvider" : "Please enter provider",
|
||||
"txtHelp" : "Need help?",
|
||||
"txtContactUs" : "Contact Us"
|
||||
}
|
||||
|
||||
@@ -30,13 +30,15 @@
|
||||
"txtSubmissionDate" : "Tanggal Pengajuan",
|
||||
"txtDataNotFound" : "Data Tidak Ditemukan",
|
||||
"txtConditionDocument" : "Dokumen Kondisi",
|
||||
"txtDiagnosisDokument" : "Dokumen Diagnosa",
|
||||
"txtSupportingResultDocument" : "Dokumen Hasil Pendukung",
|
||||
"txtDiagnosisDokument" : "Dokumen Diagnosis",
|
||||
"txtSupportingResultDocument" : "Dokumen Pendukung",
|
||||
"txtAddResult" : "Tambah Hasil",
|
||||
"txtServiceType" : "Tipe Layanan",
|
||||
"txtAdditionalDocuments" : "Dokumen Tambahan",
|
||||
"txtAddNew" : "Tambah Baru",
|
||||
"txtAddress" : "Alamat",
|
||||
"txtProvider": "Provider",
|
||||
"txtAlertProvider" : "Mohon masukan provider"
|
||||
"txtAlertProvider" : "Mohon masukan provider",
|
||||
"txtHelp" : "Butuh Bantuan?",
|
||||
"txtContactUs" : "Kontak Kami"
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ function NotificationItem({ notification, getDataNotifications }: { notification
|
||||
const {enqueueSnackbar} = useSnackbar();
|
||||
const handleClick = () => {
|
||||
const data = {
|
||||
'hospital_id' : 1,
|
||||
'user_id' : 1,
|
||||
'id' : notification.id,
|
||||
};
|
||||
if(notification.isUnRead)
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
// @mui
|
||||
import { Stack, Button, Typography } from '@mui/material';
|
||||
import { Stack,Link, Button, Typography } from '@mui/material';
|
||||
// assets
|
||||
import { DocIllustration } from '@/assets';
|
||||
import { Link as RouterLink } from "react-router-dom";
|
||||
|
||||
import { LanguageContext } from '@/contexts/LanguageContext';
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export default function NavbarDocs() {
|
||||
const { localeData }: any = useContext(LanguageContext);
|
||||
const handleClick = () => {
|
||||
window.location.href = 'https://wa.me/6285890008500';
|
||||
};
|
||||
@@ -15,7 +20,7 @@ export default function NavbarDocs() {
|
||||
spacing={3}
|
||||
sx={{ px: 5, pb: 5, mt: 10, width: 1, textAlign: 'center', display: 'block' }}
|
||||
>
|
||||
<DocIllustration sx={{ width: 1 }} />
|
||||
{/* <DocIllustration sx={{ width: 1 }} />
|
||||
|
||||
<div>
|
||||
<Typography gutterBottom variant="subtitle1">
|
||||
@@ -28,7 +33,18 @@ export default function NavbarDocs() {
|
||||
</div>
|
||||
|
||||
<Button variant="contained" onClick={handleClick}>WhatsApp</Button>
|
||||
<Typography variant='body2'>Hak Cipta © 2023 - 2024 LinkSehat</Typography>
|
||||
<Typography variant='body2'>Hak Cipta © 2023 - 2024 LinkSehat</Typography> */}
|
||||
<Typography variant="body2" >
|
||||
{localeData.txtHelp} {""}
|
||||
<Link
|
||||
variant="subtitle2"
|
||||
component={RouterLink}
|
||||
to="#"
|
||||
onClick={handleClick}
|
||||
>
|
||||
{localeData.txtContactUs}
|
||||
</Link>
|
||||
</Typography>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -116,14 +116,16 @@ export default function Login() {
|
||||
/>
|
||||
</SectionStyle>
|
||||
)} */}
|
||||
|
||||
|
||||
<Container maxWidth="sm">
|
||||
<ContentStyle>
|
||||
<Card sx={{padding:2}}>
|
||||
<Stack
|
||||
direction="row"
|
||||
alignItems="center"
|
||||
sx={{ mb: 5 }}
|
||||
>
|
||||
|
||||
<Logo sx={{ width: 90, height: 90 }} />
|
||||
<Box sx={{ flexGrow: 1 }}>
|
||||
<Typography variant="h4" gutterBottom>
|
||||
@@ -149,6 +151,7 @@ export default function Login() {
|
||||
</Stack>
|
||||
|
||||
<LoginForm />
|
||||
</Card>
|
||||
|
||||
{/*{false && !smUp && (
|
||||
<Typography
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
<tr>
|
||||
<td>Identitas Peserta</td>
|
||||
<td>:</td>
|
||||
<td>{{ $dataMember->nik }}</td>
|
||||
<td>{{ $dataMember->nric }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hak Kamar Pasien</td>
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
<tr>
|
||||
<td>Identitas Peserta</td>
|
||||
<td>:</td>
|
||||
<td>{{ $dataMember->nik }}</td>
|
||||
<td>{{ $dataMember->nric }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Hak Kamar Pasien</td>
|
||||
|
||||
Reference in New Issue
Block a user