mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 09:14:08 +00:00
Remove dead model methods now handled by services
Remove createItem/updateItem from Item, createTransaction/ completeTransaction/failedTransaction from Transaction, createCustomField/updateCustomField from CustomField, all business methods from ExchangeRateProvider (CRUD + API checks + URL helpers), and validateCredentials/createDisk/updateDisk/updateDefaultDisks/ setAsDefaultDisk from FileDisk. All logic now lives in their respective service classes.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Facades\Hashids;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -42,27 +41,6 @@ class Transaction extends Model
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
|
||||
public function completeTransaction()
|
||||
{
|
||||
$this->status = self::SUCCESS;
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function failedTransaction()
|
||||
{
|
||||
$this->status = self::FAILED;
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public static function createTransaction($data)
|
||||
{
|
||||
$transaction = self::create($data);
|
||||
$transaction->unique_hash = Hashids::connection(Transaction::class)->encode($transaction->id);
|
||||
$transaction->save();
|
||||
|
||||
return $transaction;
|
||||
}
|
||||
|
||||
public function isExpired()
|
||||
{
|
||||
$linkExpiryDays = (int) CompanySetting::getSetting('link_expiry_days', $this->company_id);
|
||||
|
||||
Reference in New Issue
Block a user