Skip to content

Commit e94675d

Browse files
author
Ryan Carlo Negretti Pereira
authored
Merge pull request RyanCNP#88 from RyanCNP/feature/update-actions
Feature/update actions
2 parents 50d11d2 + 8deef23 commit e94675d

14 files changed

Lines changed: 222 additions & 210 deletions

File tree

.env-example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ PORT = 3000
77
PROD_DATABASE_URL = postgresql://postgres:1234@localhost:5423/postgres
88
DEV_DATABASE_URL = postgresql://postgres:1234@localhost:5423/postgres
99

10-
# JWT
11-
SECRET_KEY = chave JWT
10+
# JWT
11+
SECRET_KEY = secret
1212
EXPIRES_IN = 7 days
1313

1414
# API de Email

.github/email-templates/failure-pipeline.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ <h2>Olá, equipe!</h2>
143143
<div class="info-box">
144144
<h3>Detalhes da Execução:</h3>
145145
<ul>
146-
<li><strong>Workflow:</strong> CI/CD - develop</li>
146+
<li><strong>Workflow:</strong> CI/CD - {{branch}}</li>
147147
<li><strong>Status:</strong> Falha ❌</li>
148148
<li><strong>Data:</strong> {{data}}</li>
149149
<li><strong>Commit:</strong> {{commit}}</li>

.github/workflows/develop-actions.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
2424
echo "Mensagem detectada: $MSG"
2525
26-
if [[ ! "$MSG" =~ ^(feat|feat!|chore|fix|refactor)(\(.+\))?: ]]; then
26+
if [[ ! "$MSG" =~ ^(feat|feat!|chore|fix|refactor|docs)(\(.+\))?:|^Merge|^Revert ]]; then
2727
echo "❌ Mensagem de commit inválida!"
28-
echo "Use um dos formatos: feat:, feat!:, chore:, fix:, refactor:"
28+
echo "Use um dos formatos: feat:, feat!:, chore:, fix:, refactor:, docs:"
2929
exit 1
30-
fi
30+
fi
3131
32-
echo "✔ Mensagem válida."
32+
echo "✔ Mensagem válida."
3333
3434
# --- Instalação de dependências ---
3535
- name: Dependências

.github/workflows/main-actions.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ jobs:
2323
2424
echo "Mensagem detectada: $MSG"
2525
26-
if [[ ! "$MSG" =~ ^(feat|feat!|chore|fix|refactor)(\(.+\))?: ]]; then
26+
if [[ ! "$MSG" =~ ^(feat|feat!|chore|fix|refactor|docs)(\(.+\))?:|^Merge|^Revert ]]; then
2727
echo "❌ Mensagem de commit inválida!"
28-
echo "Use um dos formatos: feat:, feat!:, chore:, fix:, refactor:"
28+
echo "Use um dos formatos: feat:, feat!:, chore:, fix:, refactor:, docs:"
2929
exit 1
30-
fi
30+
fi
31+
32+
echo "✔ Mensagem válida."
3133
32-
echo "✔ Mensagem válida."
3334
3435
# --- Instalar dependências ---
3536
- name: Instalar dependências
@@ -105,7 +106,17 @@ jobs:
105106
# --- Atualizar package.json ---
106107
- name: Atualizar versão no package.json
107108
if: steps.version.outputs.should_deploy == 'true'
108-
run: npm version $NEW_VERSION --no-git-tag-version
109+
run: |
110+
CURRENT_VERSION=$(node -p "require('./package.json').version")
111+
echo "📦 Versão atual no package.json: $CURRENT_VERSION"
112+
echo "🆕 Nova versão calculada: $NEW_VERSION"
113+
114+
if [ "$CURRENT_VERSION" != "$NEW_VERSION" ]; then
115+
echo "🔹 Atualizando package.json para $NEW_VERSION..."
116+
npm version $NEW_VERSION --no-git-tag-version
117+
else
118+
echo "✅ A versão no package.json já está atualizada ($CURRENT_VERSION). Nenhuma alteração necessária."
119+
fi
109120
110121
# --- Commit e criar tag ---
111122
- name: Commit e criar tag

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,3 @@ node_modules/
140140

