12-05-2026 Frontend dev
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run

This commit is contained in:
Kevin Adametz 2026-05-12 18:32:33 +02:00
parent 405df0a122
commit 5b8bdf4182
779 changed files with 480564 additions and 6241 deletions

View file

@ -0,0 +1,45 @@
<?php
namespace Database\Factories;
use App\Enums\InvoiceStatus;
use App\Models\Invoice;
use App\Models\InvoiceBillingAddress;
use App\Models\User;
use App\Models\UserPayment;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Invoice>
*/
class InvoiceFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
$amount = fake()->numberBetween(1000, 20000);
$tax = (int) round($amount * 0.19);
return [
'user_id' => User::factory(),
'user_payment_id' => UserPayment::factory(),
'invoice_billing_address_id' => InvoiceBillingAddress::factory(),
'number' => now()->format('Ym').'-'.fake()->unique()->numerify('####'),
'status' => fake()->randomElement(InvoiceStatus::cases())->value,
'amount_cents' => $amount,
'tax_cents' => $tax,
'total_cents' => $amount + $tax,
'currency' => 'EUR',
'is_netto' => false,
'invoice_date' => now()->toDateString(),
'due_date' => now()->addDays(14)->toDateString(),
'paid_at' => null,
'stripe_invoice_id' => fake()->optional()->regexify('in_[A-Za-z0-9]{14}'),
'pdf_path' => null,
];
}
}