<?php

namespace App\Services;

use App\Models\Asset;
use App\User;

class JiraDescription
{
	public function getStatusDescription($status, $data, $asset, $comments = null)
    {
    	$namespace = "\App\Services\JiraDescriptions\\";

        $statusClass = str_replace(' ', '', trim($status));
        $statusClass = str_replace('/', '', $statusClass);
        $statusClass = str_replace('-', '', $statusClass);


        $className = $namespace."DescriptionFor".$statusClass;

        if (!class_exists($className)) {
            $className = $namespace."DescriptionForCommon";
        }

        $class = new $className;
        return $class->description($status, $data, $asset, $comments);
    }
}