Merge remote-tracking branch 'origin/staging'
This commit is contained in:
@@ -80,7 +80,7 @@ class CorporateController extends Controller
|
|||||||
{
|
{
|
||||||
|
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'code' => 'required|regex:/^[a-zA-Z0-9]+$/',
|
'code' => 'required|regex:/^[a-zA-Z0-9_]+$/',
|
||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'payor_id' => 'required',
|
'payor_id' => 'required',
|
||||||
// 'logo' => 'required',
|
// 'logo' => 'required',
|
||||||
@@ -303,7 +303,7 @@ class CorporateController extends Controller
|
|||||||
public function update(Request $request, $id)
|
public function update(Request $request, $id)
|
||||||
{
|
{
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'code' => 'required|regex:/^[a-zA-Z0-9]+$/',
|
'code' => 'required|regex:/^[a-zA-Z0-9_]+$/',
|
||||||
'payor_id' => 'required',
|
'payor_id' => 'required',
|
||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'policy_code' => 'required_with:policy_id',
|
'policy_code' => 'required_with:policy_id',
|
||||||
@@ -673,6 +673,7 @@ class CorporateController extends Controller
|
|||||||
$row['prorate_lookup'], // "Prorate Lookup",
|
$row['prorate_lookup'], // "Prorate Lookup",
|
||||||
$row['max_days_for_disability'], // "Max Days for Disability",
|
$row['max_days_for_disability'], // "Max Days for Disability",
|
||||||
$row['max_period_for_disability'], // "Max Periode of Disability",
|
$row['max_period_for_disability'], // "Max Periode of Disability",
|
||||||
|
$row['limit_free_tc'], // "Currency",
|
||||||
$row['currency'], // "Currency",
|
$row['currency'], // "Currency",
|
||||||
$row['show_benefit_item'], // "Show Benefit Item",
|
$row['show_benefit_item'], // "Show Benefit Item",
|
||||||
$row['show_benefit_value'], // "Show Benefit Value",
|
$row['show_benefit_value'], // "Show Benefit Value",
|
||||||
|
|||||||
@@ -261,6 +261,27 @@ class MembershipController extends Controller
|
|||||||
return Helper::responseJson(data: MemberResource::make($member));
|
return Helper::responseJson(data: MemberResource::make($member));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function automaticLinking(Request $request)
|
||||||
|
{
|
||||||
|
$member = Member::query()
|
||||||
|
->when(in_array('email', $linkingRulesArr), function($q) use ($request) {
|
||||||
|
$q->where('email', $request->email);
|
||||||
|
})
|
||||||
|
->with([
|
||||||
|
'memberPlans' => function ($memberPlan) {
|
||||||
|
$memberPlan->latest();
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if ($member) {
|
||||||
|
$message = $member->currentPolicy->corporate->welcome_message;
|
||||||
|
return Helper::responseJson(data: MemberResource::make($member), message: $message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function removeInsurance($email)
|
public function removeInsurance($email)
|
||||||
{
|
{
|
||||||
$user = User::where('sEmail', $email)->firstOrFail();
|
$user = User::where('sEmail', $email)->firstOrFail();
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class Corporate extends Model
|
|||||||
'help_text',
|
'help_text',
|
||||||
'active',
|
'active',
|
||||||
'linking_rules',
|
'linking_rules',
|
||||||
|
'automatic_linking'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class CorporateBenefit extends Model
|
|||||||
'show_benefit_item',
|
'show_benefit_item',
|
||||||
'show_benefit_value',
|
'show_benefit_value',
|
||||||
'active',
|
'active',
|
||||||
|
'limit_free_tc',
|
||||||
'reason'
|
'reason'
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -127,6 +128,7 @@ class CorporateBenefit extends Model
|
|||||||
"Prorate Lookup" => 'prorate_lookup',
|
"Prorate Lookup" => 'prorate_lookup',
|
||||||
"Max Days for Disability" => 'max_days_for_disability',
|
"Max Days for Disability" => 'max_days_for_disability',
|
||||||
"Max Periode of Disability" => 'max_period_for_disability',
|
"Max Periode of Disability" => 'max_period_for_disability',
|
||||||
|
"Limit Free TC" => 'limit_free_tc',
|
||||||
"Currency" => 'currency',
|
"Currency" => 'currency',
|
||||||
"Show Benefit Item" => 'show_benefit_item',
|
"Show Benefit Item" => 'show_benefit_item',
|
||||||
"Show Benefit Value" => 'show_benefit_value',
|
"Show Benefit Value" => 'show_benefit_value',
|
||||||
@@ -187,6 +189,7 @@ class CorporateBenefit extends Model
|
|||||||
"Prorate Lookup",
|
"Prorate Lookup",
|
||||||
"Max Days for Disability",
|
"Max Days for Disability",
|
||||||
"Max Periode of Disability",
|
"Max Periode of Disability",
|
||||||
|
"Limit Free TC",
|
||||||
"Currency",
|
"Currency",
|
||||||
"Show Benefit Item",
|
"Show Benefit Item",
|
||||||
"Show Benefit Value",
|
"Show Benefit Value",
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?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('corporates', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->integer('automatic_linking')->after('active')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('corporates', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('automatic_linking');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?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('corporate_benefits', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
$table->integer('limit_free_tc')->after('active')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('corporate_benefits', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('limit_free_tc');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -710,6 +710,12 @@ export default function PlanList() {
|
|||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
: {row.max_period_for_disability ? row.max_period_for_disability : '-'}
|
: {row.max_period_for_disability ? row.max_period_for_disability : '-'}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid item xs={6}>
|
||||||
|
Limit Free TC
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={6}>
|
||||||
|
: {row.limit_free_tc ? row.limit_free_tc : '-'}
|
||||||
|
</Grid>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
Currency
|
Currency
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
|
|||||||
welcome_message: currentCorporate?.welcome_message || '',
|
welcome_message: currentCorporate?.welcome_message || '',
|
||||||
help_text: currentCorporate?.help_text || '',
|
help_text: currentCorporate?.help_text || '',
|
||||||
active: currentCorporate?.id ? currentCorporate?.active === 1 : true,
|
active: currentCorporate?.id ? currentCorporate?.active === 1 : true,
|
||||||
|
automatic_linking: currentCorporate?.id ? currentCorporate?.automatic_linking === 1 : true,
|
||||||
policy_id: currentCorporate?.current_policy?.id || '',
|
policy_id: currentCorporate?.current_policy?.id || '',
|
||||||
policy_code: currentCorporate?.current_policy?.code || '',
|
policy_code: currentCorporate?.current_policy?.code || '',
|
||||||
policy_total_premi: currentCorporate?.current_policy?.total_premi || 0,
|
policy_total_premi: currentCorporate?.current_policy?.total_premi || 0,
|
||||||
@@ -303,6 +304,7 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
|
|||||||
formData.append('name', data.name);
|
formData.append('name', data.name);
|
||||||
formData.append('code', data.code);
|
formData.append('code', data.code);
|
||||||
formData.append('active', data.active ? '1' : '0');
|
formData.append('active', data.active ? '1' : '0');
|
||||||
|
formData.append('automatic_linking', data.automatic_linking ? 1 : 0);
|
||||||
formData.append('type', data.type);
|
formData.append('type', data.type);
|
||||||
formData.append('welcome_message', data.welcome_message);
|
formData.append('welcome_message', data.welcome_message);
|
||||||
formData.append('reason', data.reason);
|
formData.append('reason', data.reason);
|
||||||
@@ -430,6 +432,10 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
|
|||||||
value: 'member_id',
|
value: 'member_id',
|
||||||
label: 'Member ID',
|
label: 'Member ID',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: 'policy_code',
|
||||||
|
label: 'Policy Number',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
value: 'phone',
|
value: 'phone',
|
||||||
label: 'Nomor Telepon',
|
label: 'Nomor Telepon',
|
||||||
@@ -571,6 +577,8 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
|
|||||||
<Card sx={{ p: 3 }}>
|
<Card sx={{ p: 3 }}>
|
||||||
{JSON.stringify(values.active)}
|
{JSON.stringify(values.active)}
|
||||||
<RHFSwitch name="active" label="Is Company Active" />
|
<RHFSwitch name="active" label="Is Company Active" />
|
||||||
|
{JSON.stringify(values.automatic_linking)}
|
||||||
|
<RHFSwitch name="automatic_linking" label="Is Company Automatic Linking" />
|
||||||
<Stack spacing={3} mt={2} alignItems="center">
|
<Stack spacing={3} mt={2} alignItems="center">
|
||||||
<Typography align="center">Company Logo</Typography>
|
<Typography align="center">Company Logo</Typography>
|
||||||
{/* <RHFUploadAvatar
|
{/* <RHFUploadAvatar
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user