<?php

namespace Easymailing\App\Core\Provider\Woocommerce\Model;

class BatchSynchronizationStatus
{

	const IN_PROGRESS = 'in_progress';
	const SCHEDULED = 'scheduled';
	const SUCCESS = 'success';
	const ERROR = 'error';
	const CANCELED = 'canceled';

	public static function getStatuses(): array
	{
		return [
			self::IN_PROGRESS,
			self::SCHEDULED,
			self::SUCCESS,
			self::ERROR,
			self::CANCELED,
		];
	}


	public static function getTitle($status): string
	{
		switch($status) {
			case self::IN_PROGRESS:
				return __( 'En proceso', 'easymailing' );
			case self::SCHEDULED:
				return __( 'Programada', 'easymailing' );
			case self::SUCCESS:
				return __( 'Completada', 'easymailing' );
			case self::ERROR:
				return __( 'Error', 'easymailing' );
			case self::CANCELED:
				return __( 'Cancelada', 'easymailing' );
			default:
				return __( 'No sincronizado', 'easymailing' );
		}
	}


	public static function getClass($status): string
	{
		switch($status) {
			case self::SCHEDULED:
			case self::IN_PROGRESS:
				return 'info';
			case self::SUCCESS:
				return 'success';
			case self::CANCELED:
			case self::ERROR:
				return 'danger';
			default:
				return 'warning';
		}
	}

}
