generated from polijrorg/template-node-ts-prisma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,638 additions
and
1,023 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
interface ICreateGroupDTO { | ||
name: string; | ||
description: string; | ||
super_adm_id: string; | ||
subscription_id: string; | ||
} | ||
|
||
export default ICreateGroupDTO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
interface IUpdateGroupDTO { | ||
name: string; | ||
description: string; | ||
} | ||
|
||
export default IUpdateGroupDTO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { Router } from 'express'; | ||
|
||
import ensureAuthenticated from '@shared/infra/http/middlewares/EnsureAuthenticated'; | ||
import GroupsController from '../controller/GroupsController'; | ||
|
||
const groupsRoutes = Router(); | ||
|
||
const groupsController = new GroupsController(); | ||
|
||
groupsRoutes.post('/register', groupsController.create); | ||
groupsRoutes.get('/read', groupsController.readAll); | ||
groupsRoutes.get('/read/:id', groupsController.readById); | ||
groupsRoutes.patch('/update/:id', groupsController.update); | ||
groupsRoutes.delete('/delete/:id', groupsController.delete); | ||
groupsRoutes.post('/register', ensureAuthenticated, groupsController.create); | ||
groupsRoutes.get('/read', ensureAuthenticated, groupsController.readAll); | ||
groupsRoutes.get('/read/:id', ensureAuthenticated, groupsController.readById); | ||
groupsRoutes.patch('/update/:id', ensureAuthenticated, groupsController.update); | ||
groupsRoutes.delete('/delete/:id', ensureAuthenticated, groupsController.delete); | ||
|
||
export default groupsRoutes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
model Groups { | ||
id String @id @default(uuid()) | ||
name String | ||
description String | ||
created_at DateTime @default(now()) | ||
updated_at DateTime @default(now()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import { Router } from 'express'; | ||
|
||
import ensureAuthenticated from '@shared/infra/http/middlewares/EnsureAuthenticated'; | ||
import InvitesController from '../controller/InvitesController'; | ||
|
||
const invitesRoutes = Router(); | ||
|
||
const invitesController = new InvitesController(); | ||
|
||
invitesRoutes.post('/register', invitesController.create); | ||
invitesRoutes.get('/read/:group_id', invitesController.readAllInvitesByGroup); | ||
invitesRoutes.delete('/delete/:group_id', invitesController.delete); | ||
invitesRoutes.post('/accept/:user_id', invitesController.accept); | ||
invitesRoutes.post('/register', ensureAuthenticated, invitesController.create); | ||
invitesRoutes.get('/read/:group_id', ensureAuthenticated, invitesController.readAllInvitesByGroup); | ||
invitesRoutes.delete('/delete/:group_id', ensureAuthenticated, invitesController.delete); | ||
invitesRoutes.post('/accept', ensureAuthenticated, invitesController.accept); | ||
invitesRoutes.post('/reject', ensureAuthenticated, invitesController.reject); | ||
invitesRoutes.post('/registerAdm/:user_id', ensureAuthenticated, invitesController.turnIntoAdm); | ||
|
||
export default invitesRoutes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.