8000 Swagger and Translations to pt-PT and pt-BR by avmesquita · Pull Request #453 · fairnesscoop/permacoop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Swagger and Translations to pt-PT and pt-BR #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 align="center"><a href="https://fairness.coop"><img src="https://fairness.coop/image/fairness_logo.svg" alt="Fairness"></a></h1>
<h1 align="center"><a href="https://fairness.coop"><img src="/src/public/images/logo.png" alt="Fairness"></a></h1>

Permacoop is an open source and eco design ERP solution reserved for worker-owned business.

Expand Down
59 changes: 35 additions & 24 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@nestjs/cqrs": "^9.0.1",
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.2.0",
"@nestjs/swagger": "^6.1.3",
"@nestjs/swagger": "^6.3.0",
"@nestjs/typeorm": "^9.0.1",
"argon2": "^0.26.2",
"axios": "^1.7.2",
Expand Down
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: 2 additions & 0 deletions src/Infrastructure/Common/DTO/IdDTO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { IsNotEmpty, IsUUID } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class IdDTO {
@ApiProperty()
@IsNotEmpty()
@IsUUID()
public id: string;
Expand Down
2 changes: 2 additions & 0 deletions src/Infrastructure/Common/DTO/PaginationDTO.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Transform } from 'class-transformer';
import { IsNumber, IsOptional, Max, Min } from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';

