<?php
/**
 * Plugin Constants
 *
 * @category   WordPress_Plugin
 * @package    Common
 * @subpackage Constants
 * @author     miniOrange <info@miniorange.com>
 * @license    MIT/Expat
 * @link       https://plugins.miniorange.com/woocommerce-api-product-sync-with-woocommerce-rest-apis
 */

namespace MOWCPS\Common\Constants;

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

/**
 * Plugin Constants
 */
class Constants {

	/**
	 * REST API namespace.
	 */
	const REST_API_NAMESPACE = 'mowcps/v1';

	/**
	 * gettext text domain for this plugin.
	 */
	const PLUGIN_TEXT_DOMAIN = 'products-sync-for-woocommerce';

	// MOWCPS host name.
	const MOWCPS_HOST_NAME = 'https://login.xecurify.com';

	// MOWCPS plan name.
	const MOWCPS_PLAN_NAME = 'wp_rest_woocommerce_sync_standard_plan';

	// MOWCPS plan type.
	const MOWCPS_PLAN_TYPE = 'WP_REST_WOOCOMMERCE_SYNC_PREMIUM_PLUGIN';

	// Generic constants.
	const AUTHORIZATION     = 'authorization';
	const CONNECTIONS       = 'connections';
	const ATTRIBUTE_MAPPING = 'attribute_mapping';
	const OPERATIONS        = 'operations';
	const DEFAULT_APP       = 'custom';
	const ORDER_SYNC_CONFIG = 'order_sync';

	// Shopify header key-specific constants.
	const SHOPIFY_ACCESS_TOKEN_HEADER_NAME = 'X-Shopify-Access-Token';
	// Default unique product identifier constants (NOTE: Never change this constant).
	const DEFAULT_UNIQUE_PRODUCT_IDENTIFIER = 'mo_uid';

	// Database errors.
	const ERROR_DB_ERROR              = 'DB_ERROR';
	const ERROR_RECORD_NOT_FOUND      = 'RECORD_NOT_FOUND';
	const ERROR_DUPLICATE_ENTRY       = 'DUPLICATE_ENTRY';
	const ERROR_FOREIGN_KEY_VIOLATION = 'FOREIGN_KEY_VIOLATION';

	// Validation errors.
	const ERROR_MISSING_REQUIRED_FIELD = 'MISSING_REQUIRED_FIELD';
	const ERROR_INVALID_FIELD_VALUE    = 'INVALID_FIELD_VALUE';
	const ERROR_INVALID_DATA_TYPE      = 'INVALID_DATA_TYPE';
	const ERROR_NO_DATA                = 'NO_DATA';
	const ERROR_INVALID_SCHEDULE       = 'INVALID_SCHEDULE';
	const ERROR_NOT_SUPPORTED          = 'NOT_SUPPORTED';
	const ERROR_INVALID_CHUNK_DATA     = 'INVALID_CHUNK_DATA';
	const ERROR_INVALID_CHUNK_NUMBER   = 'INVALID_CHUNK_NUMBER';

	// Permission errors.
	const ERROR_REST_FORBIDDEN = 'REST_FORBIDDEN';
	const ERROR_INVALID_NONCE  = 'INVALID_NONCE';
	const ERROR_UNAUTHORIZED   = 'UNAUTHORIZED';

	// Supplier specific errors.
	const ERROR_SUPPLIER_NOT_FOUND      = 'SUPPLIER_NOT_FOUND';
	const ERROR_INVALID_APP_TYPE        = 'INVALID_APP_TYPE';
	const ERROR_INVALID_SYNC_TYPE       = 'INVALID_SYNC_TYPE';
	const ERROR_INVALID_SUPPLIER_CONFIG = 'INVALID_SUPPLIER_CONFIG';
	const ERROR_INVALID_REQUEST         = 'INVALID_REQUEST';

	// Connection specific errors.
	const ERROR_INVALID_CONNECTION_TYPE = 'INVALID_CONNECTION_TYPE';
	const ERROR_INVALID_RESOURCE_TYPE   = 'INVALID_RESOURCE_TYPE';
	const ERROR_INVALID_PRIORITY        = 'INVALID_PRIORITY';
	const ERROR_DUPLICATE_PRIORITY      = 'DUPLICATE_PRIORITY';
	const ERROR_CONNECTION_NOT_FOUND    = 'CONNECTION_NOT_FOUND';