141141
.dockerfile
142142
database.sqlite
143-
144-
# Multer
145-
public

app.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import locationRoutes from "./src/routes/location.routes"
1313
import { authRoutes } from "./src/routes/auth.routes";
1414
import graphRoutes from "./src/routes/graph.routes";
1515
import uploadRoutes from "./src/routes/upload.routes";
16-
import feedbackRoutes from "./src/routes/feedback.routes";
16+
//import feedbackRoutes from "./src/routes/feedback.routes";
1717
import registroRoutes from "./src/routes/registro.routes";
1818
import { setupSwagger } from "./src/swagger/swagger";
1919
import { errorHandler } from "./src/middlewares/errorHandler.middleware";
@@ -45,8 +45,10 @@ app.use("/graph", graphRoutes);
4545
app.use('/upload',uploadRoutes);
4646
app.use("/location",locationRoutes);
4747
app.use('/visitas', VisitasRoutes);
48-
app.use('/registro', RegistroRoutes );
4948
app.use('/api/stripe', stripeRoutes);
49+
//app.use("/feedback", feedbackRoutes);
50+
app.use("/comentario", comentarioRoutes);
51+
app.use("/registro", registroRoutes);
5052

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

breaker.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import type { Request, Response } from "express"
2-
import type { ICreateDenunciaFeedback, ICreateInterfaceFeedback } from "../interfaces/feedback"
3-
import * as feedbackService from "../services/feedback.service"
4-
import { ApiError } from "../errors/ApiError.error"
5-
import { HttpCode } from "../enums/HttpCode.enum"
1+
// import type { Request, Response } from "express"
2+
// import type { ICreateDenunciaFeedback, ICreateInterfaceFeedback } from "../interfaces/feedback"
3+
// import * as feedbackService from "../services/feedback.service"
4+
// import { ApiError } from "../errors/ApiError.error"
5+
// import { HttpCode } from "../enums/HttpCode.enum"
66

7-
export const getAllDenunciaFeedbacks = async (req: Request, res: Response) => {
8-
const feedbacks = await feedbackService.findAllFeedbacks()
9-
res.status(200).json(feedbacks)
10-
}
7+
// export const getAllDenunciaFeedbacks = async (req: Request, res: Response) => {
8+
// const feedbacks = await feedbackService.findAllFeedbacks()
9+
// res.status(200).json(feedbacks)
10+
// }
1111

12-
export const getAllInterfaceFeedbacks = async (req: Request, res: Response) => {
13-
const feedbacks = await feedbackService.findAllInterfaceFeedbacks()
14-
res.status(200).json(feedbacks)
15-
}
12+
// export const getAllInterfaceFeedbacks = async (req: Request, res: Response) => {
13+
// const feedbacks = await feedbackService.findAllInterfaceFeedbacks()
14+
// res.status(200).json(feedbacks)
15+
// }
1616

17-
export const postDenunciaFeedback = async (req: Request, res: Response) => {
18-
const feedback: ICreateDenunciaFeedback = req.body
19-
const newFeedback = await feedbackService.createDenunciaFeedback(feedback)
20-
res.status(201).json(newFeedback)
21-
}
17+
// export const postDenunciaFeedback = async (req: Request, res: Response) => {
18+
// const feedback: ICreateDenunciaFeedback = req.body
19+
// const newFeedback = await feedbackService.createDenunciaFeedback(feedback)
20+
// res.status(201).json(newFeedback)
21+
// }
2222

23-
export const postInterfaceFeedback = async (req: Request, res: Response) => {
24-
const feedback: ICreateInterfaceFeedback = req.body
25-
const newFeedback = await feedbackService.createInterfaceFeedback(feedback)
26-
res.status(201).json(newFeedback)
27-
}
23+
// export const postInterfaceFeedback = async (req: Request, res: Response) => {
24+
// const feedback: ICreateInterfaceFeedback = req.body
25+
// const newFeedback = await feedbackService.createInterfaceFeedback(feedback)
26+
// res.status(201).json(newFeedback)
27+
// }
2828

