26 lines
681 B
PHP
26 lines
681 B
PHP
<?php
|
|
|
|
namespace Modules\IndustrialEngineering\Http\Controllers\Concerns;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Modules\IndustrialEngineering\Services\CodeGeneratorService;
|
|
|
|
trait ResolvesIeCodes
|
|
{
|
|
protected function resolveCodes(string $type, ?string $manualCode, Model $model, string $codeColumn): array
|
|
{
|
|
return app(CodeGeneratorService::class)->resolveCode(
|
|
$type,
|
|
$this->businessId(),
|
|
$manualCode,
|
|
$model,
|
|
$codeColumn
|
|
);
|
|
}
|
|
|
|
protected function suggestCode(string $type): string
|
|
{
|
|
return app(CodeGeneratorService::class)->suggest($type, $this->businessId());
|
|
}
|
|
}
|