-
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.
added TZ America/Sao_Paulo removed unnecessary scripts from package npm run format feat: added contact and health routes refactor: agenda, announcement and testimonial can be created without field (as Webmaster) others minor changes
- Loading branch information
1 parent
6ad08d8
commit bdf6dbf
Showing
228 changed files
with
26,037 additions
and
30,729 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
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,90 +1,73 @@ | ||
import { | ||
Controller, | ||
Get, | ||
Post, | ||
Body, | ||
Put, | ||
Param, | ||
Delete, | ||
Query, | ||
} from '@nestjs/common'; | ||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger'; | ||
import { Role, User } from '@prisma/client'; | ||
import { Roles } from 'src/auth/roles'; | ||
import { PaginationDto } from 'src/prisma/dto'; | ||
import { FindByRangeDto, HardRemoveDto, Public, RestoreDto, User as Jwt } from 'src/utils'; | ||
import { | ||
ApiBatchResponse, | ||
ApiCreatedResponse, | ||
ApiResponse, | ||
} from 'src/utils/swagger'; | ||
import { AgendaService } from './agenda.service'; | ||
import { CreateAgendaDto, UpdateAgendaDto } from './dto'; | ||
import { Controller, Get, Post, Body, Put, Param, Delete, Query } from '@nestjs/common' | ||
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger' | ||
import { Role, User } from '@prisma/client' | ||
import { Roles } from 'src/auth/roles' | ||
import { PaginationDto } from 'src/prisma/dto' | ||
import { FindByRangeDto, HardRemoveDto, Public, RestoreDto, User as Jwt } from 'src/utils' | ||
import { ApiBatchResponse, ApiCreatedResponse, ApiResponse } from 'src/utils/swagger' | ||
import { AgendaService } from './agenda.service' | ||
import { CreateAgendaDto, UpdateAgendaDto } from './dto' | ||
|
||
@ApiTags('Agenda') | ||
@Controller('agenda') | ||
export class AgendaController { | ||
constructor(private readonly agendaService: AgendaService) { } | ||
constructor(private readonly agendaService: AgendaService) {} | ||
|
||
@ApiBearerAuth() | ||
@ApiCreatedResponse(CreateAgendaDto) | ||
@Post() | ||
create(@Jwt() user: User, @Body() createAgendaDto: CreateAgendaDto) { | ||
return this.agendaService.create(user, createAgendaDto); | ||
} | ||
@ApiBearerAuth() | ||
@ApiCreatedResponse(CreateAgendaDto) | ||
@Post() | ||
create(@Jwt() user: User, @Body() createAgendaDto: CreateAgendaDto) { | ||
return this.agendaService.create(user, createAgendaDto) | ||
} | ||
|
||
@ApiResponse(CreateAgendaDto, { paginated: true }) | ||
@Public() | ||
@Get() | ||
findAll(@Query() query?: PaginationDto) { | ||
return this.agendaService.findAll(query); | ||
} | ||
@ApiResponse(CreateAgendaDto, { paginated: true }) | ||
@Public() | ||
@Get() | ||
findAll(@Query() query?: PaginationDto) { | ||
return this.agendaService.findAll(query) | ||
} | ||
|
||
@ApiResponse(CreateAgendaDto, { paginated: true }) | ||
@Public() | ||
@Get('range') | ||
findByRange(@Query() query: FindByRangeDto) { | ||
return this.agendaService.findByRange(query); | ||
} | ||
@ApiResponse(CreateAgendaDto, { paginated: true }) | ||
@Public() | ||
@Get('range') | ||
findByRange(@Query() query: FindByRangeDto) { | ||
return this.agendaService.findByRange(query) | ||
} | ||
|
||
@ApiResponse(CreateAgendaDto) | ||
@Public() | ||
@Get(':id') | ||
findOne(@Param('id') id: string) { | ||
return this.agendaService.findOne(id); | ||
} | ||
@ApiResponse(CreateAgendaDto) | ||
@Public() | ||
@Get(':id') | ||
findOne(@Param('id') id: string) { | ||
return this.agendaService.findOne(id) | ||
} | ||
|
||
@ApiBearerAuth() | ||
@ApiBatchResponse() | ||
@Roles(Role.ADMIN) | ||
@Put('restore') | ||
restore(@Body() restoreDto: RestoreDto, @Jwt() user: User) { | ||
return this.agendaService.restore(restoreDto, user); | ||
} | ||
@ApiBearerAuth() | ||
@ApiBatchResponse() | ||
@Roles(Role.ADMIN) | ||
@Put('restore') | ||
restore(@Body() restoreDto: RestoreDto, @Jwt() user: User) { | ||
return this.agendaService.restore(restoreDto, user) | ||
} | ||
|
||
@ApiBearerAuth() | ||
@ApiResponse(CreateAgendaDto) | ||
@Put(':id') | ||
update( | ||
@Param('id') id: string, | ||
@Jwt() user: User, | ||
@Body() updateAgendaDto: UpdateAgendaDto, | ||
) { | ||
return this.agendaService.update(id, user, updateAgendaDto); | ||
} | ||
@ApiBearerAuth() | ||
@ApiResponse(CreateAgendaDto) | ||
@Put(':id') | ||
update(@Param('id') id: string, @Jwt() user: User, @Body() updateAgendaDto: UpdateAgendaDto) { | ||
return this.agendaService.update(id, user, updateAgendaDto) | ||
} | ||
|
||
@ApiBearerAuth() | ||
@ApiBatchResponse() | ||
@Roles(Role.ADMIN) | ||
@Delete('hard-remove') | ||
hardRemove(@Body() hardRemoveDto: HardRemoveDto, @Jwt() user: User) { | ||
return this.agendaService.hardRemove(hardRemoveDto, user); | ||
} | ||
@ApiBearerAuth() | ||
@ApiBatchResponse() | ||
@Roles(Role.ADMIN) | ||
@Delete('hard-remove') | ||
hardRemove(@Body() hardRemoveDto: HardRemoveDto, @Jwt() user: User) { | ||
return this.agendaService.hardRemove(hardRemoveDto, user) | ||
} | ||
|
||
@ApiBearerAuth() | ||
@ApiResponse(CreateAgendaDto) | ||
@Delete(':id') | ||
remove(@Param('id') id: string, @Jwt() user: User) { | ||
return this.agendaService.remove(id, user); | ||
} | ||
@ApiBearerAuth() | ||
@ApiResponse(CreateAgendaDto) | ||
@Delete(':id') | ||
remove(@Param('id') id: string, @Jwt() user: User) { | ||
return this.agendaService.remove(id, user) | ||
} | ||
} |
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,9 +1,9 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { AgendaService } from './agenda.service'; | ||
import { AgendaController } from './agenda.controller'; | ||
import { Module } from '@nestjs/common' | ||
import { AgendaService } from './agenda.service' | ||
import { AgendaController } from './agenda.controller' | ||
|
||
@Module({ | ||
controllers: [AgendaController], | ||
providers: [AgendaService] | ||
controllers: [AgendaController], | ||
providers: [AgendaService], | ||
}) | ||
export class AgendaModule {} |
Oops, something went wrong.