fix: any resource unitest onces siclus

This commit is contained in:
Nawcodes 2025-04-27 18:35:55 +07:00
parent 5cc5bd1938
commit 893a77917e
9 changed files with 39 additions and 15 deletions

View File

@ -29,12 +29,11 @@ class MsAsuransiResource extends Resource
{
return $form
->schema([
Forms\Components\TextInput::make('id_asuransi')
->required()
->maxLength(255),
Forms\Components\TextInput::make('nama_asuransi')
->required()
->maxLength(255),
Forms\Components\Textarea::make('keterangan')
->maxLength(255),
]);
}

View File

@ -33,7 +33,9 @@ class MsPasienResource extends Resource
Forms\Components\TextInput::make('nik')
->placeholder('Egs: 1234567890')
->required()
->unique()
->unique(
ignoreRecord: true
)
->maxLength(10),
Forms\Components\TextInput::make('nama')
->required()
@ -49,7 +51,9 @@ class MsPasienResource extends Resource
Forms\Components\Textarea::make('alamat')
->maxLength(255),
Forms\Components\TextInput::make('email')
->required()
->unique(
ignoreRecord: true
)
->maxLength(255),
Forms\Components\DatePicker::make('tgl_lahir')
]);

View File

@ -35,6 +35,17 @@ class MsPegawaiResource extends Resource
Forms\Components\TextInput::make('nama_pegawai')
->required()
->maxLength(255),
Forms\Components\TextInput::make('no_hp')
->maxLength(15),
Forms\Components\TextInput::make('email')
->unique(
ignoreRecord: true
)
->maxLength(255),
Forms\Components\TextInput::make('alamat')
->maxLength(255),
Forms\Components\TextInput::make('jabatan')
->maxLength(255),
//
]);
}

View File

@ -31,10 +31,15 @@ class MsRuangPelayananResource extends Resource
->schema([
Forms\Components\TextInput::make('id_ruang_pelayanan')
->required()
->unique(
ignoreRecord: true
)
->maxLength(255),
Forms\Components\TextInput::make('nama_ruang_pelayanan')
->required()
->maxLength(255),
Forms\Components\Textarea::make('keterangan')
->maxLength(255),
]);
}

View File

@ -32,6 +32,9 @@ class MsTindakanResource extends Resource
->schema([
Forms\Components\TextInput::make('id_tindakan')
->label('ID Tindakan')
->unique(
ignoreRecord: true
)
->required()
->maxLength(255),
Forms\Components\TextInput::make('nama_tindakan')
@ -43,6 +46,8 @@ class MsTindakanResource extends Resource
->numeric()
->required()
->prefix('Rp'),
Forms\Components\Textarea::make('keterangan')
->maxLength(255),
]);
}

View File

@ -16,10 +16,10 @@ return new class extends Migration
$table->id('mr_pasien');
$table->string('nama');
$table->string('nik')->unique();
$table->string('no_hp');
$table->string('alamat');
$table->string('email');
$table->date('tgl_lahir');
$table->string('no_hp')->nullable();
$table->string('alamat')->nullable();
$table->string('email')->unique()->nullable();
$table->date('tgl_lahir')->nullable();
$table->enum('jenis_kelamin', ['L', 'P']);
$table->timestamps();
});

View File

@ -14,10 +14,10 @@ return new class extends Migration
Schema::create('ms_pegawai', function (Blueprint $table) {
$table->string('id_pegawai')->primary();
$table->string('nama_pegawai');
$table->string('no_hp');
$table->string('email');
$table->string('alamat');
$table->string('jabatan');
$table->string('no_hp')->nullable();
$table->string('email')->unique()->nullable();
$table->string('alamat')->nullable();
$table->string('jabatan')->nullable();
$table->timestamps();
});
}

View File

@ -38,7 +38,7 @@ class TransaksiSeed extends Seeder
'id_tindakan' => $id_tindakan[array_rand($id_tindakan)],
'id_pegawai' => MsPegawai::all()->random()->id_pegawai,
'total_harga' => $faker->randomFloat(2, 50000, 500000),
'status' => 'pending',
'status' => 'paid',
'keterangan' => $faker->sentence,
'created_at' => now(),
'updated_at' => now(),

View File

@ -43,7 +43,7 @@
<p><strong>Tanggal Lahir:</strong> {{ \Carbon\Carbon::parse($record->pasien->tgl_lahir)->format('d-m-Y') }}</p>
<p><strong>Jenis Kelamin:</strong> {{ ucfirst($record->pasien->jenis_kelamin) }}</p>
<p><strong>No Kartu Asuransi:</strong> {{ $record->registrasi->nomor_kartu_asuransi }}</p>
<p><strong>Asuransi:</strong> {{ $record->registrasi->asuransi->nama_asuransi }}</p>
<p><strong>Asuransi:</strong> {{ $record->registrasi->asuransi?->nama_asuransi }}</p>
</div>
<div class="transaction-info">