Add membership fee system with disability discount and fix document permissions
Features: - Implement two fee types: entrance fee and annual fee (both NT$1,000) - Add 50% discount for disability certificate holders - Add disability certificate upload in member profile - Integrate disability verification into cashier approval workflow - Add membership fee settings in system admin Document permissions: - Fix hard-coded role logic in Document model - Use permission-based authorization instead of role checks Additional features: - Add announcements, general ledger, and trial balance modules - Add income management and accounting entries - Add comprehensive test suite with factories - Update UI translations to Traditional Chinese 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
40
database/factories/AuditLogFactory.php
Normal file
40
database/factories/AuditLogFactory.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\AuditLog;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class AuditLogFactory extends Factory
|
||||
{
|
||||
protected $model = AuditLog::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => User::factory(),
|
||||
'action' => $this->faker->randomElement([
|
||||
'member_created',
|
||||
'member_status_changed',
|
||||
'payment_approved',
|
||||
'payment_rejected',
|
||||
'finance_document_created',
|
||||
'finance_document_approved',
|
||||
'user_login',
|
||||
'role_assigned',
|
||||
]),
|
||||
'auditable_type' => $this->faker->randomElement([
|
||||
'App\Models\Member',
|
||||
'App\Models\MembershipPayment',
|
||||
'App\Models\FinanceDocument',
|
||||
'App\Models\User',
|
||||
]),
|
||||
'auditable_id' => $this->faker->numberBetween(1, 100),
|
||||
'metadata' => [
|
||||
'ip_address' => $this->faker->ipv4(),
|
||||
'user_agent' => $this->faker->userAgent(),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user