osb/app/Interfaces/ProductItem.php

57 lines
1020 B
PHP
Raw Normal View History

<?php
namespace App\Interfaces;
2022-02-01 05:40:46 +00:00
use Illuminate\Support\Collection;
interface ProductItem
{
2022-02-01 05:40:46 +00:00
public function product();
2022-02-01 05:40:46 +00:00
public function supplied();
/**
2022-02-01 05:40:46 +00:00
* Return the traffic inclusion with the service
*
2022-02-01 05:40:46 +00:00
* @return mixed
*/
2022-02-01 05:40:46 +00:00
public function allowance(): Collection;
/**
2022-02-01 05:40:46 +00:00
* Render the traffic inclusion as a string
*
2022-02-01 05:40:46 +00:00
* @return mixed
*/
2022-02-01 05:40:46 +00:00
public function allowance_string(): string;
/**
2022-02-01 05:40:46 +00:00
* Return the contract term for this product when sold as a service
*
2022-02-01 05:40:46 +00:00
* @return int Months
*/
public function getContractTermAttribute(): int;
/**
2022-02-01 05:40:46 +00:00
* Return the product cost
*
2022-02-01 05:40:46 +00:00
* @return float
*/
2022-02-01 05:40:46 +00:00
public function getCostAttribute(): float;
/**
2022-02-01 05:40:46 +00:00
* Return the supplier class
* If there is a model relationship return:
* return $this->getRelationValue('supplier');
* otherwise return a stdClass with name
*
2022-02-01 05:40:46 +00:00
* @return mixed
*/
2022-02-01 05:40:46 +00:00
public function getSupplierAttribute();
/**
2022-02-01 05:40:46 +00:00
* Does this offering capture usage information
*
2022-02-01 05:40:46 +00:00
* @return bool
*/
2022-02-01 05:40:46 +00:00
public function hasUsage(): bool;
}