-- MySQL dump 10.13  Distrib 8.0.46, for Linux (aarch64)
--
-- Host: localhost    Database: gpros_hub_api
-- ------------------------------------------------------
-- Server version	8.0.46

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Current Database: `gpros_hub_api`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `gpros_hub_api` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;

USE `gpros_hub_api`;

--
-- Table structure for table `contas`
--

DROP TABLE IF EXISTS `contas`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `contas` (
  `pk` int unsigned NOT NULL AUTO_INCREMENT,
  `dt_cadastro` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `usuario_cadastro_pk` int unsigned NOT NULL DEFAULT '0',
  `dt_utl_atualizacacao` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `usuario_ult_atualizacao_pk` int unsigned NOT NULL DEFAULT '0',
  `ds_lead` varchar(45) NOT NULL DEFAULT '',
  `da_razao_social` varchar(45) NOT NULL,
  `ds_cnpj` varchar(45) NOT NULL,
  `ds_link_cliente` varchar(45) NOT NULL DEFAULT '',
  `ic_status` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`pk`),
  UNIQUE KEY `uq_contas_cnpj` (`ds_cnpj`),
  KEY `idx_contas_status` (`ic_status`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `contas`
--

LOCK TABLES `contas` WRITE;
/*!40000 ALTER TABLE `contas` DISABLE KEYS */;
INSERT INTO `contas` VALUES (1,'2026-06-17 13:01:00',1,'2026-06-17 13:01:00',1,'GRUPO VISTORIZA SERVICOS','GRUPO VISTORIZA SERVICOS','22.124.624/0001-53','https://appvistoriza.gepros1.com.br/',1);
/*!40000 ALTER TABLE `contas` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `dados_colaborador`
--

DROP TABLE IF EXISTS `dados_colaborador`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `dados_colaborador` (
  `pk` int unsigned NOT NULL AUTO_INCREMENT,
  `dt_cadastro` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `usuario_cadasdro_pk` int unsigned NOT NULL DEFAULT '0',
  `dt_ult_atualizacacao` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `usuario_ult_atualizacaco_pk` int unsigned NOT NULL DEFAULT '0',
  `ds_colaborador` varchar(80) NOT NULL,
  `ds_cpf` varchar(45) NOT NULL,
  `ds_rg` varchar(45) DEFAULT NULL,
  `ds_cel` varchar(45) DEFAULT NULL,
  `dt_nascimento` date DEFAULT NULL,
  `dt_adminissao` date DEFAULT NULL,
  `ds_cnpj` varchar(45) NOT NULL,
  `ic_status` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`pk`),
  UNIQUE KEY `uq_colaborador_cpf_cnpj` (`ds_cpf`,`ds_cnpj`),
  KEY `idx_colaborador_cpf` (`ds_cpf`),
  KEY `idx_colaborador_cnpj` (`ds_cnpj`),
  KEY `idx_colaborador_status` (`ic_status`),
  CONSTRAINT `fk_dados_colaborador_contas` FOREIGN KEY (`ds_cnpj`) REFERENCES `contas` (`ds_cnpj`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `dados_colaborador`
--

LOCK TABLES `dados_colaborador` WRITE;
/*!40000 ALTER TABLE `dados_colaborador` DISABLE KEYS */;
INSERT INTO `dados_colaborador` VALUES (1,'2026-06-17 13:05:46',1,'2026-06-17 13:17:44',1,'Douglas Jones Lopes','277.457.258-44','24.991.776-2','(11)99450-3033','2079-12-23','2026-01-01','22.124.624/0001-53',1);
/*!40000 ALTER TABLE `dados_colaborador` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `dados_colaborador_liberacao`
--

DROP TABLE IF EXISTS `dados_colaborador_liberacao`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `dados_colaborador_liberacao` (
  `pk` int unsigned NOT NULL AUTO_INCREMENT,
  `dt_cadastro` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ds_cpf` varchar(45) NOT NULL,
  `ds_cnpj` varchar(45) NOT NULL,
  `ds_img` longblob NOT NULL,
  `dt_liberacao` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ic_status` int NOT NULL DEFAULT '1',
  PRIMARY KEY (`pk`),
  KEY `idx_liberacao_cpf_cnpj` (`ds_cpf`,`ds_cnpj`),
  KEY `idx_liberacao_status` (`ic_status`),
  KEY `fk_liberacao_contas` (`ds_cnpj`),
  CONSTRAINT `fk_liberacao_contas` FOREIGN KEY (`ds_cnpj`) REFERENCES `contas` (`ds_cnpj`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `dados_colaborador_liberacao`
--

LOCK TABLES `dados_colaborador_liberacao` WRITE;
/*!40000 ALTER TABLE `dados_colaborador_liberacao` DISABLE KEYS */;
/*!40000 ALTER TABLE `dados_colaborador_liberacao` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `registros_ponto`
--

DROP TABLE IF EXISTS `registros_ponto`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `registros_ponto` (
  `registro_pk` bigint unsigned NOT NULL AUTO_INCREMENT,
  `contas_pk` int unsigned NOT NULL,
  `colaborador_pk` int unsigned NOT NULL,
  `dt_registro` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `foto_base64` longtext,
  `dt_criado` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`registro_pk`),
  KEY `idx_registro_colaborador_periodo` (`colaborador_pk`,`dt_registro`),
  KEY `idx_registro_contas` (`contas_pk`),
  CONSTRAINT `fk_registros_ponto_colaborador` FOREIGN KEY (`colaborador_pk`) REFERENCES `dados_colaborador` (`pk`) ON DELETE RESTRICT ON UPDATE CASCADE,
  CONSTRAINT `fk_registros_ponto_contas` FOREIGN KEY (`contas_pk`) REFERENCES `contas` (`pk`) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `registros_ponto`
--

LOCK TABLES `registros_ponto` WRITE;
/*!40000 ALTER TABLE `registros_ponto` DISABLE KEYS */;
/*!40000 ALTER TABLE `registros_ponto` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Dumping routines for database 'gpros_hub_api'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2026-06-17 14:52:47
