This commit is contained in:
2026-05-09 01:18:51 +02:00
parent 7116ee4619
commit 959970c150
132 changed files with 21310 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class EnrichmentResult extends Model
{
protected $fillable = [
'record_type',
'record_id',
'geocode_result',
'email_valid',
'credit_score',
'enriched_at',
];
protected $casts = [
'geocode_result' => 'array',
'email_valid' => 'boolean',
'enriched_at' => 'datetime',
];
}

24
app/Models/ImportJob.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ImportJob extends Model
{
protected $fillable = [
'workflow_id',
'run_id',
'type',
'file_path',
'status',
'total_records',
'processed_records',
'failed_records',
'error_log',
];
protected $casts = [
'error_log' => 'array',
];
}

28
app/Models/Order.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Order extends Model
{
protected $fillable = [
'order_number',
'customer_name',
'customer_email',
'status',
'total_amount',
'payment_id',
'tracking_number',
];
protected $casts = [
'total_amount' => 'decimal:2',
];
public function items(): HasMany
{
return $this->hasMany(OrderItem::class);
}
}

30
app/Models/OrderItem.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class OrderItem extends Model
{
protected $fillable = [
'order_id',
'product_id',
'quantity',
'unit_price',
];
protected $casts = [
'unit_price' => 'decimal:2',
];
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
public function product(): BelongsTo
{
return $this->belongsTo(Product::class);
}
}

30
app/Models/Product.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Product extends Model
{
protected $fillable = [
'sku',
'name',
'description',
'price',
'stock_quantity',
'category',
'status',
'imported_at',
];
protected $casts = [
'price' => 'decimal:2',
'imported_at' => 'datetime',
];
public function orderItems(): HasMany
{
return $this->hasMany(OrderItem::class);
}
}

48
app/Models/User.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class WebhookDelivery extends Model
{
protected $fillable = [
'workflow_id',
'endpoint',
'payload',
'status',
'attempts',
'last_error',
'delivered_at',
'dead_lettered_at',
];
protected $casts = [
'payload' => 'array',
'delivered_at' => 'datetime',
'dead_lettered_at' => 'datetime',
];
}