Sync deploy mirror and upstream error page
This commit is contained in:
43
.deploy/artwork-evolution-release/app/Models/UploadBatch.php
Normal file
43
.deploy/artwork-evolution-release/app/Models/UploadBatch.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
final class UploadBatch extends Model
|
||||
{
|
||||
public const STATUS_UPLOADING = 'uploading';
|
||||
public const STATUS_PROCESSING = 'processing';
|
||||
public const STATUS_COMPLETED = 'completed';
|
||||
public const STATUS_COMPLETED_WITH_ERRORS = 'completed_with_errors';
|
||||
public const STATUS_CANCELLED = 'cancelled';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'name',
|
||||
'status',
|
||||
'total_items',
|
||||
'processed_items',
|
||||
'failed_items',
|
||||
'published_items',
|
||||
'defaults_json',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'defaults_json' => 'array',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function items(): HasMany
|
||||
{
|
||||
return $this->hasMany(UploadBatchItem::class)->orderBy('id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
final class UploadBatchItem extends Model
|
||||
{
|
||||
public const STATUS_UPLOADED = 'uploaded';
|
||||
public const STATUS_PROCESSING = 'processing';
|
||||
public const STATUS_NEEDS_METADATA = 'needs_metadata';
|
||||
public const STATUS_NEEDS_REVIEW = 'needs_review';
|
||||
public const STATUS_READY = 'ready';
|
||||
public const STATUS_FAILED = 'failed';
|
||||
public const STATUS_PUBLISHED = 'published';
|
||||
public const STATUS_DELETED = 'deleted';
|
||||
|
||||
public const STAGE_QUEUED = 'queued';
|
||||
public const STAGE_STORED = 'stored';
|
||||
public const STAGE_THUMBNAILS = 'thumbnails';
|
||||
public const STAGE_VISION_ANALYSIS = 'vision_analysis';
|
||||
public const STAGE_MATURITY_CHECK = 'maturity_check';
|
||||
public const STAGE_METADATA_SUGGESTIONS = 'metadata_suggestions';
|
||||
public const STAGE_FINALIZED = 'finalized';
|
||||
|
||||
protected $fillable = [
|
||||
'upload_batch_id',
|
||||
'user_id',
|
||||
'artwork_id',
|
||||
'original_filename',
|
||||
'status',
|
||||
'processing_stage',
|
||||
'error_code',
|
||||
'error_message',
|
||||
'metadata_completeness',
|
||||
'is_ready_to_publish',
|
||||
'uploaded_at',
|
||||
'processed_at',
|
||||
'published_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_ready_to_publish' => 'boolean',
|
||||
'uploaded_at' => 'datetime',
|
||||
'processed_at' => 'datetime',
|
||||
'published_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function batch(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(UploadBatch::class, 'upload_batch_id');
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function artwork(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Artwork::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user