tambah field untuk phone number perusahaan, phone alarm center dan deskripsi alarm center

This commit is contained in:
2024-07-09 09:24:48 +07:00
parent dc4bc41864
commit 59efa4a140
4 changed files with 65 additions and 1 deletions

View File

@@ -23,7 +23,10 @@ class Corporate extends Model
'help_text',
'active',
'linking_rules',
'automatic_linking'
'automatic_linking',
'phone',
'phone_alarm_canter',
'description_information',
];
protected $casts = [

View File

@@ -0,0 +1,36 @@
<?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->string('phone')->nullable();
$table->string('phone_alarm_canter')->nullable();
$table->text('description_information')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('corporates', function (Blueprint $table) {
$table->dropColumn('phone');
$table->dropColumn('phone_alarm_canter');
$table->dropColumn('description_information');
});
}
};

View File

@@ -16,6 +16,12 @@ export type Corporate = {
corporate_plans_count: number;
corporate_benefits_count: number;
employees_count: number;
phone: string;
phone_alarm_canter: string;
description_information: string;
linking_rules: string;
reason: string;
automatic_linking: number;
};

View File

@@ -254,6 +254,9 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
linking_rules: currentCorporate?.linking_rules || ['nric', 'nik', 'member_id'],
type: currentCorporate?.type || 'corporate',
logo: currentCorporate?.logo || '',
phone: currentCorporate?.phone || '',
phone_alarm_canter: currentCorporate?.phone_alarm_canter || '',
description_information: currentCorporate?.description_information || '',
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[currentCorporate]
@@ -327,6 +330,9 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
formData.append('policy_start', fPostFormat(data.policy_start));
formData.append('policy_end', fPostFormat(data.policy_end));
formData.append('linking_rules', data.linking_rules);
formData.append('description_information', data.description_information);
formData.append('phone', data.phone);
formData.append('phone_alarm_canter', data.phone_alarm_canter);
// console.log('MOTHERFUCKER', data.linking_rules)
@@ -532,6 +538,12 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
<Typography variant='subtitle1' color="#637381">Corporate Name*</Typography>
<RHFTextField name="name" label="Corporate Name" disabled={isDisabled} />
<Typography variant='subtitle1' color="#637381">Corporate Phone</Typography>
<RHFTextField name="phone" label="Corporate Phone" />
<Typography variant='subtitle1' color="#637381">Alarm Center Phone</Typography>
<RHFTextField name="phone_alarm_canter" label="Alarm Center Phone" />
<Typography variant='subtitle1' color="#637381">Payor ID*</Typography>
<RHFTextField name="payor_id" label="Payor ID" disabled={isDisabled} />
@@ -560,6 +572,13 @@ export default function CorporateForm({ isEdit, currentCorporate }: Props) {
<RHFEditor name="help_text" />
</Stack>
<Stack spacing={1}>
<Typography variant="subtitle1" color="#637381">
Description Letter of Guarantee
</Typography>
<RHFEditor name="description_information" />
</Stack>
{/* <div>
<LabelStyle>Images</LabelStyle>
<RHFUploadMultiFile