	// Authorization specific errors.
	const ERROR_INVALID_AUTH_TYPE     = 'INVALID_AUTH_TYPE';
	const ERROR_INVALID_AUTH_SETTINGS = 'INVALID_AUTH_SETTINGS';

	// Order sync specific errors.
	const ERROR_ORDER_SYNC_NOT_FOUND = 'ORDER_SYNC_NOT_FOUND';
	const ERROR_PENDING_ORDERS_EXIST = 'PENDING_ORDERS_EXIST';

	// Schedule specific errors.
	const ERROR_SCHEDULE_NOT_FOUND = 'SCHEDULE_NOT_FOUND';

	// Setting specific errors.
	const ERROR_SETTING_NOT_FOUND = 'SETTING_NOT_FOUND';

	// Order sync audit specific errors.
	const ERROR_ORDER_SYNC_AUDIT_NOT_FOUND = 'ORDER_SYNC_AUDIT_NOT_FOUND';
	const ERROR_INVALID_ORDER_ID           = 'INVALID_ORDER_ID';

	public const MO_NO_OPERATION = 'MO-NO-operation';

	public const API_CONNECTION   = 'api';
	public const FTP_CONNECTION   = 'ftp';
	public const POST_REQUEST     = 'POST';
	public const GET_REQUEST      = 'GET';
	public const DEFAULT_APP_NAME = 'default';

	public const DEBUG_LOGS_CLEARED_SUCCESS_MESSAGE = 'Debug logs cleared successfully!';

	public const CONNECTION_SAVE_SUCCESS_MESSAGE         = 'Connection saved successfully!';
	public const ORDER_SYNC_SETTING_SAVE_SUCCESS_MESSAGE = 'Order sync setting saved successfully!';
	public const FORM_FIELDS_MISSING_MESSAGE             = 'Some fields are missing. Please fill the fields.';
	public const ERROR_SELECT_CONNECTION_MESSAGE         = 'Please select Sync Connection to proceed.';
	public const ERROR_INCORRECT_SUPPLIER_NAME           = 'Special characters except "_" are not allowed in the connection name.';
	public const NOT_2XX_API_RESPONSE                    = 'Unexpected error. Check config or try again later.';

	public const TEST_CONFIGURATION_DISPLAY_TYPE_UNSERIALIZED = 'unserialized';
	public const TEST_CONFIGURATION_DISPLAY_TYPE_TABLE        = 'table';
	public const TEST_CONFIGURATION_DISPLAY_TYPE_JSON         = 'json';

	// Plugin detail Constants.
	public const PLUGIN_FILE = 'products-sync-for-woocommerce.php';

	// Sync stage status messages and flags.
	public const INITIATE_BATCH_SYNC           = 'Initiate batch sync';
	public const VENDOR_UNAVAILABLE_PRODUCTS   = 'vendor_unavailable_products';
	public const VENDOR_AVAILABLE_PRODUCTS     = 'vendor_available_products';
	public const DISCARD_PRODUCTS              = 'Discarding leftover products';
	public const INITIATE_PAGE_SYNC            = 'Initiate page sync';
	public const PROCESS_COMPLETED             = 'Process Completed';
	public const BATCH_COMPLETED_FOR_PAGE      = 'Batch Completed for Page';
	public const SYNC_ABORTED                  = 'Sync Aborted';
	public const SYNC_PAUSED                   = 'Sync Paused';
	public const DEFAULT_PRODUCT_STATUS        = 'publish';
	public const STARTED_SYNC_RUNNING_STATUS   = 'started';
	public const STOPPED_SYNC_RUNNING_STATUS   = 'stopped';
	public const PAUSED_SYNC_RUNNING_STATUS    = 'paused';
	public const RESUMED_SYNC_RUNNING_STATUS   = 'resumed';
	public const COMPLETED_SYNC_RUNNING_STATUS = 'Sync Completed';
	public const CONNECTION_SYNC_COMPLETED     = 'Connection Sync Completed';
	public const INITIATE_SYNC                 = 'Initiating Sync Process';
	public const SYNC_IN_PROGRESS              = 'Sync in Progress';
	public const SYNC_ANALYTICS_CLEARED        = 'Sync analytics cleared!';
	public const SYNC_YET_TO_BE_INITIATED      = 'Sync yet to be initiated';

	// minOrange Constants.
	public const MINIORANGE            = 'https://miniorange.com';
	public const HOST_NAME             = 'https://login.xecurify.com';
	public const SEND_NOTIFICATION_API = '/moas/api/notify/send';
	public const CUSTOMER_KEY_API      = '/moas/rest/customer/key';
	public const CUSTOMER_ADD_API      = '/moas/rest/customer/add';

