Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ dist
!public/.gitkeep
.env
.env.test
.env.exemple
.cache
logs/
WWebJS/
.vscode/


yarn.lock
Expand Down
68 changes: 0 additions & 68 deletions backend/.env.example

This file was deleted.

2 changes: 2 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ dist
!public/.gitkeep
.env
.env.test
.env.exemple
.cache
logs/
WWebJS/
.vscode/


yarn.lock
Expand Down
21 changes: 1 addition & 20 deletions backend/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@
"version": "0.2.0",
"configurations": [
{
"name": "Attach Node.js",
"processId": "${command:PickProcess}",
"name": "Backend",
"request": "attach",
"restart": true,
"trace": true,
"sourceMaps": true,
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
},
{
"type": "node",
"request": "launch",
"restart": true,
"smartStep": true,
"name": "Debug TypeScript in Node.js",
// "preLaunchTask": "npm: build",
"preLaunchTask": "tsc: build - tsconfig.json",
"program": "${workspaceFolder}/src/server.ts",
"cwd": "${workspaceFolder}",
"outputCapture": "std",
"protocol": "inspector",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
]
}
]
}
2 changes: 1 addition & 1 deletion backend/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"activityBar.activeBorder": "#ee1179",
"activityBar.background": "#fbed80",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBar.inactiveForeground": "#080b0e99",
"activityBarBadge.background": "#06b9a5",
"activityBarBadge.foreground": "#15202b",
"sash.hoverBorder": "#fbed80",
Expand Down
50 changes: 0 additions & 50 deletions backend/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,10 @@
version: '3'

services:
izing-backend:
build:
context: .
dockerfile: ./Dockerfile
env_file:
- ./.env
stdin_open: true
tty: true
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ".:/usr/src/app"
# - "/var/izing-media:/usr/src/app/public/"
networks:
- izing_network
- izing_db_network
depends_on:
- izing-redis
- izing-db
- izing-rabbitmq

izing-redis:
container_name: "izing-redis"
image: 'redis:latest'
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "6379:6379"
env_file:
Expand All @@ -37,37 +14,10 @@ services:
networks:
- izing_db_network

# database containers, one for each db
izing-fixPermissionsPostregres:
image: 'bitnami/postgresql:14'
user: root
command: chown -R 1001:1001 /bitnami/postgresql
volumes:
- "/var/izing/pg:/bitnami/postgresql/data"

izing-db:
image: 'bitnami/postgresql:14'
restart: always
container_name: "izing-db"
extra_hosts:
- "host.docker.internal:host-gateway"
env_file:
- ./.env
volumes:
- "/var/izing/pg:/bitnami/postgresql/data"
ports:
- "5432:5432"
depends_on:
- izing-fixPermissionsPostregres
networks:
- izing_db_network

izing-rabbitmq:
image: rabbitmq:3-management
hostname: izing-rabbit
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
env_file:
- ./.env
healthcheck:
Expand Down
36 changes: 18 additions & 18 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"fluent-ffmpeg": "^2.1.2",
"helmet": "^4.4.1",
"http-graceful-shutdown": "^2.4.0",
"instagram_mqtt": "^1.2.2",
"instagram-private-api": "^1.45.3",
"instagram_mqtt": "^1.2.2",
"ioredis": "^5.2.4",
"is-base64": "^1.1.0",
"jsonwebtoken": "^8.5.1",
Expand Down
4 changes: 2 additions & 2 deletions backend/src/controllers/CampaignController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export const store = async (req: Request, res: Response): Promise<Response> => {

export const index = async (req: Request, res: Response): Promise<Response> => {
const { tenantId } = req.user;
const tags = await ListCampaignService({
const campaing = await ListCampaignService({
tenantId
});
return res.status(200).json(tags);
return res.status(200).json(campaing);
};

export const update = async (
Expand Down
7 changes: 3 additions & 4 deletions backend/src/controllers/TicketController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,13 @@ export const update = async (
isTransference,
userIdRequest
});

//enviar mensagem de despedida ao encerrar atendimento
//enviar mensagem de despedida ao encerrar atendimento
if (ticket.status === "closed") {
const whatsapp = await Whatsapp.findOne({
where: { id: ticket.whatsappId, tenantId }
});
});
if(whatsapp?.farewellMessage){
await SendWhatsAppMessage({body: generateMessage(`${whatsapp?.farewellMessage}`, ticket), ticket});
await SendWhatsAppMessage({body: generateMessage(`${whatsapp?.farewellMessage}`, ticket), ticket});
}
};

Expand Down
22 changes: 0 additions & 22 deletions backend/src/models/Contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ class Contact extends Model<Contact> {
@HasMany(() => ContactCustomField)
extraInfo: ContactCustomField[];

// @HasMany(() => ContactTag)
// tags: ContactTag[];

@BelongsToMany(() => Tags, () => ContactTag, "contactId", "tagId")
tags: Tags[];

Expand Down Expand Up @@ -128,23 +125,4 @@ class Contact extends Model<Contact> {
instance.profilePicUrl = profilePicUrl;
}
}

// Contact.sequelize?.define("Contact", {
// scheduledMessages: {
// type: DataTypes.VIRTUAL,
// async get() {
// const contactId = 4077;
// const messages = await Message.findAll({
// where: {
// contactId,
// scheduleDate: { [Op.not]: null },
// status: "pending"
// },
// logging: console.log
// });
// return messages;
// }
// }
// });

export default Contact;
8 changes: 0 additions & 8 deletions backend/src/services/TicketServices/CreateLogTicketService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import AppError from "../../errors/AppError";
// import socketEmit from "../../helpers/socketEmit";
import LogTicket from "../../models/LogTicket";

type logType =
Expand Down Expand Up @@ -37,12 +35,6 @@ const CreateLogTicketService = async ({
type,
queueId
});

// socketEmit({
// tenantId,
// type: "ticket:update",
// payload: ticket
// });
};

export default CreateLogTicketService;
Loading