<commit_before><?php

/*
 * This file is part of the Indigo Erp Stock module.
 *
 * (c) Indigo Development Team
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Erp;

/**
 * Product Model
 *
 * @author <NAME> <<EMAIL>>
 */
class Model_Product extends \Orm\Model_Temporal
{
	use \Indigo\Skeleton\Model;

	protected static $_many_many = [
		'categories',
	];

	/**
	 * {@inheritdoc}
	 */
	protected static $_properties = [
		'id' => [
			'label' => 'ID',
		],
		'temporal_start',
		'temporal_end',
		'category_id' => [
			'label' => 'Category',
			'type' => 'select',
		],
		'manufacturer_id' => [
			'label' => 'Manufacturer',
			'type' => 'select',
		],
		'tax_class_id',
		'type_id',
		'name' => [
			'label' => 'Name',
			'type'  => 'text',
		],
		'slug',
		'description' => [
			'label' => 'Description',
		],
		'price' => [
			'label' => 'Price',
			'type' => 'text',
		],
		'stock' => [
			'label' => 'Stock',
			'type' => 'text',
		],
		'stock_status_id' => [
			'label' => 'Out of stock status',
		],
		'status' => [
			'label' => 'Status',
			'options' => [
				'Disabled',
				'Enabled',
			],
		],
	];

	/**
	 * {@inheritdoc}
	 */
	protected static $_list_properties = [
		'id' => [
			'label' => '#',
		],
		'name',
		'price' => [
			'type' => 'hidden',
		],
		'stock' => [
			'type' => 'hidden',
			'sort' => false,
		],
		'status' => [
			'type' => 'select',
		],
	];

	/**
	 * {@inheritdoc}
	 */
	protected static $_form_properties = [
		'name' => [
			'validation' => ['required'],
		],
		'category_id' => [
			'attributes' => [
				'multiple' => 'multiple',
				'data-selected-text-format' => 'count',
			],
			'validation' => [
				'required',
			],
		],
		'manufacturer_id' => [
			'validation' => [
				'required',
				'value' => [],
			],
		],
		'description' => [
			'type' => 'textarea',
			'template' => 'ckeditor',
		],
		'price' => [
			'validation' => [
				'required',
				'type' => 'numeric',
			],
		],
		'stock' => [
			'validation' => [
				'required',
				'type' => 'numeric',
			],
		],
		'status' => [<commit_msg>Removes stock for now<commit_after><?php

/*
 * This file is part of the Indigo Erp Stock module.
 *
 * (c) Indigo Development Team
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Erp;

/**
 * Product Model
 *
 * @author <NAME> <<EMAIL>>
 */
class Model_Product extends \Orm\Model_Temporal
{
	use \Indigo\Skeleton\Model;

	protected static $_many_many = [
		'categories',
	];

	/**
	 * {@inheritdoc}
	 */
	protected static $_properties = [
		'id' => [
			'label' => 'ID',
		],
		'temporal_start',
		'temporal_end',
		'category_id' => [
			'label' => 'Category',
			'type' => 'select',
		],
		'manufacturer_id' => [
			'label' => 'Manufacturer',
			'type' => 'select',
		],
		'tax_class_id',
		'type_id',
		'name' => [
			'label' => 'Name',
			'type'  => 'text',
		],
		'slug',
		'description' => [
			'label' => 'Description',
		],
		'price' => [
			'label' => 'Price',
			'type' => 'text',
		],
		'stock' => [
			'label' => 'Stock',
			'type' => 'text',
		],
		'stock_status_id' => [
			'label' => 'Out of stock status',
		],
		'status' => [
			'label' => 'Status',
			'options' => [
				'Disabled',
				'Enabled',
			],
		],
	];

	/**
	 * {@inheritdoc}
	 */
	protected static $_list_properties = [
		'id' => [
			'label' => '#',
		],
		'name',
		'price' => [
			'type' => 'hidden',
		],
		'stock' => [
			'type' => 'hidden',
			'sort' => false,
		],
		'status' => [
			'type' => 'select',
		],
	];

	/**
	 * {@inheritdoc}
	 */
	protected static $_form_properties = [
		'name' => [
			'validation' => ['required'],
		],
		'category_id' => [
			'attributes' => [
				'multiple' => 'multiple',
				'data-selected-text-format' => 'count',
			],
			'validation' => [
				'required',
			],
		],
		'manufacturer_id' => [
			'validation' => [
				'required',
				'value' => [],
			],
		],
		'description' => [
			'type' => 'textarea',
			'template' => 'ckeditor',
		],
		'price' => [
			'validation' => [
				'required',
				'type' => 'numeric',
			],
		],
		'stock' => [
			'default' => 1,
			// 'validation' => [
			// 	'required',
			// 	'type' => 'numeric',
			// ],
		],
		'status' => [
{'fraction_non_alphanumeric': 0.23421965317919075, 'fraction_numerical': 0.00023121387283236994, 'mean_word_length': 2.5693069306930694, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 116, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2194869', 'n_tokens_mistral': 1958, 'n_tokens_neox': 1656, 'n_words': 317}