Skip to content

Commit af32280

Browse files
authored
Merge pull request RyanCNP#95 from RyanCNP/develop
Develop
2 parents 5518824 + 6e36166 commit af32280

28 files changed

Lines changed: 490 additions & 307 deletions

app.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
2-
31
import express from "express";
42
import cors from "cors";
53
import path from "path";
6-
7-
84
import categoriaRoutes from "./src/routes/categoria.routes";
95
import denunciaRoutes from "./src/routes/denuncia.routes";
106
import userRoutes from "./src/routes/user.routes";
@@ -13,19 +9,17 @@ import locationRoutes from "./src/routes/location.routes"
139
import { authRoutes } from "./src/routes/auth.routes";
1410
import graphRoutes from "./src/routes/graph.routes";
1511
import uploadRoutes from "./src/routes/upload.routes";
16-
//import feedbackRoutes from "./src/routes/feedback.routes";
12+
import feedbackRoutes from "./src/routes/feedback.routes";
1713
import registroRoutes from "./src/routes/registro.routes";
1814
import { setupSwagger } from "./src/swagger/swagger";
1915
import { errorHandler } from "./src/middlewares/errorHandler.middleware";
2016
import http from 'http'
2117
import { initSockets } from "./src/sockets";
2218
import bodyParser from "body-parser";
2319
import stripeRoutes from "./src/routes/stripe.routes";
24-
export const app = express();
2520
import RegistroRoutes from './src/routes/registro.routes';
2621
import VisitasRoutes from './src/routes/visita.routes';
27-
import { setupSwagger } from "./src/swagger/swagger";
28-
import { errorHandler } from "./src/middlewares/errorHandler.middleware";
22+
2923
const app = express();
3024

3125
app.use(cors());
@@ -46,16 +40,18 @@ app.use('/upload',uploadRoutes);
4640
app.use("/location",locationRoutes);
4741
app.use('/visitas', VisitasRoutes);
4842
app.use('/api/stripe', stripeRoutes);
49-
//app.use("/feedback", feedbackRoutes);
50-
app.use("/comentario", comentarioRoutes);
43+
app.use("/feedback", feedbackRoutes);
5144
app.use("/registro", registroRoutes);
5245

5346
// Acesso público às imagens
5447
app.use("/public", express.static(path.join(__dirname, "public")));
5548

5649
app.use(errorHandler);
5750

51+
const server = http.createServer(app);
52+
initSockets(server);
53+
5854
const PORT = process.env.PORT || 3000;
59-
app.listen(PORT, () => {
55+
server.listen(PORT, () => {
6056
console.log(`Backend do SaneaSP está rodando na porta ${PORT}`);
6157
});

migrations/20251028230755-create-table-registro.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
},
1919
tipo: {
2020
allowNull: false,
21-
type: DataTypes.INTEGER
21+
type: DataTypes.STRING(50)
2222
},
2323
statusAnterior: {
2424
allowNull: false,

migrations/20251106002405-create-table-funcionarios.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ module.exports = {
1919
onDelete: "CASCADE",
2020
},
2121
nivel: {
22-
allowNull: true,
23-
type: DataTypes.STRING(30),
22+
allowNull: false,
23+
type: DataTypes.STRING(30)
2424
},
2525
});
2626
},

migrations/20251120145923-alter-table-denuncia-status-endereco.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
async up (queryInterface, Sequelize) {
66
// Alterar status para string e default 'aberto'
77
await queryInterface.changeColumn('denuncia', 'status', {
8-
type: Sequelize.STRING(20),
8+
type: Sequelize.STRING(50),
99
allowNull: false,
1010
defaultValue: 'aberto'
1111
});

package-lock.json

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/denuncias/user1.jpg

8.01 KB
Loading

public/denuncias/user2.jpg

15.2 KB
Loading

public/denuncias/user3.jpg

11.1 KB
Loading

public/denuncias/user4.jpg

13 KB
Loading

public/denuncias/user5.jpg

12.4 KB
Loading

0 commit comments

Comments
 (0)