feat: adiciona endpoint oferta-8026 para buscar ofertas promocionais
This commit is contained in:
36
src/products/dto/oferta-8026-query.dto.ts
Normal file
36
src/products/dto/oferta-8026-query.dto.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, IsNotEmpty, IsNumber, IsString, Matches } from 'class-validator';
|
||||
|
||||
/**
|
||||
* DTO para requisição de ofertas 8026
|
||||
*/
|
||||
export class Oferta8026QueryDto {
|
||||
@ApiProperty({
|
||||
description: 'Data de início da vigência da promoção (formato DD/MM/YYYY)',
|
||||
example: '19/11/2025',
|
||||
})
|
||||
@IsString()
|
||||
@Matches(/^\d{2}\/\d{2}\/\d{4}$/, {
|
||||
message: 'Data deve estar no formato DD/MM/YYYY',
|
||||
})
|
||||
@IsNotEmpty()
|
||||
data: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Array de códigos de produtos',
|
||||
example: [62602],
|
||||
type: [Number],
|
||||
})
|
||||
@IsArray()
|
||||
@IsNotEmpty()
|
||||
codprod: number[];
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Número da região',
|
||||
example: 1,
|
||||
})
|
||||
@IsNumber()
|
||||
@IsNotEmpty()
|
||||
numregiao: number;
|
||||
}
|
||||
|
||||
76
src/products/dto/oferta-8026-response.dto.ts
Normal file
76
src/products/dto/oferta-8026-response.dto.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
/**
|
||||
* DTO para resposta de ofertas 8026
|
||||
*/
|
||||
export class Oferta8026ResponseDto {
|
||||
@ApiProperty({
|
||||
description: 'Código do produto',
|
||||
example: 12345,
|
||||
})
|
||||
codprod: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Descrição do produto',
|
||||
example: 'PRODUTO EXEMPLO',
|
||||
})
|
||||
descricao: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Marca do produto',
|
||||
example: 'MARCA EXEMPLO',
|
||||
})
|
||||
marca: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Unidade do produto',
|
||||
example: 'UN',
|
||||
})
|
||||
unidade: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Preço de venda 1',
|
||||
example: 99.9,
|
||||
})
|
||||
pvenda1: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Preço fixo promocional',
|
||||
example: 79.9,
|
||||
})
|
||||
precofixo: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Percentual de desconto',
|
||||
example: 20,
|
||||
})
|
||||
percdesconto: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Data de fim da vigência',
|
||||
example: '2024-12-31',
|
||||
})
|
||||
dtfimvigencia: Date;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Mensagem para débito',
|
||||
example: 'DEBITO',
|
||||
required: false,
|
||||
})
|
||||
mensagem2: string | null;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Mensagem para à vista',
|
||||
example: 'À VISTA',
|
||||
required: false,
|
||||
})
|
||||
mensagem3: string | null;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Mensagem para 10x',
|
||||
example: '10X',
|
||||
required: false,
|
||||
})
|
||||
mensagem4: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user