<commit_before><?php

namespace common\models\user;

use common\models\Address;
use common\models\hierarchy\Hierarchy;
use common\models\issue\IssueCost;
use common\models\issue\IssueUser;
use common\models\issue\query\IssueCostQuery;
use common\models\provision\Provision;
use common\models\provision\ProvisionQuery;
use common\models\user\query\UserQuery;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
use yii\helpers\ArrayHelper;
use yii\web\IdentityInterface;

/**
 * This is the model class for table "{{%user}}".
 *
 * @property integer $id
 * @property string $username
 * @property string $auth_key
 * @property string $access_token
 * @property string $password_hash
 * @property string $password_reset_token
 * @property string $verification_token
 * @property string|null $email
 * @property integer $status
 * @property string $ip
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $action_at
 * @property string $authKey
 * @property integer|null $boss
 * @property-write string $password
 * @property-read UserProfile $profile
 * @property-read UserAddress[] $addresses
 * @property-read Address|null $homeAddress
 * @property-read Address|null $postalAddress
 * @property-read IssueUser[] $issueUsers
 * @property-read UserTrait[] $traits
 * @property-read IssueCost[] $costs
 *
 */
class User extends ActiveRecord implements IdentityInterface, Hierarchy {

	public const STATUS_INACTIVE = 0;
	public const STATUS_ACTIVE = 1;
	public const STATUS_BANNED = 2;
	public const STATUS_DELETED = 3;

	public const ROLE_DEFAULT = self::ROLE_USER;

	public const ROLE_ADMINISTRATOR = 'administrator';
	public const ROLE_MANAGER = 'manager';
	public const ROLE_USER = 'user';

	public const ROLE_RECCOMENDING = 'recommending';

	//workers
	public const ROLE_AGENT = 'agent';
	public const ROLE_CO_AGENT = 'co-agent';
	public const ROLE_BOOKKEEPER = 'book_keeper';
	public const ROLE_CUSTOMER_SERVICE = 'customer_service';
	public const ROLE_TELEMARKETER = 'telemarketer';
	public const ROLE_LAWYER = 'lawyer';
	public const ROLE_LAWYER_ASSISTANT = 'lawyer_assistant';

	public const PERMISSION_ARCHIVE = 'archive';
	public const PERMISSION_MESSAGE_TEMPLATE = 'message.template';
	public const PERMISSION_EXPORT = 'export';
	public const PERMISSION_ISSUE = 'issue';
	public const PERMISSION_HINT = 'hint';
	public const PERMISSION_LOGS = 'logs';
	public const PERMISSION_MEET = 'meet';
	public const PERMISSION_NEWS = 'news';
	public const PERMISSION_NOTE = 'note';
	public const PERMISSION_SUMMON = 'summon';
	public const PERMISSION_COST = 'cost';

	public const PERMISSION_CALCULATION_TO_CREATE = 'calculation.to-create';
	public const PERMISSION_CALCULATION_UPDATE = 'calculation.update';
	public const PERMISSION_CALCULATION_PROBLEMS = 'calculation.problems';
	public const PERMISSION_CALCULATION_PAYS = 'calculation.pays';

	public const PERMISSION_PAY = 'pay';
	public const PERMISSION_PAY_UPDATE = 'pay.update';
	public const PERMISSION_PAY_PAID = 'pay.paid';
	public const PERMISSION_PAY_RECEIVED = 'pay.received';
	public const PERMISSION_PAYS_DELAYED = 'pays.delayed';
	public const PERMISSION_PAY_PART_PAYED = 'pay.part-payed';

	public const PERMISSION_PROVISION = 'provision';

	public const PERMISSION_WORKERS = 'workers';

	public const PERMISSION_LEAD = 'lead';
	public const PERMISSION_LEAD_DIALER = 'lead.dialer';
	public const PERMISSION_LEAD_STATUS = 'lead.status';
	public const PERMISSION_LEAD_DUPLICATE = 'lead.duplicate';

	public const PERMISSION_CZATER = 'czater';
	public const PERMISSION_SMS = 'sms';
	public const PERMISSION_MULTIPLE_SMS = 'sms.multiple';

	private static $ROLES_NAMES;
	private static $PERMISSIONS_NAMES;

	/**
	 * @inheritdoc
	 */
	public static function tableName(): string {
		return '{{%user}}';
	}

