<?php

namespace Elex\MultiVendor\Model;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

class PreInstaller {


	public function __construct() {
		$this->user_roles();
	}
	public static function user_roles() {
	
		if ( ! wp_roles()->is_role( 'elex_mv_vendor' ) ) {

			add_role(
				'elex_mv_vendor',
				__( 'ELEX-Vendor', 'elex-multi-vendor-for-woocommerce' ),
				array(
					'vendor_product_list'          => true,
					'vendor_category_list'         => true,
					'vendor_product_edit'          => true,
					'vendor_product_create'        => true,
					'vendor_product_manage'        => true,
					'vendor_order_list'            => true,
					'vendor_order_manage'          => true,
					'vendor_order_package_manage'  => true,
					'vendor_order_shipment_manage' => true,
					'vendor_coupon_list'           => true,
					'vendor_coupon_create'         => true,
					'vendor_coupon_edit'           => true,
					'vendor_coupon_delete'         => true,
					'vendor_package_manage'        => true,
					'vendor_shipping_manage'       => true,
					'vendor_payment_manage'        => true,
					'vendor_reply_list'            => true,
					'vendor_reply_reply'           => true,
					'vendor_bulk_lable_manage'     => true,
					'vendor_settings_manage'       => true,
					'edit_dashboard'               => true,
					'edit_posts'                   => true,
					'edit_pages'                   => true,
					'manage_options'               => true,
					'create_posts'                 => true,
					'publish_posts'                => true,
					'read'                         => true,
					'admin_vendor_access'          => true,
				) 
			);

		}
	}
}