	// miniOrange API status Constants.
	public const SUCCESS_STATUS                          = 'SUCCESS';
	public const TRANSACTION_LIMIT_EXCEEDED_STATUS       = 'TRANSACTION_LIMIT_EXCEEDED';
	public const CUSTOMER_USERNAME_ALREADY_EXISTS_STATUS = 'CUSTOMER_USERNAME_ALREADY_EXISTS';

	// Default miniOrange user detail Constants.
	public const DEFAULT_CUSTOMER_KEY = '16555';
	public const DEFAULT_API_KEY      = 'fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq';
	public const SUPPORT_EMAIL        = 'apisupport@xecurify.com';
	public const SUPPORT_BCC_EMAIL    = 'info@xecurify.com';
	public const EMAIL_FROM_NAME      = 'miniOrange';

	// Hook name Constants.
	public const INIT_HOOK              = 'init';
	public const ADMIN_INIT_HOOK        = 'admin_init';
	public const REST_API_INIT_HOOK     = 'rest_api_init';
	public const ADMIN_MENU_HOOK        = 'admin_menu';
	public const ADMIN_HEAD_HOOK        = 'admin_head';
	public const ADMIN_FOOTER_HOOK      = 'admin_footer';
	public const ADMIN_NOTICES_HOOK     = 'admin_notices';
	public const PLUGINS_LOADED_HOOK    = 'plugins_loaded';
	public const DATA_ALTERATION_FILTER = 'mowcps_data_alteration_filter';

	// Class nonce Constants.
	public const MO_USER_NONCE = 'MO_User';

	// Feature name Constants.
	public const EXTERNAL_ENDPOINT = 'external_endpoint';

	// Plugin operation status Constants.
	public const MESSAGE_STATUS_SUCCESS = 'success';

	// Plugin operation Constants.
	public const ADD    = 'add';
	public const UPDATE = 'update';
	public const VIEW   = 'view';
	public const EDIT   = 'edit';
	public const DELETE = 'delete';
	public const TEST   = 'test';

	// Authorization Constants.
	public const REQUEST_HEADER         = 'header';
	public const NO_AUTHORIZATION       = 'no-auth';
	public const BASIC_AUTHORIZATION    = 'basic-authorization';
	public const BEARER_TOKEN           = 'bearer-token';
	public const API_KEY_AUTHENTICATION = 'api-key-authentication';

	// Request body Constants.
	public const REQUEST_BODY          = 'body';
	public const NO_BODY               = 'no-body';
	public const XML                   = 'xml';
	public const JSON                  = 'json';
	public const GRAPH_QL              = 'graphql';
	public const FILE                  = 'file';
	public const X_WWW_FORM_URLENCODED = 'x-www-form-urlencoded';

	// Setting constants.
	public const CONFIGURATION_ACTIVE    = true;
	public const CONFIGURATION_IN_ACTIVE = false;

	public const EQUAL         = 'equals';
	public const NOT_EQUAL     = 'notEquals';
	public const IS_NULL       = 'isNull';
	public const IS_NOT_NULL   = 'isNotNull';
	public const GREATER_THAN  = 'greaterThan';
	public const LESS_THAN     = 'lessThan';
	public const IS_EMPTY      = 'isEmpty';
	public const IS_NOT_EMPTY  = 'isNotEmpty';
	public const CONTAINS      = 'contains';
	public const NOT_CONTAINS  = 'notContains';
	public const LIKE          = 'like';
	public const NOT_LIKE      = 'notLike';
	public const AND_CONDITION = 'AND';
	public const OR_CONDITION  = 'OR';

	public const OUT_OF_STOCK = 'out_of_stock';
	public const DRAFT        = 'draft';


	// Pagination Constants.
	public const NONE                     = 'none';
	public const PAGE                     = 'page';
	public const REGULAR                  = 'regular';
	public const OFFSET                   = 'offset';
	public const CURSOR                   = 'cursor';
	public const LIMIT                    = 'limit';
	public const HEADERS                  = 'headers';
	public const URL                      = 'url';
	public const QUERY_PARAMETER          = 'query-parameter';
	public const NEXT                     = 'next';
	public const REL_NEXT                 = 'rel-next';
	public const PER_PAGE                 = 'per_page';
	public const LINK                     = 'link';
	public const HAS_MORE                 = 'has_more';
	public const DEFAULT_PAGINATION_LIMIT = 50;

	// Pagination messages.
	public const EMPTY_PAGINATION_PARAMETER             = 'Pagination Parameter cannot be empty.';
	public const EMPTY_OFFSET_PARAMETER_AND_VALUE       = 'Offset Parameter or Value cannot be empty.';
	public const EMPTY_OFFSET_LIMIT_PARAMETER_AND_VALUE = 'Offset Limit Parameter or Value cannot be empty.';
	public const FAILED_TO_DECODE_RESPONSE_BODY         = 'Failed to decode pagination response body.';
	public const INVALID_CURSOR_LOCATION                = 'Invalid cursor location specified.';
	public const INVALID_NEXT_CURSOR_VALUE              = 'Invalid next cursor value found in the response.';
	public const EMPTY_NEXT_CURSOR_KEY_RESPONSE         = 'Next cursor key cannot be empty.';
	public const INVALID_XML_FORMAT                     = 'Invalid XML format';


	public const CATEGORIES = 'Categories';
	public const TAGS       = 'Tags';
	public const BRANDS     = 'Brands';

	// Sync Frequency Constants.
	public const CUSTOM_FREQUENCY = 'custom';
	public const MINUTES          = 'minutes';
	public const HOURS            = 'hours';
	public const DAYS             = 'days';

	// Hooks Constants.
	public const MOWCPS_PERFORM_ACTION_BEFORE_SYNC = 'mowcps_perform_action_before_sync';

	public const TXT_FILE   = 'txt';
	public const CSV_FILE   = 'csv';
	public const XLSX_FILE  = 'xlsx';
	public const XLS_FILE   = 'xls';
	public const TSV_FILE   = 'tsv';
	public const TEXT_FILE  = 'text';

	// Sync Scheduler Constants.
	public const SCHEDULED_SYNC_PAUSED      = 'Paused';
	public const SCHEDULED_SYNC_IN_PROGRESS = 'In Progress';
	public const SCHEDULED_SYNC_ABORTED     = 'Aborted';
	public const SCHEDULED_SYNC_EXECUTED    = 'Executed';
	public const SCHEDULED_SYNC_FAILED      = 'Failed';

	// Sync Process Constants.
	public const INITIATE_NEXT_CONNECTION_SYNC = 'Initiate next connection sync';

	public const MOWCPS_DEFAULT_REQUEST_TIMEOUT = 120; // Default request timeout in seconds.

	public const INBOUND_SYNC  = 'inbound_sync';
	public const OUTBOUND_SYNC = 'outbound_sync';
	public const ORDER_SYNC    = 'order_sync';

	public const ANALYTICS_COMPLETE_CONNECTION = 'complete-connection';

	public const MOWCPS_SYNC_COMPLETED = 'Supplier_sync_completed';

	// Authorization types.
	const AUTH_TYPE_NO_AUTH       = 'no-auth';
	const AUTH_TYPE_BASIC         = 'basic';
	const AUTH_TYPE_BEARER        = 'bearer';
	const AUTH_TYPE_API_KEY       = 'api-key';
	const AUTH_TYPE_OAUTH2        = 'oauth2';
	const AUTH_TYPE_CUSTOM        = 'custom';

	// OAuth2 grant types.
	const OAUTH2_GRANT_TYPE_CLIENT_CREDENTIALS = 'client_credentials';
	const OAUTH2_GRANT_TYPE_PASSWORD           = 'password';

	// Authorization defaults.
	const DEFAULT_AUTH_HEADER_NAME        = 'Authorization';
	const DEFAULT_TOKEN_TYPE              = 'Bearer';
	const DEFAULT_TOKEN_KEY               = 'token';
	const DEFAULT_EXPIRES_IN_KEY          = 'expires_in';
	const DEFAULT_SEND_CLIENT_CREDENTIALS = array( 'header' );
	const DEFAULT_EXPIRES_IN              = 3600; // 1 hour
	const TOKEN_REFRESH_BUFFER_TIME       = 60; // 1 minute buffer before token expiry

	// Attribute mapping specific errors.
	const ERROR_INVALID_PRODUCT_TYPE   = 'INVALID_PRODUCT_TYPE';
	const ERROR_INVALID_MAPPING_TYPE   = 'INVALID_MAPPING_TYPE';
	const ERROR_MISSING_MAPPING_FIELDS = 'MISSING_MAPPING_FIELDS';

