Cocker Setup

This commit is contained in:
Kevin Adametz 2025-08-29 14:48:03 +02:00
parent 8fdaa0ba1d
commit 8c11130b5d
191 changed files with 8152 additions and 18186 deletions

View file

@ -1,29 +0,0 @@
<?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('shipments', function (Blueprint $t) {
$t->id();
$t->unsignedBigInteger('order_id')->nullable();
$t->string('carrier')->default('dhl');
$t->string('dhl_shipment_no')->nullable()->index();
$t->string('product_code')->nullable();
$t->string('billing_number')->nullable();
$t->decimal('weight_kg', 8, 3)->nullable();
$t->string('status')->default('created');
$t->string('label_format')->nullable();
$t->string('label_path')->nullable();
$t->json('meta')->nullable();
$t->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('shipments');
}
};

View file

@ -1,22 +0,0 @@
<?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('shipment_labels', function (Blueprint $t) {
$t->id();
$t->foreignId('shipment_id')->constrained('shipments')->cascadeOnDelete();
$t->string('format')->default('PDF');
$t->string('path');
$t->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('shipment_labels');
}
};

View file

@ -1,24 +0,0 @@
<?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('tracking_events', function (Blueprint $t) {
$t->id();
$t->foreignId('shipment_id')->constrained('shipments')->cascadeOnDelete();
$t->string('status_code')->nullable();
$t->string('status_text')->nullable();
$t->string('location')->nullable();
$t->timestamp('event_time')->nullable();
$t->json('raw')->nullable();
});
}
public function down(): void
{
Schema::dropIfExists('tracking_events');
}
};

View file

@ -1,22 +0,0 @@
<?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('return_labels', function (Blueprint $t) {
$t->id();
$t->unsignedBigInteger('order_id')->nullable()->index();
$t->string('dhl_return_no')->nullable()->index();
$t->string('label_path')->nullable();
$t->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('return_labels');
}
};

View file

@ -1,10 +0,0 @@
<?php
namespace Acme\Dhl\Models;
use Illuminate\Database\Eloquent\Model;
class ReturnLabel extends Model
{
protected $fillable = ['order_id', 'dhl_return_no', 'label_path'];
}

View file

@ -1,14 +0,0 @@
<?php
namespace Acme\Dhl\Models;
use Illuminate\Database\Eloquent\Model;
class ShipmentLabel extends Model
{
protected $fillable = ['shipment_id', 'format', 'path'];
public function shipment()
{
return $this->belongsTo(Shipment::class);
}
}

View file

@ -1,16 +0,0 @@
<?php
namespace Acme\Dhl\Models;
use Illuminate\Database\Eloquent\Model;
class TrackingEvent extends Model
{
public $timestamps = false;
protected $fillable = ['shipment_id', 'status_code', 'status_text', 'location', 'event_time', 'raw'];
protected $casts = ['raw' => 'array', 'event_time' => 'datetime',];
public function shipment()
{
return $this->belongsTo(Shipment::class);
}
}

View file

@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"master"
]
}