export class PaginationDTO {
@ApiPropertyOptional()
@IsOptional()
@Min(1)
@Max(10000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import { WithName } from 'src/Infrastructure/Common/ExtendedRouting/WithName';
import { CreateCustomerCommand } from 'src/Application/Customer/Command/CreateCustomerCommand';
import { CustomerDTO } from 'src/Infrastructure/Customer/DTO/CustomerDTO';
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('Customer')
@Controller('app/customers/add')
@UseGuards(IsAuthenticatedGuard)
export class AddCustomerController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import { GetCustomerByIdQuery } from 'src/Application/Customer/Query/GetCustomer
import { CustomerDTO } from 'src/Infrastructure/Customer/DTO/CustomerDTO';
import { UpdateCustomerCommand } from 'src/Application/Customer/Command/UpdateCustomerCommand';
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('Customer')
@Controller('app/customers/edit')
@UseGuards(IsAuthenticatedGuard)
export class EditCustomerController {
Expand Down
2 changes: 2 additions & 0 deletions src/Infrastructure/Customer/DTO/CustomerDTO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { IsNotEmpty } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CustomerDTO {
@ApiProperty()
@IsNotEmpty()
public name: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import { GetCooperativeQuery } from 'src/Application/Settings/Query/GetCooperati
import { ArrayUtils } from 'src/Infrastructure/Common/Utils/ArrayUtils';
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { makeMonthUrl } from '../Routing/urls';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('Calendar')
@Controller('app/faircalendar/events/add')
@UseGuards(IsAuthenticatedGuard)
export class AddEventController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/Rou
import { EventView } from 'src/Application/FairCalendar/View/EventView';
import { GetEventByIdQuery } from 'src/Application/FairCalendar/Query/GetEventByIdQuery';
import { makeMonthUrl } from '../Routing/urls';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('Calendar')
@Controller('app/faircalendar/events/delete')
@UseGuards(IsAuthenticatedGuard)
export class DeleteEventController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import { GetEventByIdQuery } from 'src/Application/FairCalendar/Query/GetEventBy
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { makeMonthUrl } from '../Routing/urls';
import { EventView } from 'src/Application/FairCalendar/View/EventView';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('Calendar')
@Controller('app/faircalendar/events/edit')
@UseGuards(IsAuthenticatedGuard)
export class EditEventController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import { FairCalendarOverviewTableFactory } from '../Table/FairCalendarOverviewT
import { IDateUtils } from 'src/Application/IDateUtils';
import { ArrayUtils } from 'src/Infrastructure/Common/Utils/ArrayUtils';
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('Calendar')
@Controller('app/faircalendar')
@UseGuards(IsAuthenticatedGuard)
export class FairCalendarController {
Expand Down
6 changes: 6 additions & 0 deletions src/Infrastructure/FairCalendar/DTO/AbstractEventDTO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,31 @@ 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';

export abstract class AbstractEventDTO {
@ApiProperty()
@IsNotEmpty()
@IsEnum(EventType)
public type: EventType;

@ApiProperty()
@IsNotEmpty()
@IsInt()
@IsIn([...ArrayUtils.range(30, 480, 30)])
public time: number;

@ApiPropertyOptional()
@IsOptional()
@IsUUID()
public projectId?: string;

@ApiPropertyOptional()
@IsOptional()
@IsUUID()
public taskId?: string;

@ApiPropertyOptional()
@IsOptional()
@IsString()
public summary?: string;
Expand Down
3 changes: 3 additions & 0 deletions src/Infrastructure/FairCalendar/DTO/AddEventControllerDTO.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { IsISO8601, IsNotEmpty } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class AddEventControllerDTO {
@ApiProperty()
@IsNotEmpty()
@IsISO8601()
public startDate: string;

@ApiProperty()
@IsNotEmpty()
@IsISO8601()
public endDate: string;
Expand Down
3 changes: 3 additions & 0 deletions src/Infrastructure/FairCalendar/DTO/AddEventDTO.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { IsNotEmpty, IsDateString } from 'class-validator';
import { DateGreaterOrEqualThan } from 'src/Infrastructure/Common/Validator/DateGreaterOrEqualThan';
import { AbstractEventDTO } from './AbstractEventDTO';
import { ApiProperty } from '@nestjs/swagger';

export class AddEventDTO extends AbstractEventDTO {
@ApiProperty()
@IsNotEmpty()
@IsDateString()
public startDate: string;

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

// TODO test
export class FairCalendarControllerDTO {
@ApiPropertyOptional()
@IsUUID()
@IsOptional()
public userId?: string;

@ApiPropertyOptional()
@IsNumber()
@IsOptional()
public month?: number;

@ApiPropertyOptional()
@IsNumber()
@IsOptional()
public year?: number;
Expand Down
2 changes: 2 additions & 0 deletions src/Infrastructure/Home/Controller/HomeController.ts
10000
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import {
Res,
UseGuards
} from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Response } from 'express';
import { GetPendingLeaveRequestsCountQuery } from 'src/Application/HumanResource/Leave/Query/GetPendingLeaveRequestsCountQuery';
import { IQueryBus } from 'src/Application/IQueryBus';
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { WithName } from 'src/Infrastructure/Common/ExtendedRouting/WithName';
import { IsAuthenticatedGuard } from 'src/Infrastructure/HumanResource/User/Security/IsAuthenticatedGuard';

@ApiTags('Home')
@Controller()
@UseGuards(IsAuthenticatedGuard)
export class HomeController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import { WithName } from 'src/Infrastructure/Common/ExtendedRouting/WithName';
import { User } from 'src/Domain/HumanResource/User/User.entity';
import { Type } from 'src/Domain/HumanResource/Leave/LeaveRequest.entity';
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('HR :: Leave')
@Controller('app/people/leave-requests/add')
@UseGuards(IsAuthenticatedGuard)
export class AddLeaveRequestController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import { DeleteLeaveRequestCommand } from 'src/Application/HumanResource/Leave/C
import { WithName } from 'src/Infrastructure/Common/ExtendedRouting/WithName';
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { IsAuthenticatedGuard } from '../../User/Security/IsAuthenticatedGuard';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('HR :: Leave')
@Controller('app/people/leave-requests/delete')
@UseGuards(IsAuthenticatedGuard)
export class DeleteLeaveRequestController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import { GetLeaveRequestByIdQuery } from 'src/Application/HumanResource/Leave/Qu
import { IQueryBus } from 'src/Application/IQueryBus';
import { RouteNameResolver } from 'src/Infrastructure/Common/ExtendedRouting/RouteNameResolver';
import { DoesLeaveRequestBelongToUser } from 'src/Domain/HumanResource/Leave/Specification/DoesLeaveRequestBelongToUser';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('HR :: Leave')
@Controller('app/people/leave-requests/edit')
@UseGuards(IsAuthenticatedGuard)
export class EditLeaveRequestController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { IQueryBus } from 'src/Application/IQueryBus';
import { CalendarTokenGuard } from 'src/Infrastructure/HumanResource/User/Security/CalendarTokenGuard';
import { GetLeavesCalendarQuery } from 'src/Application/HumanResource/Leave/Query/GetLeavesCalendarQuery';
import { WithName } from 'src/Infrastructure/Common/ExtendedRouting/WithName';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('HR :: Leave')
@Controller('api/leaves/calendar.ics')
@UseGuards(CalendarTokenGuard)
export class ExportLeavesCalendarController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import { CanLeaveRequestBeModerated } from 'src/Domain/HumanResource/Leave/Speci
import { LeaveRequestDetailView } from 'src/Application/HumanResource/Leave/View/LeaveRequestDetailView';
import { DoesLeaveRequestBelongToUser } from 'src/Domain/HumanResource/Leave/Specification/DoesLeaveRequestBelongToUser';
import { Status } from 'src/Domain/HumanResource/Leave/LeaveRequest.entity';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('HR :: Leave')
@Controller('app/people/leaves')
@UseGuards(IsAuthenticatedGuard)
export class GetLeaveRequestController {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import { GetLeaveRequestsOverviewQuery } from 'src/Application/HumanResource/Lea
import { UserView } from 'src/Application/HumanResource/User/View/UserView';
import { GetUsersQuery } from 'src/Application/HumanResource/User/Query/GetUsersQuery';
import { ListLeaveRequestsControllerDTO } from '../DTO/ListLeaveRequestsControllerDTO';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('HR :: Leave')
@Controller('app/people/leave_requests')
@UseGuards(IsAuthenticatedGuard)
export class ListLeaveRequestsController {
Expand Down
Loading
0