implmentação swagger no modulo orders-payment
This commit is contained in:
17
src/orders-payment/dto/create-invoice.dto.ts
Normal file
17
src/orders-payment/dto/create-invoice.dto.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class CreateInvoiceDto {
|
||||
@ApiProperty({
|
||||
description: 'ID do pedido',
|
||||
example: 12345,
|
||||
required: true,
|
||||
})
|
||||
orderId: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID do usuário',
|
||||
example: '001',
|
||||
required: true,
|
||||
})
|
||||
userId: number;
|
||||
}
|
||||
66
src/orders-payment/dto/create-payment.dto.ts
Normal file
66
src/orders-payment/dto/create-payment.dto.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class CreatePaymentDto {
|
||||
@ApiProperty({
|
||||
description: 'ID do pedido',
|
||||
example: 12345,
|
||||
required: true,
|
||||
})
|
||||
orderId: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Número do cartão',
|
||||
example: '**** **** **** 1234',
|
||||
required: true,
|
||||
})
|
||||
card: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Código de autorização',
|
||||
example: 'A12345',
|
||||
required: true,
|
||||
})
|
||||
auth: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'NSU da transação',
|
||||
example: '123456789',
|
||||
required: true,
|
||||
})
|
||||
nsu: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Número de parcelas',
|
||||
example: 3,
|
||||
required: true,
|
||||
})
|
||||
installments: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Valor do pagamento',
|
||||
example: 1000.00,
|
||||
required: true,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Nome da bandeira',
|
||||
example: 'VISA',
|
||||
required: true,
|
||||
})
|
||||
flagName: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Tipo de pagamento',
|
||||
example: 'CREDITO',
|
||||
required: true,
|
||||
})
|
||||
paymentType: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID do usuário',
|
||||
example: '001',
|
||||
required: true,
|
||||
})
|
||||
userId: number;
|
||||
}
|
||||
91
src/orders-payment/dto/order.dto.ts
Normal file
91
src/orders-payment/dto/order.dto.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class OrderDto {
|
||||
@ApiProperty({
|
||||
description: 'Data de criação do pedido',
|
||||
example: '2024-04-02T10:00:00Z',
|
||||
})
|
||||
createDate: Date;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID da loja',
|
||||
example: '001',
|
||||
})
|
||||
storeId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID do pedido',
|
||||
example: 12345,
|
||||
})
|
||||
orderId: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID do cliente',
|
||||
example: '12345',
|
||||
})
|
||||
customerId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Nome do cliente',
|
||||
example: 'João da Silva',
|
||||
})
|
||||
customerName: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID do vendedor',
|
||||
example: '001',
|
||||
})
|
||||
sellerId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Nome do vendedor',
|
||||
example: 'Maria Santos',
|
||||
})
|
||||
sellerName: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID da forma de pagamento',
|
||||
example: '001',
|
||||
})
|
||||
billingId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Nome da forma de pagamento',
|
||||
example: 'Cartão de Crédito',
|
||||
})
|
||||
billingName: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID do plano de pagamento',
|
||||
example: '001',
|
||||
})
|
||||
planId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Nome do plano de pagamento',
|
||||
example: '3x sem juros',
|
||||
})
|
||||
planName: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Valor total do pedido',
|
||||
example: 1000.00,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Número de parcelas',
|
||||
example: 3,
|
||||
})
|
||||
installments: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Valor total pago',
|
||||
example: 1000.00,
|
||||
})
|
||||
amountPaid: number;
|
||||
|
||||
constructor(partial: Partial<OrderDto>) {
|
||||
Object.assign(this, partial);
|
||||
}
|
||||
}
|
||||
67
src/orders-payment/dto/payment.dto.ts
Normal file
67
src/orders-payment/dto/payment.dto.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class PaymentDto {
|
||||
@ApiProperty({
|
||||
description: 'ID do pedido',
|
||||
example: 12345,
|
||||
})
|
||||
orderId: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Data do pagamento',
|
||||
example: '2024-04-02T10:00:00Z',
|
||||
})
|
||||
payDate: Date;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Número do cartão',
|
||||
example: '**** **** **** 1234',
|
||||
})
|
||||
card: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Número de parcelas',
|
||||
example: 3,
|
||||
})
|
||||
installments: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Nome da bandeira',
|
||||
example: 'VISA',
|
||||
})
|
||||
flagName: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Tipo de pagamento',
|
||||
example: 'CREDITO',
|
||||
})
|
||||
type: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Valor do pagamento',
|
||||
example: 1000.00,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'ID do usuário',
|
||||
example: '001',
|
||||
})
|
||||
userId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'NSU da transação',
|
||||
example: '123456789',
|
||||
})
|
||||
nsu: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'Código de autorização',
|
||||
example: 'A12345',
|
||||
})
|
||||
auth: string;
|
||||
|
||||
constructor(partial: Partial<PaymentDto>) {
|
||||
Object.assign(this, partial);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user