	// Attribute mapping product types.
	const ATTRIBUTE_MAPPING_PRODUCT_TYPE_PARENT  = 'parent';
	const ATTRIBUTE_MAPPING_PRODUCT_TYPE_VARIANT = 'variant';

	// Attribute mapping types.
	const ATTRIBUTE_MAPPING_TYPE_CORE        = 'core';
	const ATTRIBUTE_MAPPING_TYPE_ATTRIBUTE   = 'attribute';
	const ATTRIBUTE_MAPPING_TYPE_TAXONOMY    = 'taxonomy';
	const ATTRIBUTE_MAPPING_TYPE_CUSTOM      = 'custom';
	const ATTRIBUTE_MAPPING_TYPE_INTEGRATION = 'integration';

	// Settings specific errors.
	const ERROR_INVALID_OPERATION_TYPE = 'INVALID_OPERATION_TYPE';
	const ERROR_INVALID_OPERATION      = 'INVALID_OPERATION';
	const ERROR_INVALID_CONFIGURATION  = 'INVALID_CONFIGURATION';
	const ERROR_GENERAL                = 'ERROR';
	// Sync specific errors.
	const ERROR_SYNC_IN_PROGRESS   = 'SYNC_IN_PROGRESS';
	const ERROR_SYNC_NOT_STARTED   = 'SYNC_NOT_STARTED';
	const ERROR_SYNC_FAILED        = 'SYNC_FAILED';
	const ERROR_SYNC_HISTORY_CLEAR = 'SYNC_HISTORY_CLEAR_FAILED';

	// Supplier app types.
	const SUPPLIER_APP_TYPE_AMROD                     = 'amrod';
	const SUPPLIER_APP_TYPE_BARRON                    = 'barron';
	const SUPPLIER_APP_TYPE_SNS_ACTIVEWEAR            = 'sns-activewear';
	const SUPPLIER_APP_TYPE_SHOPIFY                   = 'shopify';
	const SUPPLIER_APP_TYPE_WOOCOMMERCE               = 'woocommerce';
	const SUPPLIER_APP_TYPE_PARTS_UNLIMITED           = 'parts-unlimited';
	const SUPPLIER_APP_TYPE_MIDOCEAN                  = 'midocean';
	const SUPPLIER_APP_TYPE_SANMAR                    = 'sanmar';
	const SUPPLIER_APP_TYPE_TOPTEX                    = 'toptex';
	const SUPPLIER_APP_TYPE_TURN14                    = 'turn14';
	const SUPPLIER_APP_TYPE_PARTS_EUROPE              = 'parts-europe';
	const SUPPLIER_APP_TYPE_PROMOSTANDARDS_SANMAR     = 'promostandards-sanmar';
	const SUPPLIER_APP_TYPE_PROMOSTANDARDS_SANMAR_CA  = 'promostandards-sanmar-ca';
	const SUPPLIER_APP_TYPE_PROMOSTANDARDS_SAINTREGIS = 'promostandards-saintregis';
	const SUPPLIER_APP_TYPE_PROMOSTANDARDS            = 'promostandards';
	const SUPPLIER_APP_TYPE_UTTEAM                    = 'utteam';
	const SUPPLIER_APP_TYPE_TRENDS                    = 'trends';
	const SUPPLIER_APP_TYPE_INTEX_GLOBAL              = 'intex-global';
	const SUPPLIER_APP_TYPE_KMQ                       = 'kmq';
	const SUPPLIER_APP_TYPE_SYSCOM                    = 'syscom';
	const SUPPLIER_APP_TYPE_JASANI                    = 'jasani';
	const SUPPLIER_APP_TYPE_CUSTOM                    = 'custom';
	const SUPPLIER_APP_TYPE_INGRAM_MICRO              = 'ingram-micro';
	const SUPPLIER_APP_TYPE_INGRAM_MICRO_API          = 'ingram-micro-api';
	const SUPPLIER_APP_TYPE_INGRAM_MICRO_SFTP         = 'ingram-micro-sftp';
	const SUPPLIER_APP_TYPE_MALFINI                   = 'malfini';
	const TEST_SUPPLIER                               = 'test_supplier';

	// Sync types.
	const SYNC_TYPE_API  = 'API';
	const SYNC_TYPE_FTP  = 'FTP';
	const SYNC_TYPE_FILE = 'FILE';

