Initial Ladill Hosting app with Gitea deploy pipeline.
Deploy Ladill Hosting / deploy (push) Failing after 17s
Deploy Ladill Hosting / deploy (push) Failing after 17s
Shared web hosting extracted from the platform monolith, with CI deploy to /var/www/ladill-hosting matching Bird/Domains/Email. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
class HostingPlanChange extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public const DIRECTION_UPGRADE = 'upgrade';
|
||||
public const DIRECTION_DOWNGRADE = 'downgrade';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'hosting_account_id',
|
||||
'from_hosting_product_id',
|
||||
'to_hosting_product_id',
|
||||
'direction',
|
||||
'billing_cycle',
|
||||
'cycle_months',
|
||||
'remaining_days',
|
||||
'proration_ratio',
|
||||
'old_cycle_price',
|
||||
'new_cycle_price',
|
||||
'charge_amount',
|
||||
'credit_amount',
|
||||
'net_amount',
|
||||
'currency',
|
||||
'status',
|
||||
'applied_at',
|
||||
'metadata',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'cycle_months' => 'integer',
|
||||
'remaining_days' => 'integer',
|
||||
'proration_ratio' => 'decimal:4',
|
||||
'old_cycle_price' => 'decimal:2',
|
||||
'new_cycle_price' => 'decimal:2',
|
||||
'charge_amount' => 'decimal:2',
|
||||
'credit_amount' => 'decimal:2',
|
||||
'net_amount' => 'decimal:2',
|
||||
'applied_at' => 'datetime',
|
||||
'metadata' => 'array',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function account(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(HostingAccount::class, 'hosting_account_id');
|
||||
}
|
||||
|
||||
public function fromProduct(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(HostingProduct::class, 'from_hosting_product_id');
|
||||
}
|
||||
|
||||
public function toProduct(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(HostingProduct::class, 'to_hosting_product_id');
|
||||
}
|
||||
|
||||
public function invoice(): HasOne
|
||||
{
|
||||
return $this->hasOne(HostingBillingInvoice::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user