- Implemented routes for managing payroll periods, including current, close, and reopen functionalities. - Added payroll payment and cancellation routes. - Introduced payroll adjustments with store and delete functionalities. - Created comprehensive feature tests for payroll management, covering authentication, CRUD operations, and business logic. - Ensured proper handling of payroll adjustments and their impact on payroll totals. - Developed tests for generating payrolls and managing payroll periods, ensuring accurate status transitions and data integrity.
24 lines
624 B
PHP
24 lines
624 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Attendance;
|
|
use App\Models\Payroll;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class PayrollAdjustmentFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'payroll_id' => Payroll::factory(),
|
|
'attendance_id' => Attendance::factory(),
|
|
'created_by_id' => User::factory(),
|
|
'type' => fake()->randomElement(['bonus', 'deduction']),
|
|
'amount' => fake()->numberBetween(10000, 500000),
|
|
'description' => fake()->sentence(),
|
|
];
|
|
}
|
|
}
|