	// Connection types.
	const CONNECTION_TYPE_API  = 'api';
	const CONNECTION_TYPE_FTP  = 'ftp';
	const CONNECTION_TYPE_SFTP = 'sftp';
	const CONNECTION_TYPE_FILE = 'file';

	// Connection resource types.
	const CONNECTION_RESOURCE_TYPE_PRODUCT = 'product';
	const CONNECTION_RESOURCE_TYPE_ORDER   = 'order';

	// Sync actions.
	const SYNC_ACTION_START  = 'start';
	const SYNC_ACTION_PAUSE  = 'pause';
	const SYNC_ACTION_RESUME = 'resume';
	const SYNC_ACTION_ABORT  = 'abort';

	// Default Title for Shopify single-variant products. This is used to identify products that should be treated as simple products rather than variable products.
	const DEFAULT_VARIANT_TITLE = 'Default Title';

	// Database error messages.
	const MSG_DB_ERROR              = 'A database error occurred: %s';
	const MSG_RECORD_NOT_FOUND      = 'The requested record was not found.';
	const MSG_DUPLICATE_ENTRY       = 'A record with this value already exists.';
	const MSG_FOREIGN_KEY_VIOLATION = 'The referenced record does not exist.';

	// Validation error messages.
	const MSG_MISSING_REQUIRED_FIELD = 'The field "%s" is required.';
	const MSG_INVALID_FIELD_VALUE    = 'The value provided for "%s" is invalid.';
	const MSG_INVALID_DATA_TYPE      = 'Invalid data type for field "%s".';
	const MSG_NO_DATA                = 'No valid data provided for update.';
	const MSG_INVALID_SCHEDULE       = 'The specified schedule does not exist.';
	const MSG_NOT_SUPPORTED          = 'This operation is not supported. %s';

	// Permission error messages.
	const MSG_REST_FORBIDDEN = 'You do not have permission to access this resource.';
	const MSG_INVALID_NONCE  = 'Invalid or missing nonce.';
	const MSG_UNAUTHORIZED   = 'You must be logged in to access this resource.';

	// Supplier error messages.
	const MSG_SUPPLIER_NOT_FOUND      = 'Supplier not found.';
	const MSG_INVALID_APP_TYPE        = 'Invalid app type provided.';
	const MSG_INVALID_SYNC_TYPE       = 'Invalid sync type provided.';
	const MSG_INVALID_SUPPLIER_CONFIG = 'Invalid supplier configuration.';
	const ERROR_INVALID_SUPPLIER_TYPE = 'INVALID_SUPPLIER_TYPE';

	// Connection error messages.
	const MSG_INVALID_CONNECTION_TYPE = 'Invalid connection type.';
	const MSG_INVALID_RESOURCE_TYPE   = 'Invalid resource type.';
	const MSG_INVALID_PRIORITY        = 'Priority must be a positive integer.';
	const MSG_CONNECTION_NOT_FOUND    = 'Connection not found.';

	// Authorization error messages.
	const MSG_INVALID_AUTH_TYPE     = 'Invalid auth type provided.';
	const MSG_INVALID_AUTH_SETTINGS = 'Auth settings must be an array or null.';

	// Order sync error messages.
	const MSG_ORDER_SYNC_NOT_FOUND = 'Order sync not found.';
	const MSG_INVALID_ORDER_ID     = 'Invalid order ID: %s';
	const MSG_PENDING_ORDERS_EXIST = 'Cannot disable conditional sync while there are pending orders in the queue. Please sync or clear pending orders before disabling conditional sync.';

	// Order sync audit error messages.
	const MSG_ORDER_SYNC_AUDIT_NOT_FOUND = 'No audit records found for the specified order ID';

	// Attribute mapping error messages.
	const MSG_INVALID_PRODUCT_TYPE = 'Invalid product type provided.';
	const MSG_INVALID_MAPPING_TYPE = 'Invalid mapping type provided.';

	// Settings error messages.
	const MSG_INVALID_OPERATION_TYPE = 'Invalid operation type provided.';
	const MSG_INVALID_OPERATION      = 'Invalid operation provided.';
	const MSG_INVALID_CONFIGURATION  = 'Configuration must be an array or null.';