29-
export const deleteFeedback = async (req: Request, res: Response) => {
30-
const { id } = req.params
31-
const deletedFeedback = await feedbackService.deleteFeedback(Number(id))
32-
res.status(200).json(deletedFeedback)
33-
}
29+
// export const deleteFeedback = async (req: Request, res: Response) => {
30+
// const { id } = req.params
31+
// const deletedFeedback = await feedbackService.deleteFeedback(Number(id))
32+
// res.status(200).json(deletedFeedback)
33+
// }

src/interfaces/feedback.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import { FeedbackInterface } from "../enums/FeedbackInterface.enum"
1+
// import { FeedbackInterface } from "../enums/FeedbackInterface.enum"
22

3-
export interface IDenunciaFeedback {
4-
id: number,
5-
data_publicacao: Date,
6-
descricao: string,
7-
fk_denuncia: number
8-
}
3+
// export interface IDenunciaFeedback {
4+
// id: number,
5+
// data_publicacao: Date,
6+
// descricao: string,
7+
// fk_denuncia: number
8+
// }
99

10-
export interface ICreateDenunciaFeedback {
11-
data_publicacao: Date,
12-
descricao: string,
13-
fk_denuncia: number
14-
}
10+
// export interface ICreateDenunciaFeedback {
11+
// data_publicacao: Date,
12+
// descricao: string,
13+
// fk_denuncia: number
14+
// }
1515

16-
export interface IInterfaceFeedback {
17-
id: number,
18-
data_publicacao: Date,
19-
descricao: string,
20-
tela: FeedbackInterface,
21-
}
16+
// export interface IInterfaceFeedback {
17+
// id: number,
18+
// data_publicacao: Date,
19+
// descricao: string,
20+
// tela: FeedbackInterface,
21+
// }
2222

23-
export interface ICreateInterfaceFeedback {
24-
data_publicacao: Date,
25-
descricao: string,
26-
tela: FeedbackInterface,
27-
}
23+
// export interface ICreateInterfaceFeedback {
24+
// data_publicacao: Date,
25+
// descricao: string,
26+
// tela: FeedbackInterface,
27+
// }

src/models/feedback.model.ts

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
import { DataTypes, Model, Optional } from "sequelize";
2-
import sequelize from "../config/database.config";
3-
import { IDenunciaFeedback, IInterfaceFeedback } from "../interfaces/feedback";
4-
import { FeedbackInterface } from "../enums/FeedbackInterface.enum";
1+
// import { DataTypes, Model, Optional } from "sequelize";
2+
// import sequelize from "../config/database.config";
3+
// import { IDenunciaFeedback, IInterfaceFeedback } from "../interfaces/feedback";
4+
// import { FeedbackInterface } from "../enums/FeedbackInterface.enum";
55

6-
type DenunciaFeedbackCreationalAttributes = Optional<IDenunciaFeedback, "id">
7-
type InterfaceFeedbackCreationalAttributes = Optional<IInterfaceFeedback, "id">
6+
// type DenunciaFeedbackCreationalAttributes = Optional<IDenunciaFeedback, "id">
7+
// type InterfaceFeedbackCreationalAttributes = Optional<IInterfaceFeedback, "id">
88

9-
export class DenunciaFeedbackModel extends Model<IDenunciaFeedback, DenunciaFeedbackCreationalAttributes> implements IDenunciaFeedback {
10-
public id!: number;
11-
public data_publicacao!: Date;
12-
public descricao!: string;
13-
public fk_denuncia!: number;
14-
}
9+
// export class DenunciaFeedbackModel extends Model<IDenunciaFeedback, DenunciaFeedbackCreationalAttributes> implements IDenunciaFeedback {
10+
// public id!: number;
11+
// public data_publicacao!: Date;
12+
// public descricao!: string;
13+
// public fk_denuncia!: number;
14+
// }
1515

