Let a service unit use stock and machines

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-26 16:01:59 +02:00
co-authored by Claude Sonnet 5.5
parent d160854b79
commit 361a2974cf
16 changed files with 204 additions and 13 deletions
@@ -25,6 +25,11 @@ class ServiceUnitFactory extends Factory
];
}
public function usingStock(): static
{
return $this->state(fn (): array => ['uses_stock' => true]);
}
public function inactive(): static
{
return $this->state(fn (): array => ['is_active' => false]);
@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Whether stock and machine features are used in a service unit
* (spec 19: "Varaston ja koneiden käyttö").
*/
public function up(): void
{
Schema::table('service_units', function (Blueprint $table) {
$table->boolean('uses_stock')->default(false)->after('is_shared');
});
}
public function down(): void
{
Schema::table('service_units', function (Blueprint $table) {
$table->dropColumn('uses_stock');
});
}
};