Skip to content

Commit

Permalink
Merge pull request #2 from avm-sistemas/swagger-translate
Browse files Browse the repository at this point in the history
translated to pt-PT and pt-BR
  • Loading branch information
avmesquita authored Dec 7, 2024
2 parents 3d2366e + 1f44155 commit d882309
Show file tree
Hide file tree
Showing 25 changed files with 470 additions and 192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ export class IsMaximumTimeSpentReached {
private readonly leaveRepository: ILeaveRepository
) {}

public async isSatisfiedBy(
event: Event,
newTime: number = 0
): Promise<boolean> {
public async isSatisfiedBy(event: Event, newTime = 0): Promise<boolean> {
const user = event.getUser();
const date = event.getDate();

Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Common/DTO/IdDTO.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNotEmpty, IsUUID } from 'class-validator';
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty } from '@nestjs/swagger';

export class IdDTO {
@ApiProperty()
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Common/DTO/PaginationDTO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Transform } from 'class-transformer';
import { IsNumber, IsOptional, Max, Min } from 'class-validator';
import { ApiPropertyOptional } from "@nestjs/swagger";
import { ApiPropertyOptional } from '@nestjs/swagger';

export class PaginationDTO {
@ApiPropertyOptional()
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Customer/DTO/CustomerDTO.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNotEmpty } from 'class-validator';
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty } from '@nestjs/swagger';

export class CustomerDTO {
@ApiProperty()
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/FairCalendar/DTO/AbstractEventDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from 'class-validator';
import { EventType } from 'src/Domain/FairCalendar/Event.entity';
import { ArrayUtils } from 'src/Infrastructure/Common/Utils/ArrayUtils';
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export abstract class AbstractEventDTO {
@ApiProperty()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsISO8601, IsNotEmpty } from 'class-validator';
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty } from '@nestjs/swagger';

export class AddEventControllerDTO {
@ApiProperty()
Expand Down
3 changes: 1 addition & 2 deletions src/Infrastructure/FairCalendar/DTO/AddEventDTO.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { IsNotEmpty, IsDateString } from 'class-validator';
import { DateGreaterOrEqualThan } from 'src/Infrastructure/Common/Validator/DateGreaterOrEqualThan';
import { AbstractEventDTO } from './AbstractEventDTO';
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty } from '@nestjs/swagger';

export class AddEventDTO extends AbstractEventDTO {

@ApiProperty()
@IsNotEmpty()
@IsDateString()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsOptional, IsUUID, IsNumber } from 'class-validator';
import { ApiPropertyOptional } from "@nestjs/swagger";
import { ApiPropertyOptional } from '@nestjs/swagger';

// TODO test
export class FairCalendarControllerDTO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from 'class-validator';
import { Type } from 'src/Domain/HumanResource/Leave/LeaveRequest.entity';
import { DateGreaterOrEqualThan } from 'src/Infrastructure/Common/Validator/DateGreaterOrEqualThan';
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class LeaveRequestDTO {
@ApiProperty()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsUUID, IsOptional } from 'class-validator';
import { PaginationDTO } from 'src/Infrastructure/Common/DTO/PaginationDTO';
import { ApiPropertyOptional } from "@nestjs/swagger";
import { ApiPropertyOptional } from '@nestjs/swagger';

export class ListLeaveRequestsControllerDTO extends PaginationDTO {
@ApiPropertyOptional()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsEnum, IsNotEmpty, IsOptional } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export enum ModerationAction {
ACCEPT = 'accept',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNotEmpty, IsISO8601, IsOptional } from 'class-validator';
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty } from '@nestjs/swagger';

export class MealTicketRemovalDTO {
@ApiProperty()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNumber, IsOptional } from 'class-validator';
import { ApiPropertyOptional } from "@nestjs/swagger";
import { ApiPropertyOptional } from '@nestjs/swagger';

export class GetPayrollElementsControllerDTO {
@ApiPropertyOptional()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsUUID, IsNumber } from 'class-validator';

export class UserSavingsRecordDTO {
export class UserSavingsRecordDTO {
@IsNotEmpty()
@IsUUID()
@ApiProperty()
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/HumanResource/User/DTO/LoginDTO.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsEmail, IsNotEmpty } from 'class-validator';
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty } from '@nestjs/swagger';

export class LoginDTO {
@ApiProperty()
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/HumanResource/User/DTO/ProfileDTO.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsEmail, IsNotEmpty, IsOptional } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class ProfileDTO {
@ApiProperty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from 'src/Domain/HumanResource/User/UserAdministrative.entity';
import { UserRole } from 'src/Domain/HumanResource/User/User.entity';
import { Transform } from 'class-transformer';
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class UserAdministrativeDTO {
@ApiProperty()
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/HumanResource/User/DTO/UserDTO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IsEmail, IsNotEmpty } from 'class-validator';
import { UserAdministrativeDTO } from './UserAdministrativeDTO';
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty } from '@nestjs/swagger';

export class UserDTO extends UserAdministrativeDTO {
@ApiProperty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class UserRepository implements IUserRepository {

public findUsers(
withAccountant: boolean,
noLeavingDate: boolean = false
noLeavingDate = false
): Promise<User[]> {
const query = this.repository
.createQueryBuilder('user')
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Project/DTO/ProjectDTO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Transform } from 'class-transformer';
import { IsBoolean, IsNotEmpty, IsOptional, IsUUID } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class ProjectDTO {
@ApiProperty()
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Task/DTO/TaskDTO.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNotEmpty } from 'class-validator';
import { ApiProperty } from "@nestjs/swagger";
import { ApiProperty } from '@nestjs/swagger';

export class TaskDTO {
@ApiProperty()
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Task/Repository/TaskRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class TaskRepository implements ITaskRepository {
.getOne();
}

public findTasks(page: number = 1): Promise<[Task[], number]> {
public findTasks(page = 1): Promise<[Task[], number]> {
return this.repository
.createQueryBuilder('task')
.select(['task.id', 'task.name'])
Expand Down
11 changes: 7 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ async function bootstrap() {

const swaggerCustomOptions = {
explorer: false,
customCss: '.swagger-ui .topbar { background-color: black; } .swagger-ui img { display: none; }',
customCss:
'.swagger-ui .topbar { background-color: black; } .swagger-ui img { display: none; }',
customSiteTitle: 'Permacoop API',
customfavIcon: ""
}
customfavIcon: ''
};

const swaggerOptions = new DocumentBuilder()
.setTitle('Permacoop API')
.setDescription('Permacoop is an open source and eco design ERP solution reserved for worker-owned business.')
.setDescription(
'Permacoop is an open source and eco design ERP solution reserved for worker-owned business.'
)
.setVersion('1.0')
.addBearerAuth()
.build();
Expand Down
Loading

0 comments on commit d882309

Please sign in to comment.