Changeset View
Changeset View
Standalone View
Standalone View
src/app/Transaction.php
<?php | <?php | ||||
namespace App; | namespace App; | ||||
use App\Entitlement; | use App\Entitlement; | ||||
use App\Wallet; | use App\Wallet; | ||||
use App\Traits\UuidStrKeyTrait; | |||||
use Illuminate\Database\Eloquent\Model; | use Illuminate\Database\Eloquent\Model; | ||||
/** | /** | ||||
* The eloquent definition of a Transaction. | * The eloquent definition of a Transaction. | ||||
* | * | ||||
* @property int $amount | * @property int $amount | ||||
* @property string $description | * @property string $description | ||||
* @property string $id | * @property string $id | ||||
* @property string $object_id | * @property string $object_id | ||||
* @property string $object_type | * @property string $object_type | ||||
* @property string $type | * @property string $type | ||||
* @property string $transaction_id | * @property string $transaction_id | ||||
* @property string $user_email | * @property string $user_email | ||||
*/ | */ | ||||
class Transaction extends Model | class Transaction extends Model | ||||
{ | { | ||||
use UuidStrKeyTrait; | |||||
public const ENTITLEMENT_BILLED = 'billed'; | public const ENTITLEMENT_BILLED = 'billed'; | ||||
public const ENTITLEMENT_CREATED = 'created'; | public const ENTITLEMENT_CREATED = 'created'; | ||||
public const ENTITLEMENT_DELETED = 'deleted'; | public const ENTITLEMENT_DELETED = 'deleted'; | ||||
public const WALLET_AWARD = 'award'; | public const WALLET_AWARD = 'award'; | ||||
public const WALLET_CREDIT = 'credit'; | public const WALLET_CREDIT = 'credit'; | ||||
public const WALLET_DEBIT = 'debit'; | public const WALLET_DEBIT = 'debit'; | ||||
public const WALLET_PENALTY = 'penalty'; | public const WALLET_PENALTY = 'penalty'; | ||||
Show All 20 Lines | protected $fillable = [ | ||||
'transaction_id' | 'transaction_id' | ||||
]; | ]; | ||||
/** @var array Casts properties as type */ | /** @var array Casts properties as type */ | ||||
protected $casts = [ | protected $casts = [ | ||||
'amount' => 'integer', | 'amount' => 'integer', | ||||
]; | ]; | ||||
/** @var boolean This model uses an automatically incrementing integer primary key? */ | |||||
public $incrementing = false; | |||||
/** @var string The type of the primary key */ | |||||
protected $keyType = 'string'; | |||||
/** | /** | ||||
* Returns the entitlement to which the transaction is assigned (if any) | * Returns the entitlement to which the transaction is assigned (if any) | ||||
* | * | ||||
* @return \App\Entitlement|null The entitlement | * @return \App\Entitlement|null The entitlement | ||||
*/ | */ | ||||
public function entitlement(): ?Entitlement | public function entitlement(): ?Entitlement | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines |