<?php

namespace App\Models;

use App\Scopes\CommonModel;

/**
 * @property string $slug
 * @property string $local_group
 * @property string $email
 * @property string $url
 * @property string $account_name
 * @property string $account_iban
 * @property string $account_bic
 * @property string $city
 * @property string $postcode
 * @property boolean $download_exports
 * @property boolean $upload_exports
 * @property string $gdpr_text
 * @property string $impress_text
 * @property string $url_participation_rules
 * @property boolean $events_allowed
 * @property boolean $has_active_instance
 * @property boolean $tax_liable
 * @property int $vat_rate
 * @property string|null $tax_exemption_reason
 * @property string|null $tax_exemption_note
 * @property string $vat_pricing_mode
 */
class Tenant extends CommonModel
{
    public static function getTempDirectory() : string {
        return app('tenant')->slug . '/temp-data/';
    }
    public const PRIMARY_TENANT_NAME = 'LV';

    protected $fillable = [
        'slug',
        'name',
        'email',
        'email_finance',
        'url',
        'account_name',
        'account_iban',
        'account_bic',
        'city',
        'postcode',
        'download_exports',
        'upload_exports',
        'gdpr_text',
        'impress_text',
        'url_participation_rules',
        'is_active_local_group',
        'has_active_instance',
        'tax_liable',
        'vat_rate',
        'tax_exemption_reason',
        'tax_exemption_note',
        'vat_pricing_mode',
    ];

    protected $casts = [
        'tax_liable' => 'boolean',
        'vat_rate' => 'integer',
    ];
}
