Refactor: Enforce type safety, fix close deadlock, implement assignee restrictions and notify admin fallbacks
This commit is contained in:
@@ -6,11 +6,23 @@ use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
use App\Enums\ServiceType;
|
||||
use App\Enums\ContractStatus;
|
||||
|
||||
#[Fillable(['product_id', 'service_type', 'status', 'actual_collection_date', 'remark'])]
|
||||
class ProductService extends Model
|
||||
{
|
||||
protected $table = 'product_services';
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'service_type' => ServiceType::class,
|
||||
'status' => ContractStatus::class,
|
||||
'actual_collection_date' => 'date',
|
||||
];
|
||||
}
|
||||
|
||||
public function product(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
|
||||
Reference in New Issue
Block a user