Commit 1e6c9ff6 authored by Mardonio Costa's avatar Mardonio Costa

Inicial

parents
Pipeline #121 canceled with stages
/nbproject/
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Configuration;
use Doctrine\ORM\QueryBuilder;
use Novosga\Entity\Unidade;
use Novosga\Entity\Usuario;
use Novosga\Infrastructure\StorageInterface;
/**
* OrderingParameter
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class OrderingParameter implements ParameterInterface
{
/**
* @var Unidade
*/
private $unidade;
/**
* @var Usuario
*/
private $usuario;
/**
* @var StorageInterface
*/
private $storage;
/**
* @var QueryBuilder
*/
private $queryBuilder;
public function getUnidade(): Unidade
{
return $this->unidade;
}
public function getUsuario(): ?Usuario
{
return $this->usuario;
}
public function getStorage(): StorageInterface
{
return $this->storage;
}
public function getQueryBuilder(): QueryBuilder
{
return $this->queryBuilder;
}
public function setUnidade(Unidade $unidade)
{
$this->unidade = $unidade;
return $this;
}
public function setUsuario(?Usuario $usuario)
{
$this->usuario = $usuario;
return $this;
}
public function setStorage(StorageInterface $storage)
{
$this->storage = $storage;
return $this;
}
public function setQueryBuilder(QueryBuilder $queryBuilder)
{
$this->queryBuilder = $queryBuilder;
return $this;
}
}
\ No newline at end of file
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Configuration;
/**
* Configuration file parameter interface
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface ParameterInterface
{
}
\ No newline at end of file
This diff is collapsed.
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* AbstractAtendimentoCodificado
* atendimento codificado (servico realizado).
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
abstract class AbstractAtendimentoCodificado
{
/**
* @var Servico
*/
protected $servico;
/**
* @var int
*/
protected $peso;
abstract public function getAtendimento();
abstract public function setAtendimento(AbstractAtendimento $atendimento);
public function getServico()
{
return $this->servico;
}
public function setServico($servico)
{
$this->servico = $servico;
}
public function getPeso()
{
return $this->peso;
}
public function setPeso($peso)
{
$this->peso = $peso;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Abstract metadata.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
abstract class AbstractMetadata implements \JsonSerializable
{
/**
* @var string
*/
protected $namespace;
/**
* @var string
*/
protected $name;
/**
* @var mixed
*/
protected $value;
public function getNamespace()
{
return $this->namespace;
}
public function setNamespace(string $namespace)
{
$this->namespace = $namespace;
return $this;
}
public function getName()
{
return $this->name;
}
public function getValue()
{
return $this->value;
}
public function setName(string $name)
{
$this->name = $name;
return $this;
}
public function setValue($value)
{
$this->value = $value;
return $this;
}
public function jsonSerialize()
{
return [
'namespace' => $this->getName(),
'name' => $this->getNamespace(),
'value' => $this->getValue(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
use DateTime;
/**
* Agendamento.
*
* @author rogerio
*/
class Agendamento implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var DateTime
*/
private $data;
/**
* @var DateTime
*/
private $hora;
/**
* @var Cliente
*/
private $cliente;
/**
* @var Unidade
*/
private $unidade;
/**
* @var Servico
*/
private $servico;
/**
* @var DateTime
*/
private $dataConfirmacao;
public function __construct()
{
}
public function getId()
{
return $this->id;
}
public function getData()
{
return $this->data;
}
public function getHora()
{
return $this->hora;
}
public function getCliente()
{
return $this->cliente;
}
public function getUnidade()
{
return $this->unidade;
}
public function getServico()
{
return $this->servico;
}
public function getDataConfirmacao()
{
return $this->dataConfirmacao;
}
public function setData(DateTime $data = null)
{
$this->data = $data;
return $this;
}
public function setHora(DateTime $hora = null)
{
$this->hora = $hora;
return $this;
}
public function setCliente(Cliente $cliente = null)
{
$this->cliente = $cliente;
return $this;
}
public function setUnidade(Unidade $unidade = null)
{
$this->unidade = $unidade;
return $this;
}
public function setServico(Servico $servico = null)
{
$this->servico = $servico;
return $this;
}
public function setDataConfirmacao(DateTime $dataConfirmacao)
{
$this->dataConfirmacao = $dataConfirmacao;
return $this;
}
public function __toString()
{
return $this->getId();
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'cliente' => $this->getCliente(),
'servico' => $this->getServico(),
'unidade' => $this->getUnidade(),
'data' => $this->getData() ? $this->getData()->format('Y-m-d') : null,
'hora' => $this->getHora() ? $this->getHora()->format('H:i') : null,
'dataConfirmacao' => $this->getDataConfirmacao(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
* Classe Atendimento
* contem o Cliente, o Servico e o Status do atendimento.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Atendimento extends AbstractAtendimento
{
/**
* @var AtendimentoCodificado[]
*/
private $codificados;
public function __construct()
{
parent::__construct();
$this->codificados = new ArrayCollection();
}
public function getCodificados()
{
return $this->codificados;
}
public function setCodificados(Collection $codificados)
{
$this->codificados = $codificados;
return $this;
}
/**
* Atendimento hash.
*
* @return string
*/
public function hash()
{
return sha1("{$this->getId()}:{$this->getDataChegada()->getTimestamp()}");
}
public function jsonSerialize($minimal = false)
{
$arr = parent::jsonSerialize($minimal);
$arr['hash'] = $this->hash();
return $arr;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Classe Atendimento Codificado
* representa o atendimento codificado (servico realizado).
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class AtendimentoCodificado extends AbstractAtendimentoCodificado
{
/**
* @var Atendimento
*/
private $atendimento;
public function getAtendimento()
{
return $this->atendimento;
}
public function setAtendimento(AbstractAtendimento $atendimento)
{
$this->atendimento = $atendimento;
return $this;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Classe Atendimento Codificado (Historico)
* representa o atendimento codificado (servico realizado).
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class AtendimentoCodificadoHistorico extends AbstractAtendimentoCodificado
{
/**
* @var AtendimentoHistorico
*/
private $atendimento;
public function getAtendimento()
{
return $this->atendimento;
}
public function setAtendimento(AbstractAtendimento $atendimento)
{
$this->atendimento = $atendimento;
return $this;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
* AtendimentoHistorico
* historico de atendimento do banco de dados.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class AtendimentoHistorico extends AbstractAtendimento
{
/**
* @var AtendimentoCodificadoHistorico[]
*/
private $codificados;
public function __construct()
{
$this->codificados = new ArrayCollection();
}
public function getCodificados()
{
return $this->codificados;
}
public function setCodificados(Collection $codificados)
{
$this->codificados = $codificados;
return $this;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* AtendimentoMeta (Historico).
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class AtendimentoHistoricoMeta extends EntityMetadata
{
public function getAtendimento()
{
return $this->getEntity();
}
public function setAtendimento(AtendimentoHistorico $atendimento)
{
return $this->setEntity($atendimento);
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* AtendimentoMeta.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class AtendimentoMeta extends EntityMetadata
{
public function getAtendimento()
{
return $this->getEntity();
}
public function setAtendimento(Atendimento $atendimento)
{
return $this->setEntity($atendimento);
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Cliente.
*
* @author rogerio
*/
class Cliente implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $documento;
/**
* @var string
*/
private $email;
/**
* @var string
*/
private $telefone;
public function __construct()
{
}
public function getId()
{
return $this->id;
}
public function getNome()
{
return $this->nome;
}
public function getDocumento()
{
return $this->documento;
}
public function getEmail()
{
return $this->email;
}
public function getTelefone()
{
return $this->telefone;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function setNome($nome)
{
$this->nome = $nome;
return $this;
}
public function setDocumento($documento)
{
$this->documento = $documento;
return $this;
}
public function setEmail($email)
{
$this->email = $email;
return $this;
}
public function setTelefone($telefone)
{
$this->telefone = $telefone;
return $this;
}
public function __toString()
{
return $this->getNome();
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'documento' => $this->getDocumento(),
'email' => $this->getEmail(),
'telefone' => $this->getTelefone(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* ClienteMeta
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class ClienteMeta extends EntityMetadata
{
public function getCliente()
{
return $this->getEntity();
}
public function setCliente(Cliente $cliente)
{
return $this->setEntity($cliente);
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
class ConfiguracaoImpressao implements \JsonSerializable
{
/**
* @var Unidade
*/
private $unidade;
/**
* @var string
*/
private $cabecalho;
/**
* @var string
*/
private $rodape;
/**
* @var bool
*/
private $exibirNomeServico;
/**
* @var bool
*/
private $exibirNomeUnidade;
/**
* @var bool
*/
private $exibirMensagemServico;
/**
* @var bool
*/
private $exibirData;
/**
* @var bool
*/
private $exibirPrioridade;
public function __construct(Unidade $unidade)
{
$this->unidade = $unidade;
$this->cabecalho = 'Novo SGA';
$this->rodape = 'Novo SGA';
$this->exibirData = true;
$this->exibirMensagemServico = true;
$this->exibirNomeServico = true;
$this->exibirNomeUnidade = true;
$this->exibirPrioridade = true;
}
public function getUnidade()
{
return $this->unidade;
}
public function getCabecalho()
{
return $this->cabecalho;
}
public function getRodape()
{
return $this->rodape;
}
public function getExibirNomeServico()
{
return $this->exibirNomeServico;
}
public function getExibirNomeUnidade()
{
return $this->exibirNomeUnidade;
}
public function getExibirMensagemServico()
{
return $this->exibirMensagemServico;
}
public function getExibirData()
{
return $this->exibirData;
}
public function getExibirPrioridade()
{
return $this->exibirPrioridade;
}
public function setUnidade(Unidade $unidade)
{
$this->unidade = $unidade;
return $this;
}
public function setCabecalho($cabecalho)
{
$this->cabecalho = $cabecalho;
return $this;
}
public function setRodape($rodape)
{
$this->rodape = $rodape;
return $this;
}
public function setExibirNomeServico($exibirNomeServico)
{
$this->exibirNomeServico = $exibirNomeServico;
return $this;
}
public function setExibirNomeUnidade($exibirNomeUnidade)
{
$this->exibirNomeUnidade = $exibirNomeUnidade;
return $this;
}
public function setExibirMensagemServico($exibirMensagemServico)
{
$this->exibirMensagemServico = $exibirMensagemServico;
return $this;
}
public function setExibirData($exibirData)
{
$this->exibirData = $exibirData;
return $this;
}
public function setExibirPrioridade($exibirPrioridade)
{
$this->exibirPrioridade = $exibirPrioridade;
return $this;
}
public function jsonSerialize()
{
return [
'cabecalho' => $this->getCabecalho(),
'rodape' => $this->getRodape(),
'exibirData' => $this->getExibirData(),
'exibirPrioridade' => $this->getExibirPrioridade(),
'exibirNomeUnidade' => $this->getExibirNomeUnidade(),
'exibirNomeServico' => $this->getExibirNomeServico(),
'exibirMensagemServico' => $this->getExibirMensagemServico(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Ticket counter.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Contador implements \JsonSerializable
{
/**
* @var Unidade
*/
private $unidade;
/**
* @var Servico
*/
private $servico;
/**
* @var int
*/
private $numero;
/**
* Get the value of Unidade
*
* @return Unidade
*/
public function getUnidade()
{
return $this->unidade;
}
/**
* Set the value of Unidade
*
* @param Unidade unidade
*
* @return self
*/
public function setUnidade(Unidade $unidade)
{
$this->unidade = $unidade;
return $this;
}
/**
* Get the value of Servico
*
* @return Servico
*/
public function getServico()
{
return $this->servico;
}
/**
* Set the value of Servico
*
* @param Servico servico
*
* @return self
*/
public function setServico(Servico $servico)
{
$this->servico = $servico;
return $this;
}
/**
* Get the value of Atual
*
* @return int
*/
public function getNumero()
{
return $this->numero;
}
/**
* Set the value of Atual
*
* @param int atual
*
* @return self
*/
public function setNumero($numero)
{
$this->numero = $numero;
return $this;
}
public function jsonSerialize()
{
return [
'numero' => $this->getNumero(),
'servico' => $this->getServico()
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Departamento
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Departamento implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $descricao;
/**
* @var int
*/
private $ativo;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
public function __construct()
{
$this->ativo = true;
}
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function setNome($nome)
{
$this->nome = $nome;
}
public function getNome()
{
return $this->nome;
}
public function setDescricao($desc)
{
$this->descricao = $desc;
}
public function getDescricao()
{
return $this->descricao;
}
public function isAtivo(): bool
{
return $this->ativo;
}
public function setAtivo(bool $ativo)
{
$this->ativo = $ativo;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function __toString()
{
return $this->getNome();
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'descricao' => $this->getDescricao(),
'ativo' => $this->isAtivo(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Abstract metadata.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
abstract class EntityMetadata extends AbstractMetadata
{
/**
* @var mixed
*/
protected $entity;
public function setEntity($entity)
{
$this->entity = $entity;
return $this;
}
public function getEntity()
{
return $this->entity;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Local de atendimento
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Local implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function setNome($nome)
{
$this->nome = $nome;
return $this;
}
public function getNome()
{
return $this->nome;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function __toString()
{
return $this->getNome();
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Definição de onde o usuário está lotado
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Lotacao implements \JsonSerializable
{
/**
* @var int
*/
private $id;
/**
* @var Usuario
*/
private $usuario;
/**
* @var Unidade
*/
private $unidade;
/**
* @var Perfil
*/
private $perfil;
public function __construct()
{
}
public function getId()
{
return $this->id;
}
/**
* Modifica usuario.
*
* @param $usuario
*
* @return none
*/
public function setUsuario(Usuario $usuario)
{
$this->usuario = $usuario;
}
/**
* Retorna objeto usuario.
*
* @return Usuario $usuario
*/
public function getUsuario()
{
return $this->usuario;
}
/**
* Modifica unidade.
*
* @param $unidade
*/
public function setUnidade(Unidade $unidade)
{
$this->unidade = $unidade;
}
/**
* Retorna objeto Unidade.
*
* @return Unidade
*/
public function getUnidade()
{
return $this->unidade;
}
/**
* Modifica perfil.
*
* @param $perfil
*
* @return none
*/
public function setPerfil(Perfil $perfil)
{
$this->perfil = $perfil;
}
/**
* Retorna objeto Perfil.
*
* @return Perfil $perfil
*/
public function getPerfil()
{
return $this->perfil;
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'perfil' => $this->getPerfil(),
'unidade' => $this->getUnidade(),
'usuario' => $this->getUsuario(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* System metadata.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Metadata extends AbstractMetadata
{
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Painel
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Painel implements \JsonSerializable
{
/**
* @var int
*/
private $host;
/**
* @var string
*/
private $senha;
/**
* @var Unidade
*/
private $unidade;
/**
* @var PainelServico[]
*/
private $servicos;
public function getHost()
{
return $this->host;
}
public function setHost($host)
{
$this->host = $host;
}
public function getUnidade()
{
return $this->unidade;
}
public function setUnidade($unidade)
{
$this->unidade = $unidade;
}
public function getServicos()
{
return $this->servicos;
}
public function setServicos($servicos)
{
$this->servicos = $servicos;
}
public function getIp()
{
return long2ip($this->getHost());
}
public function __toString()
{
return $this->getIp();
}
public function jsonSerialize()
{
return [
'host' => $this->getHost(),
'ip' => $this->getIp(),
'servicos' => $this->getServicos(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Senha enviada ao painel
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class PainelSenha implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var Servico
*/
private $servico;
/**
* @var Unidade
*/
private $unidade;
/**
* @var int
*/
private $numeroSenha;
/**
* @var string
*/
private $siglaSenha;
/**
* @var string
*/
private $mensagem;
/**
* @var string
*/
private $local;
/**
* @var int
*/
private $numeroLocal;
/**
* @var int
*/
private $peso;
/**
* @var string
*/
private $prioridade;
/**
* @var string
*/
private $nomeCliente;
/**
* @var string
*/
private $documentoCliente;
public function getServico()
{
return $this->servico;
}
public function setServico($servico)
{
$this->servico = $servico;
}
public function getUnidade()
{
return $this->unidade;
}
public function setUnidade($unidade)
{
$this->unidade = $unidade;
}
public function getNumeroSenha()
{
return $this->numeroSenha;
}
public function setNumeroSenha($numeroSenha)
{
$this->numeroSenha = $numeroSenha;
}
public function getSiglaSenha()
{
return $this->siglaSenha;
}
public function setSiglaSenha($siglaSenha)
{
$this->siglaSenha = $siglaSenha;
}
public function getMensagem()
{
return $this->mensagem;
}
public function setMensagem($mensagem)
{
$this->mensagem = $mensagem;
}
public function getLocal()
{
return $this->local;
}
public function setLocal($local)
{
$this->local = $local;
}
public function getNumeroLocal()
{
return $this->numeroLocal;
}
public function setNumeroLocal($numeroLocal)
{
$this->numeroLocal = $numeroLocal;
}
public function getPeso()
{
return $this->peso;
}
public function setPeso($peso)
{
$this->peso = $peso;
}
public function getPrioridade()
{
return $this->prioridade;
}
public function getNomeCliente()
{
return $this->nomeCliente;
}
public function getDocumentoCliente()
{
return $this->documentoCliente;
}
public function setPrioridade($prioridade)
{
$this->prioridade = $prioridade;
}
public function setNomeCliente($nomeCliente)
{
$this->nomeCliente = $nomeCliente;
}
public function setDocumentoCliente($documentoCliente)
{
$this->documentoCliente = $documentoCliente;
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'senha' => $this->getSiglaSenha().str_pad($this->getNumeroSenha(), 3, '0', STR_PAD_LEFT),
'local' => $this->getLocal(),
'numeroLocal' => $this->getNumeroLocal(),
'peso' => $this->getPeso(),
'prioridade' => $this->getPrioridade(),
'nomeCliente' => $this->getNomeCliente(),
'documentoCliente' => $this->getDocumentoCliente(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* PainelServico
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class PainelServico implements \JsonSerializable
{
/**
* @var Painel
*/
private $painel;
/**
* @var Servico
*/
private $servico;
/**
* @var Unidade
*/
private $unidade;
public function getPainel()
{
return $this->painel;
}
public function setPainel($painel)
{
$this->painel = $painel;
}
public function getServico()
{
return $this->servico;
}
public function setServico($servico)
{
$this->servico = $servico;
}
public function getUnidade()
{
return $this->unidade;
}
public function setUnidade($unidade)
{
$this->unidade = $unidade;
}
public function jsonSerialize()
{
return [
'painel' => $this->getPainel(),
'servico' => $this->getServico(),
'unidade' => $this->getUnidade(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Classe Perfil
* O perfil define permissões de acesso a módulos do sistema.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Perfil implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $descricao;
/**
* @var Modulo[]
*/
private $modulos;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
public function __construct()
{
$this->modulos = [];
}
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Define o nome do perfil.
*
* @param string $nome
*/
public function setNome($nome)
{
$this->nome = $nome;
}
/**
* Retorna a descrição do perfil.
*
* @return int
*/
public function getDescricao()
{
return $this->descricao;
}
/**
* Define a descrição do perfil.
*
* @param string $descricao
*/
public function setDescricao($descricao)
{
$this->descricao = $descricao;
}
/**
* Retorna o nome do perfil.
*
* @return string
*/
public function getNome()
{
return $this->nome;
}
public function getModulos()
{
return $this->modulos;
}
public function setModulos($modulos)
{
$this->modulos = $modulos;
return $this;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function __toString()
{
return $this->nome;
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'descricao' => $this->getDescricao(),
'modulos' => $this->getModulos(),
'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Prioridade
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Prioridade implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $descricao;
/**
* @var int
*/
private $peso;
/**
* @var int
*/
private $ativo;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
/**
* @var \DateTime
*/
private $deletedAt;
public function __construct()
{
$this->ativo = true;
}
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function setNome($nome)
{
$this->nome = $nome;
}
public function getNome()
{
return $this->nome;
}
public function setDescricao($desc)
{
$this->descricao = $desc;
}
public function getDescricao()
{
return $this->descricao;
}
public function setPeso($peso)
{
$this->peso = $peso;
}
public function getPeso()
{
return $this->peso;
}
public function isAtivo(): bool
{
return $this->ativo;
}
public function setAtivo(bool $ativo)
{
$this->ativo = $ativo;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function getDeletedAt()
{
return $this->deletedAt;
}
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function setDeletedAt(\DateTime $deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
public function __toString()
{
return $this->getNome();
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'descricao' => $this->getDescricao(),
'peso' => $this->getPeso(),
'ativo' => $this->isAtivo(),
'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
'deletedAt' => $this->getDeletedAt() ? $this->getDeletedAt()->format('Y-m-d\TH:i:s') : null,
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Classe Senha
* Responsavel pelas informacoes do Senha.
*
* @author Rogério Lino <rogeriolino@gmail.com>
*/
class Senha implements \JsonSerializable
{
const LENGTH = 3;
/**
* @var string
*/
private $sigla;
/**
* @var int
*/
private $numero;
public function __construct()
{
}
/**
* Define a sigla da senha.
*
* @param char $sigla
*/
public function setSigla($sigla)
{
$this->sigla = $sigla;
}
/**
* Retorna a sigla da senha.
*
* @return char $sigla
*/
public function getSigla()
{
return $this->sigla;
}
/**
* Define o numero da senha.
*
* @param int $numero
*/
public function setNumero($numero)
{
$this->numero = $numero;
}
/**
* Retorna o numero da senha.
*
* @return int $numero
*/
public function getNumero()
{
return $this->numero;
}
/**
* Retorna o numero da senha preenchendo com zero (esquerda).
*
* @return string
*/
public function getNumeroZeros()
{
return str_pad($this->getNumero(), self::LENGTH, '0', STR_PAD_LEFT);
}
/**
* Retorna a senha formatada para exibicao.
*
* @return string
*/
public function __toString()
{
return $this->getSigla() . $this->getNumeroZeros();
}
public function jsonSerialize()
{
return [
'sigla' => $this->getSigla(),
'numero' => $this->getNumero(),
'format' => $this->__toString(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Servico
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Servico implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $descricao;
/**
* @var int
*/
private $ativo;
/**
* @var int
*/
private $peso;
/**
* @var Servico
*/
private $mestre;
/**
* @var Servico[]
*/
private $subServicos;
/**
* @var ServicoUnidade[]
*/
private $servicosUnidade;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
/**
* @var \DateTime
*/
private $deletedAt;
public function __construct()
{
$this->ativo = true;
$this->subServicos = new \Doctrine\Common\Collections\ArrayCollection();
$this->servicosUnidade = new \Doctrine\Common\Collections\ArrayCollection();
}
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function setNome($nome)
{
$this->nome = $nome;
}
public function getNome()
{
return $this->nome;
}
public function setDescricao($descricao)
{
$this->descricao = $descricao;
}
public function getDescricao()
{
return $this->descricao;
}
public function setMestre(Servico $servico = null)
{
$this->mestre = $servico;
}
public function getMestre()
{
return $this->mestre;
}
public function isMestre()
{
return ($this->getId() && !$this->getMestre());
}
public function setAtivo(bool $ativo)
{
$this->ativo = $ativo;
}
public function isAtivo(): bool
{
return $this->ativo;
}
public function getPeso()
{
return $this->peso;
}
public function setPeso($peso)
{
$this->peso = $peso;
}
public function getSubServicos()
{
return $this->subServicos;
}
public function setSubServicos($subServicos)
{
$this->subServicos = $subServicos;
}
public function getServicosUnidade()
{
return $this->servicosUnidade;
}
public function setServicosUnidade(array $servicosUnidade)
{
$this->servicosUnidade = $servicosUnidade;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function getDeletedAt()
{
return $this->deletedAt;
}
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function setDeletedAt(\DateTime $deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
public function __toString()
{
return $this->nome;
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'descricao' => $this->getDescricao(),
'peso' => $this->getPeso(),
'ativo' => $this->isAtivo(),
'macro' => $this->getMestre(),
'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
'deletedAt' => $this->getDeletedAt() ? $this->getDeletedAt()->format('Y-m-d\TH:i:s') : null,
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Servico metadata.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class ServicoMeta extends EntityMetadata
{
public function getServico()
{
return $this->getEntity();
}
public function setServico(Servico $servico)
{
return $this->setEntity($servico);
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Servico Unidade
* Configuração do serviço na unidade
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class ServicoUnidade implements \JsonSerializable
{
/**
* @var Servico
*/
private $servico;
/**
* @var Unidade
*/
private $unidade;
/**
* @var Departamento
*/
private $departamento;
/**
* @var Local
*/
private $local;
/**
* @var string
*/
private $sigla;
/**
* @var int
*/
private $ativo;
/**
* @var int
*/
private $peso;
/**
* @var bool
*/
private $prioridade;
/**
* @var int
*/
private $incremento;
/**
* @var int
*/
private $numeroInicial;
/**
* @var int
*/
private $numeroFinal;
/**
* @var string
*/
private $mensagem;
public function __construct()
{
$this->prioridade = true;
$this->numeroInicial = 1;
$this->incremento = 1;
}
/**
* @return Servico
*/
public function getServico()
{
return $this->servico;
}
public function setServico(Servico $servico)
{
$this->servico = $servico;
}
/**
* @return Unidade
*/
public function getUnidade()
{
return $this->unidade;
}
public function setUnidade(Unidade $unidade)
{
$this->unidade = $unidade;
}
public function setDepartamento(Departamento $departamento = null)
{
$this->departamento = $departamento;
}
public function getDepartamento()
{
return $this->departamento;
}
/**
* @return Local
*/
public function getLocal()
{
return $this->local;
}
public function setLocal(Local $local)
{
$this->local = $local;
}
public function setAtivo(bool $ativo)
{
$this->ativo = !!$ativo;
}
public function isAtivo(): bool
{
return $this->ativo;
}
public function getPeso()
{
return $this->peso;
}
public function setPeso($peso)
{
$this->peso = $peso;
}
public function setSigla($sigla)
{
$this->sigla = $sigla;
}
public function getSigla()
{
return $this->sigla;
}
public function getPrioridade()
{
return $this->prioridade;
}
public function getIncremento()
{
return $this->incremento;
}
public function getNumeroInicial()
{
return $this->numeroInicial;
}
public function getNumeroFinal()
{
return $this->numeroFinal;
}
public function setPrioridade($prioridade)
{
$this->prioridade = $prioridade;
return $this;
}
public function setIncremento($incremento)
{
$this->incremento = $incremento;
return $this;
}
public function setNumeroInicial($numeroInicial)
{
$this->numeroInicial = $numeroInicial;
return $this;
}
public function setNumeroFinal($numeroFinal)
{
$this->numeroFinal = $numeroFinal;
return $this;
}
public function getMensagem()
{
return $this->mensagem;
}
public function setMensagem($mensagem)
{
$this->mensagem = $mensagem;
return $this;
}
public function __toString()
{
return $this->sigla.' - '.$this->getServico()->getNome();
}
public function jsonSerialize()
{
return [
'sigla' => $this->getSigla(),
'peso' => $this->getPeso(),
'local' => $this->getLocal(),
'servico' => $this->getServico(),
'departamento' => $this->getDepartamento(),
'ativo' => $this->isAtivo(),
'prioridade' => $this->getPrioridade(),
'mensagem' => $this->getMensagem(),
'numeroInicial' => $this->getNumeroInicial(),
'numeroFinal' => $this->getNumeroFinal(),
'incremento' => $this->getIncremento()
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Servico Usuario
* Configuração do serviço que o usuário atende
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class ServicoUsuario implements \JsonSerializable
{
/**
* @var Servico
*/
private $servico;
/**
* @var Unidade
*/
private $unidade;
/**
* @var Usuario
*/
private $usuario;
/**
* @var int
*/
private $peso;
public function __construct()
{
}
public function getServico()
{
return $this->servico;
}
public function setServico($servico)
{
$this->servico = $servico;
}
public function getUnidade()
{
return $this->unidade;
}
public function setUnidade($unidade)
{
$this->unidade = $unidade;
}
/**
* @return Usuario
*/
public function getUsuario()
{
return $this->usuario;
}
public function setUsuario($usuario)
{
$this->usuario = $usuario;
}
public function getPeso()
{
return $this->peso;
}
public function setPeso($peso)
{
$this->peso = $peso;
return $this;
}
public function jsonSerialize()
{
return [
'peso' => $this->getPeso(),
'servico' => $this->getServico(),
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Unidade de atendimento.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Unidade implements \JsonSerializable
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $descricao;
/**
* @var bool
*/
private $ativo;
/**
* @var ConfiguracaoImpressao
*/
private $impressao;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
/**
* @var \DateTime
*/
private $deletedAt;
public function __construct()
{
$this->ativo = true;
$this->impressao = new ConfiguracaoImpressao($this);
}
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getDescricao()
{
return $this->descricao;
}
public function setDescricao($descricao)
{
$this->descricao = $descricao;
return $this;
}
public function setNome($nome)
{
$this->nome = $nome;
}
public function getNome()
{
return $this->nome;
}
public function isAtivo(): bool
{
return $this->ativo;
}
public function setAtivo(bool $ativo)
{
$this->ativo = $ativo;
}
public function getImpressao()
{
return $this->impressao;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function getDeletedAt()
{
return $this->deletedAt;
}
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function setDeletedAt(\DateTime $deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
public function __toString()
{
return $this->getNome();
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'nome' => $this->getNome(),
'descricao' => $this->getDescricao(),
'ativo' => $this->isAtivo(),
'impressao' => $this->getImpressao(),
'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
'deletedAt' => $this->getDeletedAt() ? $this->getDeletedAt()->format('Y-m-d\TH:i:s') : null,
];
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Unidade metadata.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class UnidadeMeta extends EntityMetadata
{
public function getUnidade()
{
return $this->getEntity();
}
public function setUnidade(Unidade $unidade)
{
return $this->setEntity($unidade);
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
use DateTime;
use Symfony\Component\Security\Core\Encoder\EncoderAwareInterface;
use Symfony\Component\Security\Core\User\EquatableInterface;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* Usuario
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Usuario implements
\Serializable,
\JsonSerializable,
UserInterface,
EquatableInterface,
EncoderAwareInterface
{
/**
* @var mixed
*/
protected $id;
/**
* @var string
*/
private $login;
/**
* @var string
*/
private $nome;
/**
* @var string
*/
private $sobrenome;
/**
* @var string
*/
private $email;
/**
* @var string
*/
private $senha;
/**
* @var bool
*/
private $ativo;
/**
* @var DateTime
*/
private $ultimoAcesso;
/**
* @var string
*/
private $ip;
/**
* @var string
*/
private $sessionId;
/**
* @var Lotacao[]
*/
private $lotacoes;
/**
* @var Lotacao
*/
private $lotacao;
/**
* @var bool
*/
private $admin;
/**
* @var string
*/
private $algorithm;
/**
* @var string
*/
private $salt;
/**
* @var array
*/
private $roles = [];
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var \DateTime
*/
private $updatedAt;
/**
* @var \DateTime
*/
private $deletedAt;
private $permissoes;
public function __construct()
{
$this->ativo = true;
$this->lotacoes = new \Doctrine\Common\Collections\ArrayCollection();
}
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function setLogin($login)
{
$this->login = $login;
return $this;
}
public function getLogin()
{
return $this->login;
}
public function setNome($nome)
{
$this->nome = $nome;
return $this;
}
public function getNome()
{
return $this->nome;
}
public function setSobrenome($sobrenome)
{
$this->sobrenome = $sobrenome;
return $this;
}
public function getSobrenome()
{
return $this->sobrenome;
}
/**
* Retorna o nome completo do usuario (nome + sobrenome).
*
* @return string
*/
public function getNomeCompleto()
{
return $this->nome . ' ' . $this->sobrenome;
}
public function getEmail()
{
return $this->email;
}
public function setEmail($email)
{
$this->email = $email;
return $this;
}
public function getSenha()
{
return $this->senha;
}
public function setSenha($senha)
{
$this->senha = $senha;
return $this;
}
public function setAtivo(bool $ativo)
{
$this->ativo = $ativo;
return $this;
}
public function getLotacao()
{
return $this->lotacao;
}
public function setLotacao(Lotacao $lotacao = null)
{
$this->lotacao = $lotacao;
return $this;
}
public function getLotacoes()
{
return $this->lotacoes;
}
public function setSalt($salt)
{
$this->salt = $salt;
return $this;
}
public function setLotacoes($lotacoes)
{
$this->lotacoes = $lotacoes;
return $this;
}
public function addLotacoe(Lotacao $lotacao)
{
$lotacao->setUsuario($this);
$this->getLotacoes()->add($lotacao);
}
public function removeLotacoe(Lotacao $lotacao)
{
$this->getLotacoes()->removeElement($lotacao);
}
public function isAtivo(): bool
{
return (bool) $this->ativo;
}
public function getUltimoAcesso()
{
return $this->ultimoAcesso;
}
public function setUltimoAcesso($ultimoAcesso)
{
$this->ultimoAcesso = $ultimoAcesso;
return $this;
}
public function getIp()
{
return $this->ip;
}
public function setIp($ip)
{
$this->ip = $ip;
return $this;
}
public function getSessionId()
{
return $this->sessionId;
}
public function setSessionId($sessionId)
{
$this->sessionId = $sessionId;
return $this;
}
public function getAlgorithm()
{
return $this->algorithm;
}
public function setAlgorithm($algorithm)
{
$this->algorithm = $algorithm;
return $this;
}
public function isAdmin()
{
return $this->admin;
}
public function setAdmin($admin)
{
$this->admin = $admin;
return $this;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
public function getDeletedAt()
{
return $this->deletedAt;
}
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function setDeletedAt(\DateTime $deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
public function isEnabled()
{
return !$this->getDeletedAt() && $this->isAtivo();
}
public function eraseCredentials()
{
}
public function getPassword()
{
return $this->getSenha();
}
public function getRoles()
{
return $this->roles;
}
public function addRole($role)
{
$this->roles[] = $role;
return $this;
}
public function getSalt()
{
return $this->salt;
}
public function getUsername()
{
return $this->getLogin();
}
public function getEncoderName()
{
return $this->algorithm;
}
public function isEqualTo(UserInterface $user)
{
if (!$user instanceof Usuario) {
return false;
}
if ($this->getPassword() !== $user->getPassword()) {
return false;
}
if ($this->getSalt() !== $user->getSalt()) {
return false;
}
if ($this->getUsername() !== $user->getUsername()) {
return false;
}
if ($this->isEnabled() !== $user->isEnabled()) {
return false;
}
if ($this->getSessionId() !== $user->getSessionId()) {
return false;
}
return true;
}
public function serialize()
{
return serialize([
$this->id,
$this->login,
$this->nome,
$this->sessionId,
$this->senha,
$this->salt,
$this->ativo,
]);
}
public function unserialize($serialized)
{
list (
$this->id,
$this->login,
$this->nome,
$this->sessionId,
$this->senha,
$this->salt,
$this->ativo,
) = unserialize($serialized);
}
public function jsonSerialize()
{
return [
'id' => $this->getId(),
'login' => $this->getLogin(),
'nome' => $this->getNome(),
'sobrenome' => $this->getSobrenome(),
'ativo' => $this->isAtivo(),
'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format('Y-m-d\TH:i:s') : null,
'updatedAt' => $this->getUpdatedAt() ? $this->getUpdatedAt()->format('Y-m-d\TH:i:s') : null,
'deletedAt' => $this->getDeletedAt() ? $this->getDeletedAt()->format('Y-m-d\TH:i:s') : null,
];
}
public function __tostring()
{
return (string) $this->getLogin();
}
public function getAtivo(): ?bool
{
return $this->ativo;
}
public function getAdmin(): ?bool
{
return $this->admin;
}
public function getPermissoes(): ?array
{
return $this->permissoes;
}
public function setPermissoes(?array $permissoes): self
{
$this->permissoes = $permissoes;
return $this;
}
public function addLotaco(Lotacao $lotaco): self
{
if (!$this->lotacoes->contains($lotaco)) {
$this->lotacoes[] = $lotaco;
$lotaco->setUsuario($this);
}
return $this;
}
public function removeLotaco(Lotacao $lotaco): self
{
if ($this->lotacoes->removeElement($lotaco)) {
// set the owning side to null (unless already changed)
if ($lotaco->getUsuario() === $this) {
$lotaco->setUsuario(null);
}
}
return $this;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* Usuario metadata.
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class UsuarioMeta extends EntityMetadata
{
/**
* @return Usuario
*/
public function getUsuario()
{
return $this->getEntity();
}
public function setUsuario(Usuario $usuario)
{
return $this->setEntity($usuario);
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
/**
* View Atendimento
* União dos atendimentos atuais e do histórico
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class ViewAtendimento extends AbstractAtendimento
{
/**
* @var AtendimentoCodificadoHistorico[]
*/
private $codificados;
public function __construct()
{
$this->codificados = new ArrayCollection();
}
public function getCodificados()
{
return $this->codificados;
}
public function setCodificados(Collection $codificados)
{
$this->codificados = $codificados;
return $this;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Entity;
/**
* view Atendimento Codificado
* União dos atendimentos atuais e do histórico
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class ViewAtendimentoCodificado extends AbstractAtendimentoCodificado
{
/**
* @var ViewAtendimento
*/
private $atendimento;
public function getAtendimento()
{
return $this->atendimento;
}
public function setAtendimento(AbstractAtendimento $atendimento)
{
$this->atendimento = $atendimento;
return $this;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
/**
* AdvancedEvent
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class AdvancedEvent extends Event implements
LoggerAwareEventInterface,
StorageAwareEventInterface,
UserAwareEventInterface
{
use LoggerAwareTrait,
StorageAwareTrait,
UserAwareTrait;
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
/**
* Event
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Event implements EventInterface
{
/**
* @var string
*/
private $name;
/**
* @var mixed
*/
private $data;
public function __construct(string $name, $data)
{
$this->name = $name;
$this->data = $data;
}
/**
* {@inheritdoc}
*/
public function getData()
{
return $this->data;
}
/**
* {@inheritdoc}
*/
public function getName(): string
{
return $this->name;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
/**
* EventDispatcherInterface
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface EventDispatcherInterface
{
/**
* @param EventInterface $event
* @return bool
*/
public function dispatch(EventInterface $event): bool;
/**
*
* @param string $eventName
* @param mixed $eventData
* @param bool $advancedEvent
* @return bool
*/
public function createAndDispatch(string $eventName, $eventData, bool $advancedEvent = false): bool;
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
/**
* Event
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface EventInterface
{
/**
* Returns event name
*
* @return string
*/
public function getName(): string;
/**
* Returns event data
*
* @return mixed
*/
public function getData();
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
use Psr\Log\LoggerInterface;
/**
* LoggerAwareEventInterface
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface LoggerAwareEventInterface extends EventInterface
{
/**
* @param LoggerInterface $logger
*/
public function setLogger(LoggerInterface $logger);
/**
* @return LoggerInterface
*/
public function getLogger(): LoggerInterface;
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
use Psr\Log\LoggerInterface;
/**
* LoggerAwareTrait
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
trait LoggerAwareTrait
{
/**
* @var LoggerInterface
*/
private $storage;
/**
* {@inheritdoc}
*/
public function setLogger(LoggerInterface $storage)
{
$this->storage = $storage;
return $this;
}
/**
* {@inheritdoc}
*/
public function getLogger(): LoggerInterface
{
return $this->storage;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
use Novosga\Infrastructure\StorageInterface;
/**
* StorageAwareEventInterface
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface StorageAwareEventInterface extends EventInterface
{
/**
* @param StorageInterface $storage
*/
public function setStorage(StorageInterface $storage);
/**
* @return StorageInterface
*/
public function getStorage(): StorageInterface;
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
use Novosga\Infrastructure\StorageInterface;
/**
* StorageAwareTrait
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
trait StorageAwareTrait
{
/**
* @var StorageInterface
*/
private $storage;
/**
* {@inheritdoc}
*/
public function setStorage(StorageInterface $storage)
{
$this->storage = $storage;
return $this;
}
/**
* {@inheritdoc}
*/
public function getStorage(): StorageInterface
{
return $this->storage;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
use Novosga\Entity\Usuario;
/**
* UserAwareEventInterface
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface UserAwareEventInterface extends EventInterface
{
/**
* @param Usuario $user
*/
public function setUser(Usuario $user);
/**
* @return Usuario
*/
public function getUser(): Usuario;
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Event;
use Novosga\Entity\Usuario;
/**
* UserAwareTrait
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
trait UserAwareTrait
{
/**
* @var Usuario
*/
private $user;
/**
* {@inheritdoc}
*/
public function setUser(Usuario $user)
{
$this->user = $user;
return $this;
}
/**
* {@inheritdoc}
*/
public function getUser(): Usuario
{
return $this->user;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Http;
use Exception;
/**
* Envelope
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
class Envelope implements \JsonSerializable
{
/**
* @var bool
*/
private $success;
/**
* @var string
*/
private $sessionStatus;
/**
* @var mixed
*/
private $data;
/**
* @var string
*/
private $message;
/**
* @var string
*/
private $detail;
public function __construct()
{
$this->success = true;
$this->sessionStatus = 'active';
}
public function isSuccess()
{
return $this->success;
}
public function getSessionStatus()
{
return $this->sessionStatus;
}
public function getData()
{
return $this->data;
}
public function getMessage()
{
return $this->message;
}
public function setSuccess($success)
{
$this->success = $success;
return $this;
}
public function setSessionStatus($session)
{
$this->sessionStatus = $session;
return $this;
}
public function setData($data)
{
$this->data = $data;
return $this;
}
public function setMessage($message)
{
$this->message = $message;
return $this;
}
public function getDetail()
{
return $this->detail;
}
public function setDetail($detail)
{
$this->detail = $detail;
return $this;
}
public function exception(Exception $e, $debug = false)
{
$this
->setSuccess(false)
->setMessage($e->getMessage());
if ($debug) {
$detail = "{$e->getFile()}:{$e->getLine()}\n{$e->getTraceAsString()}";
$this->setDetail($detail);
}
return $this;
}
public function jsonSerialize()
{
$body = [
'success' => $this->success,
'sessionStatus' => $this->sessionStatus,
'time' => time() * 1000,
];
if ($this->success) {
$body['data'] = $this->data;
} else {
$body['message'] = $this->message;
if ($this->detail) {
$body['detail'] = $this->detail;
}
}
return $body;
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Infrastructure;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Persistence\ObjectRepository;
use Novosga\Entity\Agendamento;
use Novosga\Entity\Atendimento;
use Novosga\Entity\Unidade;
/**
* StorageInterface
*
* @author Rogerio Lino <rogeriolino@gmail.com>
*/
interface StorageInterface
{
/**
* @return ObjectManager
*/
public function getManager(): ObjectManager;
/**
* @param string $className
* @return ObjectRepository
*/
public function getRepository(string $className): ObjectRepository;
/**
* Gera uma nova senha de atendimento
* @param Atendimento $atendimento
* @param Agendamento $agendamento
*/
public function distribui(Atendimento $atendimento, Agendamento $agendamento = null);
/**
* @param Atendimento $atendimento
*/
public function chamar(Atendimento $atendimento);
/**
*
* @param Atendimento $atendimento
* @param array $codificados
* @param Atendimento $novoAtendimento
*/
public function encerrar(Atendimento $atendimento, array $codificados, Atendimento $novoAtendimento = null);
/**
* Move os dados de atendimento para o histórico
* @param Unidade $unidade
*/
public function acumularAtendimentos(?Unidade $unidade, array $ctx = []);
/**
* Apaga todos os dados de atendimentos
* @param Unidade $unidade
*/
public function apagarDadosAtendimento(?Unidade $unidade, array $ctx = []);
}
Copyright (c) 2012-2016 Rogerio Lino
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Module;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* BaseModule
*
* @author Rogério Lino <rogeriolino@gmail.com>
*/
abstract class BaseModule extends Bundle implements ModuleInterface
{
public function getKeyName()
{
$namespace = $this->getNamespace();
$tokens = explode('\\', str_replace('Bundle', '', $namespace));
return strtolower(implode('.', $tokens));
}
public function getRoleName()
{
$keyName = $this->getKeyName();
return 'ROLE_' . strtoupper(str_replace('.', '_', $keyName));
}
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Module;
/**
* ModuleInterface
*
* @author Rogério Lino <rogeriolino@gmail.com>
*/
interface ModuleInterface
{
public function getKeyName();
public function getRoleName();
public function getIconName();
public function getDisplayName();
public function getName();
public function getHomeRoute();
}
# core
NovoSGA core.
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Repository;
use Doctrine\Common\Persistence\ObjectRepository;
use Novosga\Entity\Atendimento;
use Novosga\Entity\Servico;
use Novosga\Entity\Unidade;
/**
* AtendimentoRepositoryInterface
*
* @author Rogério Lino <rogeriolino@gmail.com>
*/
interface AtendimentoRepositoryInterface extends ObjectRepository
{
/**
* Retorna o par do id do serviço e o total de atendimentos
* @param Unidade $unidade
* @param Servico[]|int[] $servicos
* @param string $status
* @return array
*/
public function countByServicos(Unidade $unidade, array $servicos, $status = null);
/**
*
* @param Unidade $unidade
* @param Servico $servico
* @return Atendimento
*/
public function getUltimo(Unidade $unidade, Servico $servico = null);
}
<?php
/*
* This file is part of the Novo SGA project.
*
* (c) Rogerio Lino <rogeriolino@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Novosga\Repository;
use Doctrine\Common\Persistence\ObjectRepository;
/**
* ClienteRepositoryInterface
*
* @author Rogério Lino <rogeriolino@gmail.com>
*/
interface ClienteRepositoryInterface extends ObjectRepository
{
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment