Add title sections to invoices backend and frontend, #41
This commit is contained in:
@@ -8,8 +8,11 @@ class LineItemFactory extends Factory
|
||||
{
|
||||
public function definition(): array
|
||||
{
|
||||
|
||||
$isSection = rand(0, 10) > 7;
|
||||
return [
|
||||
'position' => $this->faker->numberBetween(1, 10),
|
||||
'position' => $this->faker->numberBetween(1, 10) + ($isSection ? 0.5 : 0),
|
||||
'is_section' => $isSection,
|
||||
'title' => $this->faker->words(3, true),
|
||||
'description' => $this->faker->sentence(),
|
||||
'quantity' => $this->faker->numberBetween(1, 10),
|
||||
@@ -17,4 +20,4 @@ public function definition(): array
|
||||
'price' => $this->faker->randomFloat(2, 10, 500),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ public function up(): void
|
||||
Schema::create('line_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('invoice_id')->constrained()->onDelete('cascade');
|
||||
$table->integer('position')->default(0);
|
||||
$table->decimal('position', 10, 2)->default(0);
|
||||
$table->boolean('is_section')->default(false);
|
||||
$table->string('title')->nullable();
|
||||
$table->string('description')->nullable();
|
||||
$table->integer('quantity')->default(1);
|
||||
|
||||
Reference in New Issue
Block a user