<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

/**
 * Class PaymentReminder
 * 
 * @property int $id
 * @property string|null $title
 * @property int|null $interval
 * @property string|null $message
 * @property string|null $action
 * @property bool $active
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 *
 * @package App\Models
 */
class PaymentReminder extends Model
{
	protected $table = 'payment_reminders';

	protected $casts = [
		'interval' => 'int',
		'active' => 'bool'
	];

	protected $fillable = [
		'title',
		'subject',
		'interval',
		'message',
		'action',
		'clearingtype',
		'active'
	];

	protected static $clearingtypes = [
        'fnc' => 'Rechnung',
        'vor' => 'Vorkasse',
    ];

	public function getClearingtype(){
		return isset(self::$clearingtypes[$this->clearingtype]) ? self::$clearingtypes[$this->clearingtype] : 'Kein Typ';
	}

	public static function returnClearingtypes(){
		return self::$clearingtypes;
	}
}
