72 lines
1.8 KiB
PHP
72 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Ambulatorio;
|
|
|
|
use App\Models\Ambulatorio\ParametrizacaoInfraestruturaAssinaturaEletronica;
|
|
use App\Models\Ambulatorio\ParametrizacaoInfraestruturaEspecialidade;
|
|
use App\Models\Cadastro\Estabelecimento\Infraestrutura;
|
|
use App\Models\Model;
|
|
|
|
class ParametrizacaoInfraestrutura extends Model
|
|
{
|
|
protected $table = 'ambulatorio_parametrizacao_infraestrutura';
|
|
|
|
protected $casts = [
|
|
'envia_sms' => 'boolean',
|
|
'fatura_procedimento_raas' => 'boolean',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'infraestrutura_id',
|
|
'envia_sms',
|
|
'fatura_procedimento_raas',
|
|
];
|
|
|
|
protected $hidden = [
|
|
'created_at',
|
|
'created_lotacao_id',
|
|
'created_centro_custo_id',
|
|
'updated_at',
|
|
'updated_lotacao_id',
|
|
'updated_centro_custo_id',
|
|
];
|
|
|
|
public function infraestrutura()
|
|
{
|
|
return $this->belongsTo(Infraestrutura::class);
|
|
}
|
|
|
|
public function sms()
|
|
{
|
|
return $this->hasOne(ParametrizacaoInfraestruturaSms::class);
|
|
}
|
|
|
|
public function ocupacoes()
|
|
{
|
|
return $this->hasMany(ParametrizacaoInfraestruturaOcupacao::class);
|
|
}
|
|
|
|
public function especialidades()
|
|
{
|
|
return $this->hasMany(ParametrizacaoInfraestruturaEspecialidade::class);
|
|
}
|
|
|
|
public function assinaturas()
|
|
{
|
|
return $this->hasMany(ParametrizacaoInfraestruturaAssinaturaEletronica::class);
|
|
}
|
|
|
|
public function infraestruturasAgendadoras()
|
|
{
|
|
return $this->hasMany(ParametrizacaoInfraestruturaAgendadora::class);
|
|
}
|
|
|
|
public function servicos()
|
|
{
|
|
return $this->belongsToMany(Servico::class, 'ambulatorio_parametrizacao_infraestrutura_servico')
|
|
->using(ParametrizacaoInfraestruturaServico::class)
|
|
->as('parametrizacaoInfraestruturaServico')
|
|
->withTimestamps();
|
|
}
|
|
}
|