feat: pindah route ke /dashboard, tambah seeders, business rules via observers, action verifikasi & approval

This commit is contained in:
2026-04-03 04:34:21 +07:00
parent 8675c14f15
commit d42b23f604
12 changed files with 355 additions and 16 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace Database\Seeders;
use App\Models\CashCategory;
use App\Models\CashRecord;
use App\Models\User;
use Illuminate\Database\Seeder;
class CashSeeder extends Seeder
{
public function run(): void
{
$pemasukan = CashCategory::firstOrCreate(['name' => 'pemasukan']);
$pengeluaran = CashCategory::firstOrCreate(['name' => 'pengeluaran']);
$bendahara = User::role('bendahara')->first();
$ketua = User::role('ketua')->first();
$records = [
['category_id' => $pemasukan->id, 'amount' => 500000, 'description' => 'Iuran anggota bulan Januari', 'date' => now()->subMonths(2)],
['category_id' => $pemasukan->id, 'amount' => 500000, 'description' => 'Iuran anggota bulan Februari', 'date' => now()->subMonth()],
['category_id' => $pemasukan->id, 'amount' => 1000000, 'description' => 'Donasi kegiatan kerja bakti', 'date' => now()->subDays(20)],
['category_id' => $pengeluaran->id, 'amount' => 250000, 'description' => 'Pembelian alat kebersihan', 'date' => now()->subDays(18)],
['category_id' => $pengeluaran->id, 'amount' => 150000, 'description' => 'Konsumsi rapat bulanan', 'date' => now()->subDays(5)],
];
foreach ($records as $data) {
CashRecord::create(array_merge($data, [
'created_by' => $bendahara?->id,
'verified_by' => $ketua?->id,
'verified_at' => now()->subDays(1),
]));
}
}
}