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 return $form
->schema([ ->schema([
Forms\Components\TextInput::make('id_asuransi')
->required()
->maxLength(255),
Forms\Components\TextInput::make('nama_asuransi') Forms\Components\TextInput::make('nama_asuransi')
->required() ->required()
->maxLength(255), ->maxLength(255),
Forms\Components\Textarea::make('keterangan')
->maxLength(255),
]); ]);
} }

View File

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

View File

@ -35,6 +35,17 @@ class MsPegawaiResource extends Resource
Forms\Components\TextInput::make('nama_pegawai') Forms\Components\TextInput::make('nama_pegawai')
->required() ->required()
->maxLength(255), ->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([ ->schema([
Forms\Components\TextInput::make('id_ruang_pelayanan') Forms\Components\TextInput::make('id_ruang_pelayanan')
->required() ->required()
->unique(
ignoreRecord: true
)
->maxLength(255), ->maxLength(255),
Forms\Components\TextInput::make('nama_ruang_pelayanan') Forms\Components\TextInput::make('nama_ruang_pelayanan')
->required() ->required()
->maxLength(255), ->maxLength(255),
Forms\Components\Textarea::make('keterangan')
->maxLength(255),
]); ]);
} }

View File

@ -32,6 +32,9 @@ class MsTindakanResource extends Resource
->schema([ ->schema([
Forms\Components\TextInput::make('id_tindakan') Forms\Components\TextInput::make('id_tindakan')
->label('ID Tindakan') ->label('ID Tindakan')
->unique(
ignoreRecord: true
)
->required() ->required()
->maxLength(255), ->maxLength(255),
Forms\Components\TextInput::make('nama_tindakan') Forms\Components\TextInput::make('nama_tindakan')
@ -43,6 +46,8 @@ class MsTindakanResource extends Resource
->numeric() ->numeric()
->required() ->required()
->prefix('Rp'), ->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->id('mr_pasien');
$table->string('nama'); $table->string('nama');
$table->string('nik')->unique(); $table->string('nik')->unique();
$table->string('no_hp'); $table->string('no_hp')->nullable();
$table->string('alamat'); $table->string('alamat')->nullable();
$table->string('email'); $table->string('email')->unique()->nullable();
$table->date('tgl_lahir'); $table->date('tgl_lahir')->nullable();
$table->enum('jenis_kelamin', ['L', 'P']); $table->enum('jenis_kelamin', ['L', 'P']);
$table->timestamps(); $table->timestamps();
}); });

View File

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

View File

@ -38,7 +38,7 @@ class TransaksiSeed extends Seeder
'id_tindakan' => $id_tindakan[array_rand($id_tindakan)], 'id_tindakan' => $id_tindakan[array_rand($id_tindakan)],
'id_pegawai' => MsPegawai::all()->random()->id_pegawai, 'id_pegawai' => MsPegawai::all()->random()->id_pegawai,
'total_harga' => $faker->randomFloat(2, 50000, 500000), 'total_harga' => $faker->randomFloat(2, 50000, 500000),
'status' => 'pending', 'status' => 'paid',
'keterangan' => $faker->sentence, 'keterangan' => $faker->sentence,
'created_at' => now(), 'created_at' => now(),
'updated_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>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>Jenis Kelamin:</strong> {{ ucfirst($record->pasien->jenis_kelamin) }}</p>
<p><strong>No Kartu Asuransi:</strong> {{ $record->registrasi->nomor_kartu_asuransi }}</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>
<div class="transaction-info"> <div class="transaction-info">