	/**
	 * HTTP Status codes
	 */
	const HTTP_OK                    = 200;
	const HTTP_CREATED               = 201;
	const HTTP_ACCEPTED              = 202;
	const HTTP_NO_CONTENT            = 204;
	const HTTP_BAD_REQUEST           = 400;
	const HTTP_UNAUTHORIZED          = 401;
	const HTTP_PAYMENT_REQUIRED      = 402;
	const HTTP_FORBIDDEN             = 403;
	const HTTP_NOT_FOUND             = 404;
	const HTTP_METHOD_NOT_ALLOWED    = 405;
	const HTTP_CONFLICT              = 409;
	const HTTP_GONE                  = 410;
	const HTTP_UNPROCESSABLE_ENTITY  = 422;
	const HTTP_INTERNAL_SERVER_ERROR = 500;
	const HTTP_SERVICE_UNAVAILABLE   = 503;

	// HTTP Request methods.
	const HTTP_REQUEST_METHOD_GET    = 'GET';
	const HTTP_REQUEST_METHOD_POST   = 'POST';
	const HTTP_REQUEST_METHOD_PUT    = 'PUT';
	const HTTP_REQUEST_METHOD_DELETE = 'DELETE';

	// Supplier Error Message Templates.
	const SUPPLIER_AUTH_FAILED                = '%s authentication failed: %s';
	const SUPPLIER_CONFIG_LOADING_FAILED      = '%s configuration loading failed: %s';
	const SUPPLIER_NO_AUTH_CONFIG             = '%s authentication failed: No authorization configuration found';
	const SUPPLIER_INVALID_AUTH_CONFIG        = '%s authentication failed: Invalid authorization configuration - %s';
	const SUPPLIER_NO_TEST_ENDPOINT           = '%s authentication failed: No suitable test endpoint found';
	const SUPPLIER_NO_TEST_ENDPOINT_AVAILABLE = '%s authentication failed: No test endpoint available';
	const SUPPLIER_NO_BODY_DATA               = '%s authentication failed: No body data found in request settings';
	const SUPPLIER_CONNECTION_FAILED          = '%s connection failed: %s';
	const SUPPLIER_FTP_CONNECTION_FAILED      = '%s FTP connection failed: %s';
	const SUPPLIER_NO_FTP_HOST                = '%s FTP connection failed: No FTP host configured';
	const SUPPLIER_NO_TEST_CONNECTION         = '%s FTP connection failed: No suitable test connection found (Premium Feature)';

	// Supplier Validation Messages.
	const SUPPLIER_MISSING_ACCESS_TOKEN    = 'Access token is required';
	const SUPPLIER_MISSING_CLIENT_ID       = 'Client id is required';
	const SUPPLIER_MISSING_CLIENT_SECRET   = 'Client secret is required';
	const SUPPLIER_MISSING_CUSTOMER_NUMBER = 'Client secret is required';
	const SUPPLIER_MISSING_COUNTRY_CODE    = 'Client secret is required';
	const SUPPLIER_MISSING_ENV_TYPE        = 'Client secret is required';
	const SUPPLIER_MISSING_USERNAME        = 'Username is required';
	const SUPPLIER_MISSING_PASSWORD        = 'Password is required';
	const SUPPLIER_MISSING_API_KEY         = 'API key is required';
	const SUPPLIER_MISSING                 = 'Atelast one supplier is required';
	const SUPPLIER_MISSING_DOMAIN          = '%s domain is required';
	const SUPPLIER_MISSING_CUSTOMER_KEY    = '%s customer key is required';
	const SUPPLIER_MISSING_CUSTOMER_SECRET = '%s customer secret is required';
	const SUPPLIER_INVALID_DOMAIN          = '%s domain must be a valid domain name';
	const SUPPLIER_INVALID_USERNAME        = '%s username must be at least 3 characters long';
	const SUPPLIER_AUTH_SUCCESSFUL         = '%s authentication successful';
	const SUPPLIER_MISSING_CUSTOMER_CODE   = '%s customer code is required';
	const SUPPLIER_MISSING_TOKEN_KEY       = '%s token key is required';
	const SUPPLIER_MISSING_ENTITY_NAME     = '%s entity name is required';
	const SUPPLIER_MISSING_ENTITY_ID       = '%s entity ID is required';
	const SUPPLIER_MISSING_COUNTRY         = '%s country is required';
	const SUPPLIER_MISSING_ACCOUNT_NUMBER  = '%s account number is required';
	const SUPPLIER_INVALID_COUNTRY         = '%s country must be a valid country code';
	const SUPPLIER_MISSING_DEALER_NUMBER   = '%s dealer number is required';
	const SUPPLIER_MISSING_APP_TYPE        = '%s app type is required';
	const SUPPLIER_INVALID_APP_TYPE        = '%s app type is invalid';
	const SUPPLIER_CONFIG_NOT_FOUND        = '%s configuration not found';
	const SUPPLIER_INVALID_JSON            = '%s invalid JSON in configuration file';
	const SUPPLIER_MISSING_REQUIRED_FIELD  = '%s missing required field';