16-
export class InterfaceFeedbackModel extends Model<IInterfaceFeedback, InterfaceFeedbackCreationalAttributes> implements IInterfaceFeedback {
17-
public id!: number;
18-
public data_publicacao!: Date;
19-
public descricao!: string;
20-
public tela!: FeedbackInterface;
21-
}
16+
// export class InterfaceFeedbackModel extends Model<IInterfaceFeedback, InterfaceFeedbackCreationalAttributes> implements IInterfaceFeedback {
17+
// public id!: number;
18+
// public data_publicacao!: Date;
19+
// public descricao!: string;
20+
// public tela!: FeedbackInterface;
21+
// }
2222

23-
DenunciaFeedbackModel.init({
24-
id: {
25-
primaryKey: true,
26-
type: DataTypes.INTEGER,
27-
autoIncrement: true,
28-
allowNull: false,
29-
field: "id",
30-
},
31-
data_publicacao: {
32-
allowNull: false,
33-
type: DataTypes.DATE,
34-
field: "data_publicacao"
35-
},
36-
descricao: {
37-
allowNull: false,
38-
type: DataTypes.STRING(2048),
39-
field: "descricao"
40-
},
41-
fk_denuncia: {
42-
allowNull: false,
43-
type: DataTypes.INTEGER,
44-
field: "fk_denuncia"
45-
}
46-
},{
47-
tableName: "denuncia-feedback",
48-
sequelize,
49-
timestamps: false
50-
})
23+
// DenunciaFeedbackModel.init({
24+
// id: {
25+
// primaryKey: true,
26+
// type: DataTypes.INTEGER,
27+
// autoIncrement: true,
28+
// allowNull: false,
29+
// field: "id",
30+
// },
31+
// data_publicacao: {
32+
// allowNull: false,
33+
// type: DataTypes.DATE,
34+
// field: "data_publicacao"
35+
// },
36+
// descricao: {
37+
// allowNull: false,
38+
// type: DataTypes.STRING(2048),
39+
// field: "descricao"
40+
// },
41+
// fk_denuncia: {
42+
// allowNull: false,
43+
// type: DataTypes.INTEGER,
44+
// field: "fk_denuncia"
45+
// }
46+
// },{
47+
// tableName: "denuncia-feedback",
48+
// sequelize,
49+
// timestamps: false
50+
// })
5151

52-
InterfaceFeedbackModel.init({
53-
id: {
54-
primaryKey: true,
55-
type: DataTypes.INTEGER,
56-
autoIncrement: true,
57-
allowNull: false,
58-
field: "id",
59-
},
60-
data_publicacao: {
61-
allowNull: false,
62-
type: DataTypes.DATE,
63-
field: "data_publicacao"
64-
},
65-
descricao: {
66-
allowNull: false,
67-
type: DataTypes.STRING(2048),
68-
field: "descricao"
69-
},
70-
tela: {
71-
allowNull: false,
72-
type: DataTypes.INTEGER,
73-
field: "tela"
74-
}
75-
},{
76-
tableName: "interface-feedback",
77-
sequelize,
78-
timestamps: false
79-
})
52+
// InterfaceFeedbackModel.init({
53+
// id: {
54+
// primaryKey: true,
55+
// type: DataTypes.INTEGER,
56+
// autoIncrement: true,
57+
// allowNull: false,
58+
// field: "id",
59+
// },
60+
// data_publicacao: {
61+
// allowNull: false,
62+
// type: DataTypes.DATE,
63+
// field: "data_publicacao"
64+
// },
65+
// descricao: {
66+
// allowNull: false,
67+
// type: DataTypes.STRING(2048),
68+
// field: "descricao"
69+
// },
70+
// tela: {
71+
// allowNull: false,
72+
// type: DataTypes.INTEGER,
73+
// field: "tela"
74+
// }
75+
// },{
76+
// tableName: "interface-feedback",
77+
// sequelize,
78+
// timestamps: false
79+
// })

0 commit comments

Comments
 (0)