Implement dark mode, bug report page, and schema dump
This commit is contained in:
@@ -20,23 +20,34 @@ class FinanceDocumentFactory extends Factory
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
$amount = $this->faker->randomFloat(2, 100, 100000);
|
||||
$requestTypes = ['expense_reimbursement', 'advance_payment', 'purchase_request', 'petty_cash'];
|
||||
$statuses = ['pending', 'approved_cashier', 'approved_accountant', 'approved_chair', 'rejected'];
|
||||
|
||||
return [
|
||||
'title' => $this->faker->sentence(6),
|
||||
'description' => $this->faker->paragraph(3),
|
||||
'amount' => $amount,
|
||||
'amount' => $this->faker->randomFloat(2, 100, 100000),
|
||||
'request_type' => $this->faker->randomElement($requestTypes),
|
||||
'status' => $this->faker->randomElement($statuses),
|
||||
'submitted_by_id' => User::factory(),
|
||||
'submitted_by_user_id' => User::factory(),
|
||||
'submitted_at' => now(),
|
||||
'amount_tier' => $this->determineAmountTier($amount),
|
||||
'requires_board_meeting' => $amount > 50000,
|
||||
'amount_tier' => null,
|
||||
'requires_board_meeting' => false,
|
||||
];
|
||||
}
|
||||
|
||||
public function configure()
|
||||
{
|
||||
return $this->afterMaking(function (FinanceDocument $document) {
|
||||
$document->amount_tier = $document->determineAmountTier();
|
||||
$document->requires_board_meeting = $document->needsBoardMeetingApproval();
|
||||
})->afterCreating(function (FinanceDocument $document) {
|
||||
$document->amount_tier = $document->determineAmountTier();
|
||||
$document->requires_board_meeting = $document->needsBoardMeetingApproval();
|
||||
$document->save();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the document is pending approval.
|
||||
*/
|
||||
@@ -54,7 +65,7 @@ class FinanceDocumentFactory extends Factory
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'status' => FinanceDocument::STATUS_APPROVED_CASHIER,
|
||||
'cashier_approved_by_id' => User::factory(),
|
||||
'approved_by_cashier_id' => User::factory(),
|
||||
'cashier_approved_at' => now(),
|
||||
]);
|
||||
}
|
||||
@@ -66,9 +77,9 @@ class FinanceDocumentFactory extends Factory
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'status' => FinanceDocument::STATUS_APPROVED_ACCOUNTANT,
|
||||
'cashier_approved_by_id' => User::factory(),
|
||||
'approved_by_cashier_id' => User::factory(),
|
||||
'cashier_approved_at' => now(),
|
||||
'accountant_approved_by_id' => User::factory(),
|
||||
'approved_by_accountant_id' => User::factory(),
|
||||
'accountant_approved_at' => now(),
|
||||
]);
|
||||
}
|
||||
@@ -80,11 +91,11 @@ class FinanceDocumentFactory extends Factory
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'status' => FinanceDocument::STATUS_APPROVED_CHAIR,
|
||||
'cashier_approved_by_id' => User::factory(),
|
||||
'approved_by_cashier_id' => User::factory(),
|
||||
'cashier_approved_at' => now(),
|
||||
'accountant_approved_by_id' => User::factory(),
|
||||
'approved_by_accountant_id' => User::factory(),
|
||||
'accountant_approved_at' => now(),
|
||||
'chair_approved_by_id' => User::factory(),
|
||||
'approved_by_chair_id' => User::factory(),
|
||||
'chair_approved_at' => now(),
|
||||
]);
|
||||
}
|
||||
@@ -120,7 +131,7 @@ class FinanceDocumentFactory extends Factory
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'amount' => $this->faker->randomFloat(2, 5000, 50000),
|
||||
'amount_tier' => 'medium',
|
||||
'amount_tier' => null,
|
||||
'requires_board_meeting' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user