	const FILTER          = 'filter';
	const OUTBOUND        = 'outbound';
	const INBOUND         = 'inbound';
	const MULTI_THREADING = 'multi-threading';
	const INTERDEPENDENT  = 'interdependent';
	const INDEPENDENT     = 'independent';

	// API error code.
	const EMPTY_SUGESTION = 'EMPTY_SUGESTION';

	// Product type.
	const SIMPLE_PRODUCT_SYNC                     = 'simple';
	const BASIC_VARIABLE_SYNC                     = 'basic_variable_sync';
	const PARENT_PRODUCT_IDENTIFIER_VARIABLE_SYNC = 'parent_product_identifier_variable_sync';

	const SYNC_RUNNING_STATUS_OFF = 'off';
	const SYNC_RUNNING_STATUS_ON  = 'on';

	// Product Structures.
	const VARIABLE = 'variable';
	const SIMPLE   = 'simple';

	const FILE_DOWNLOAD_FAILED = 'FILE_DOWNLOAD_FAILED';

	const OPERATION_TYPE_IMPORT_EXPORT = 'import-export';

	// Plan constants.
	const STANDARD             = 'standard';
	const PLAN_TYPE_STANDARD   = 'Standard';
	const PLAN_TYPE_PREMIUM    = 'Premium';
	const NO_PREVIEW_AVAILABLE = 'No preview available';

	// WooCommerce taxonomy constants.
	const WC_TAXONOMY_PRODUCT_BRAND    = 'product_brand';
	const WC_TAXONOMY_PRODUCT_CATEGORY = 'product_category';
	// Plugin status constants.
	const PLUGIN_STATUS_NOT_INSTALLED = 'not_installed';
	const PLUGIN_STATUS_INSTALLED     = 'installed';
	const PLUGIN_STATUS_ACTIVE        = 'active';

	// Plugin utility messages.
	const MSG_PLUGIN_SLUG_REQUIRED           = 'Plugin slug is required.';
	const MSG_PLUGIN_PATH_REQUIRED           = 'Plugin path is required.';
	const MSG_PLUGIN_NOT_INSTALLED           = 'Plugin is not installed on this site.';
	const MSG_PLUGIN_STATUS_CHECKED          = 'Plugin status checked successfully.';
	const MSG_PLUGIN_ACTIVATED               = 'Plugin activated successfully.';
	const MSG_PLUGIN_INSTALLED_ACTIVATED     = 'Plugin installed and activated successfully.';
	const MSG_PLUGIN_INSTALLATION_FAILED     = 'Plugin installation failed.';
	const MSG_PLUGIN_ACTIVATE_FAILED         = 'Failed to activate plugin: ';
	const MSG_PLUGIN_INSTALL_FAILED          = 'Failed to install plugin: ';
	const MSG_PLUGIN_INFO_FAILED             = 'Failed to retrieve plugin information: ';
	const MSG_PLUGIN_INSTALL_ACTIVATE_FAILED = 'Plugin installed but activation failed: ';
	const MSG_NO_INSTALL_PERMISSION          = 'You do not have permission to install plugins.';
	// Delimiter type constants.
	const DELIMITER_COMMA     = 'comma';
	const DELIMITER_PIPE      = 'pipe';
	const DELIMITER_TAB       = 'tab';
	const DELIMITER_SEMICOLON = 'semicolon';
	const DELIMITER_COLON     = 'colon';
	const DELIMITER_SPACE     = 'space';
	const DELIMITER_TILDE     = 'tilde';
	const DELIMITER_CARET     = 'caret';

	// Leftover product handling constants.
	const LEFTOVER_PRODUCT_DISCARD_YES = 'yes';
	const LEFTOVER_PRODUCT_DISCARD_NO  = 'no';

	/**
	 * Time unit constants.
	 */
	public const TIME_UNIT_HOURS = 'hours';
	public const TIME_UNIT_DAYS  = 'days';

	/**
	 * Trigger type constants.
	 */
	const TYPE_AMOUNT = 'amount';
	const TYPE_TIME   = 'time';

	const COUNTRY_CA = 'CA';
	const COUNTRY_US = 'US';
}
