Add HL3D branding, Etsy Live/Draft paging and Projects lifecycle
Deploy HickLab3D Dashboard / Deploy to production (push) Failing after 23s
Deploy HickLab3D Dashboard / Deploy to production (push) Failing after 23s
Replace the old touchmark/PNG identity with the supplied lockup and monogram, segmented role-aware navigation, Live/Draft listing filters with generation-based cache invalidation, and admin Projects covering immutable file revisions, listing live pointers, and exact-decimal filament/packaging/shipping costing. Additive schema only; no Etsy publication. Isolated clone tests: 301 tests, 1162 assertions.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('projects', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->string('reference')->unique();
|
||||
$table->string('title');
|
||||
$table->text('notes')->nullable();
|
||||
$table->string('stage')->default('design');
|
||||
$table->string('currency', 3)->default('GBP');
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->timestamp('archived_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('projects');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_revisions', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('project_id')->constrained('projects')->cascadeOnDelete();
|
||||
$table->unsignedInteger('revision_number');
|
||||
$table->text('change_notes')->nullable();
|
||||
$table->string('status')->default('draft');
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->foreignId('approved_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('approved_at')->nullable();
|
||||
$table->string('fusion_project_id')->nullable();
|
||||
$table->string('fusion_document_id')->nullable();
|
||||
$table->string('fusion_version')->nullable();
|
||||
$table->timestamps();
|
||||
$table->unique(['project_id', 'revision_number']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_revisions');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_files', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('revision_id')->constrained('project_revisions')->cascadeOnDelete();
|
||||
$table->string('role');
|
||||
$table->string('original_filename');
|
||||
$table->string('storage_key')->unique();
|
||||
$table->string('extension', 16);
|
||||
$table->string('media_type');
|
||||
$table->unsignedBigInteger('byte_size');
|
||||
$table->string('sha256', 64);
|
||||
$table->foreignId('uploaded_by')->constrained('users')->restrictOnDelete();
|
||||
$table->string('printer_profile')->nullable();
|
||||
$table->string('material')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_files');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_cost_snapshots', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('project_id')->constrained('projects')->cascadeOnDelete();
|
||||
$table->foreignId('revision_id')->constrained('project_revisions')->cascadeOnDelete();
|
||||
$table->string('currency', 3);
|
||||
$table->string('basis');
|
||||
$table->unsignedInteger('batch_units');
|
||||
$table->decimal('filament_total', 14, 4)->nullable();
|
||||
$table->decimal('packaging_total', 14, 4)->nullable();
|
||||
$table->decimal('shipping_total', 14, 4)->nullable();
|
||||
$table->decimal('grand_total', 14, 4)->nullable();
|
||||
$table->string('source_reference')->nullable();
|
||||
$table->text('notes')->nullable();
|
||||
$table->foreignId('recorded_by')->constrained('users')->restrictOnDelete();
|
||||
$table->timestamp('recorded_at');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_cost_snapshots');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_cost_lines', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('cost_snapshot_id')->constrained('project_cost_snapshots')->cascadeOnDelete();
|
||||
$table->string('category');
|
||||
$table->string('description');
|
||||
$table->decimal('quantity', 12, 3);
|
||||
$table->string('quantity_unit', 16);
|
||||
$table->decimal('unit_rate', 14, 6);
|
||||
$table->decimal('waste_quantity', 12, 3)->default(0);
|
||||
$table->decimal('line_total', 14, 4);
|
||||
$table->date('source_price_date')->nullable();
|
||||
$table->string('source_reference')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_cost_lines');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_releases', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('project_id')->constrained('projects')->cascadeOnDelete();
|
||||
$table->foreignId('revision_id')->constrained('project_revisions')->restrictOnDelete();
|
||||
$table->foreignId('cost_snapshot_id')->nullable()->constrained('project_cost_snapshots')->restrictOnDelete();
|
||||
$table->string('action')->default('release');
|
||||
$table->foreignId('released_by')->constrained('users')->restrictOnDelete();
|
||||
$table->timestamp('released_at');
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_releases');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_listing_links', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('project_id')->constrained('projects')->cascadeOnDelete();
|
||||
$table->unsignedBigInteger('shop_id');
|
||||
$table->unsignedBigInteger('listing_id');
|
||||
$table->string('variation_key')->default('all');
|
||||
$table->string('title_snapshot')->nullable();
|
||||
$table->string('state_snapshot')->nullable();
|
||||
$table->timestamp('remote_updated_at')->nullable();
|
||||
$table->timestamp('synced_at')->nullable();
|
||||
$table->foreignId('live_release_id')->nullable()->constrained('project_releases')->nullOnDelete();
|
||||
$table->unsignedInteger('lock_version')->default(0);
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->timestamp('detached_at')->nullable();
|
||||
$table->timestamps();
|
||||
$table->unique(['shop_id', 'listing_id', 'variation_key']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_listing_links');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_events', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('project_id')->constrained('projects')->cascadeOnDelete();
|
||||
$table->string('event_type');
|
||||
$table->foreignId('actor_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->string('subject_type')->nullable();
|
||||
$table->unsignedBigInteger('subject_id')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamp('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_events');
|
||||
}
|
||||
};
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('project_cost_lines', function (Blueprint $table): void {
|
||||
$table->unsignedInteger('units_per_parcel')->nullable()->after('quantity_unit');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('project_cost_lines', function (Blueprint $table): void {
|
||||
$table->dropColumn('units_per_parcel');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user