	/**
	 * @inheritdoc
	 */
	public function behaviors(): array {
		return [<commit_msg>feat: restore lead.import user const permission.<commit_after><?php

namespace common\models\user;

use common\models\Address;
use common\models\hierarchy\Hierarchy;
use common\models\issue\IssueCost;
use common\models\issue\IssueUser;
use common\models\issue\query\IssueCostQuery;
use common\models\provision\Provision;
use common\models\provision\ProvisionQuery;
use common\models\user\query\UserQuery;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
use yii\helpers\ArrayHelper;
use yii\web\IdentityInterface;

/**
 * This is the model class for table "{{%user}}".
 *
 * @property integer $id
 * @property string $username
 * @property string $auth_key
 * @property string $access_token
 * @property string $password_hash
 * @property string $password_reset_token
 * @property string $verification_token
 * @property string|null $email
 * @property integer $status
 * @property string $ip
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $action_at
 * @property string $authKey
 * @property integer|null $boss
 * @property-write string $password
 * @property-read UserProfile $profile
 * @property-read UserAddress[] $addresses
 * @property-read Address|null $homeAddress
 * @property-read Address|null $postalAddress
 * @property-read IssueUser[] $issueUsers
 * @property-read UserTrait[] $traits
 * @property-read IssueCost[] $costs
 *
 */
class User extends ActiveRecord implements IdentityInterface, Hierarchy {

	public const STATUS_INACTIVE = 0;
	public const STATUS_ACTIVE = 1;
	public const STATUS_BANNED = 2;
	public const STATUS_DELETED = 3;

	public const ROLE_DEFAULT = self::ROLE_USER;

	public const ROLE_ADMINISTRATOR = 'administrator';
	public const ROLE_MANAGER = 'manager';
	public const ROLE_USER = 'user';

	public const ROLE_RECCOMENDING = 'recommending';

	//workers
	public const ROLE_AGENT = 'agent';
	public const ROLE_CO_AGENT = 'co-agent';
	public const ROLE_BOOKKEEPER = 'book_keeper';
	public const ROLE_CUSTOMER_SERVICE = 'customer_service';
	public const ROLE_TELEMARKETER = 'telemarketer';
	public const ROLE_LAWYER = 'lawyer';
	public const ROLE_LAWYER_ASSISTANT = 'lawyer_assistant';

	public const PERMISSION_ARCHIVE = 'archive';
	public const PERMISSION_MESSAGE_TEMPLATE = 'message.template';
	public const PERMISSION_EXPORT = 'export';
	public const PERMISSION_ISSUE = 'issue';
	public const PERMISSION_HINT = 'hint';
	public const PERMISSION_LOGS = 'logs';
	public const PERMISSION_MEET = 'meet';
	public const PERMISSION_NEWS = 'news';
	public const PERMISSION_NOTE = 'note';
	public const PERMISSION_SUMMON = 'summon';
	public const PERMISSION_COST = 'cost';

	public const PERMISSION_CALCULATION_TO_CREATE = 'calculation.to-create';
	public const PERMISSION_CALCULATION_UPDATE = 'calculation.update';
	public const PERMISSION_CALCULATION_PROBLEMS = 'calculation.problems';
	public const PERMISSION_CALCULATION_PAYS = 'calculation.pays';

	public const PERMISSION_PAY = 'pay';
	public const PERMISSION_PAY_UPDATE = 'pay.update';
	public const PERMISSION_PAY_PAID = 'pay.paid';
	public const PERMISSION_PAY_RECEIVED = 'pay.received';
	public const PERMISSION_PAYS_DELAYED = 'pays.delayed';
	public const PERMISSION_PAY_PART_PAYED = 'pay.part-payed';

	public const PERMISSION_PROVISION = 'provision';

	public const PERMISSION_WORKERS = 'workers';

	public const PERMISSION_LEAD = 'lead';
	public const PERMISSION_LEAD_DIALER = 'lead.dialer';
	public const PERMISSION_LEAD_IMPORT = 'lead.import';
	public const PERMISSION_LEAD_STATUS = 'lead.status';
	public const PERMISSION_LEAD_DUPLICATE = 'lead.duplicate';

	public const PERMISSION_CZATER = 'czater';
	public const PERMISSION_SMS = 'sms';
	public const PERMISSION_MULTIPLE_SMS = 'sms.multiple';

	private static $ROLES_NAMES;
	private static $PERMISSIONS_NAMES;

	/**
	 * @inheritdoc
	 */
	public static function tableName(): string {
		return '{{%user}}';
	}

	/**
	 * @inheritdoc
	 */
	public function behaviors(): array {
		return [
{'fraction_non_alphanumeric': 0.10044052863436123, 'fraction_numerical': 0.0010069225928256765, 'mean_word_length': 5.69418702611626, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1433223', 'n_tokens_mistral': 2710, 'n_tokens_neox': 2620, 'n_words': 649}