<?php

namespace Hura8\Components\Order\AdminController;

use Hura8\Components\Order\Model\OrderStatusModel;

class AOrderStatusController
{
    /* @var OrderStatusModel $objOrderStatusModel */
    protected $objOrderStatusModel;

    public function __construct() {
        $this->objOrderStatusModel = new OrderStatusModel();
    }

    public function getStatusHistory($orderId){
        return $this->objOrderStatusModel->getStatusHistory($orderId);
    }

    public function createHistory($order_id, $status_type = 'order', $system_status = '', $comment = '', array $data= [], array $other_info = []) {
        return $this->objOrderStatusModel->createHistory($order_id, $status_type , $system_status , $comment, $data, $other_info);
    }

    public function getInfo($status_id) {
        return $this->objOrderStatusModel->getInfo($status_id);
    }

    public function getAll() {
        return $this->objOrderStatusModel->getAll();
    }

    public function delete($id) {
        return $this->objOrderStatusModel->delete($id);
    }

    public function update($id, array $info) {
        return $this->objOrderStatusModel->update($id, $info);
    }

    public function create(array $info) {
        return $this->objOrderStatusModel->create($info);
    }
}
