src/client/dto/client.dto.ts
Properties |
clientId |
Type : number
|
Decorators :
@ApiProperty({example: 1})
|
Defined in src/client/dto/client.dto.ts:142
|
conversionTypeId |
Type : number
|
Decorators :
@ApiProperty({example: 1})
|
Defined in src/client/dto/client.dto.ts:144
|
import { ApiProperty } from '@nestjs/swagger';
import { Observation } from '../../entities/observation';
import { IsEnum, IsNotEmpty } from 'class-validator';
import { statusDeployment } from 'src/types/statusDeployment';
import { enumTypeClientConfig } from '../types/enum-type-client-config';
export class PaginateClientQueryDTO {
@ApiProperty({ default: 0 })
page: number;
@ApiProperty({ default: 10 })
size: number;
@ApiProperty({ required: false })
name: string;
}
export class ClientDto {
@ApiProperty({ example: 'ASO SISTEMA' })
@IsNotEmpty()
name: string;
@ApiProperty({ example: '00000000000000', required: false })
cnpj?: string;
@ApiProperty({ example: '11111', required: false })
internalCode?: string;
@ApiProperty()
company: string;
@ApiProperty({ example: true, required: false })
useChannel?: boolean;
// @ApiProperty({ example: ['00000000000000','00000000000001','00000000000002'] })
// cnpjs: any[] ;
// @ApiProperty({ example: [{observation:'Comentario'}] })
// observation: ObservationDto[];
// @ApiProperty({ example: 'mtrix' })
// realm: string;
@ApiProperty({ example: true })
enabled: boolean;
@ApiProperty({ example: 'F', required: true })
type: 'F' | 'D';
@ApiProperty({ example: 1000, required: false })
mtrixCode: number;
@ApiProperty({
enum: statusDeployment,
required: true,
example: statusDeployment.HOMOLOGACAO,
})
@IsEnum(statusDeployment)
statusDeploymentId: statusDeployment;
}
export class ClientPostDto extends ClientDto {
@ApiProperty({ example: 'Comentario' })
observation?: string;
}
export class ClientPostResponseDto extends ClientDto {
@ApiProperty({
example: [
{
observation: 'Comentario',
userId: '228773c4-8d66-4f9d-8830-45acb3683dff',
username: 'testeadmin',
clientId: 49,
applicationId: null,
id: 45,
createdAt: '2023-01-24T21:11:46.354Z',
updatedAt: '2023-01-24T21:11:46.354Z',
},
],
})
observation?: Observation[];
}
export class ClientEnableDto {
@ApiProperty({ example: true })
enabled: boolean;
}
export class ObservationDto {
@ApiProperty({ example: 1, required: true })
@IsNotEmpty()
clientId: number;
@ApiProperty({ example: 1, required: false })
applicationId?: number;
@ApiProperty({ example: 'comentario sobre o contrato com o client' })
@IsNotEmpty()
observation: string;
}
export class AddApplicationClientBody {
@ApiProperty({ example: 0 })
applicationId: number;
@ApiProperty({ example: 'http://localhost:3000' })
url: string;
}
export class AddLevelBody {
@ApiProperty({ example: 1 })
clientId: number;
@ApiProperty({ example: 'Nivel 1' })
levelName: string;
}
export class DeleteLevelBody {
@ApiProperty({ example: 1 })
clientId: number;
@ApiProperty({ example: 1 })
levelCode: number;
}
export class DeleteLevelOptionBody {
@ApiProperty({ example: 1 })
clientId: number;
@ApiProperty({ example: 1 })
levelCode: number;
@ApiProperty({ example: 1 })
levelOptionCode: number;
}
export class AddLevelOptionBody {
@ApiProperty({ example: 1 })
clientId: number;
@ApiProperty({ example: 1 })
levelCode: number;
@ApiProperty({ example: 'Nivel 1' })
levelName: string;
}
export class AddConversionTypeBody {
@ApiProperty({ example: 1 })
clientId: number;
@ApiProperty({ example: 1 })
conversionTypeId: number;
@ApiProperty({ example: 'Nivel 1' })
conversionTypeName: string;
@ApiProperty({ example: 1 })
conversaoFactor: number;
}
export class DeleteConversionTypeBody {
@ApiProperty({ example: 1 })
clientId: number;
@ApiProperty({ example: 1 })
conversionTypeId: number;
}
export class FindClientByMtrixCodeQueryDTO {
@ApiProperty({ default: 0 })
mtrixCode: number;
@ApiProperty({ default: 'F', enum: ['D', 'F'] })
clientType: 'F' | 'D';
}
export class BodyClientConfigDTO {
@ApiProperty({ default: 0 })
clientId: number;
@ApiProperty({
default: enumTypeClientConfig.PROCESSING,
enum: enumTypeClientConfig,
})
typeClientConfigId: number;
@ApiProperty({ default: 24 })
numberMonths: number;
}
export class DeleteClientConfigDTO {
@ApiProperty({ default: 0 })
id: number;
@ApiProperty({ default: 0 })
clientId: number
}