swagger configurado na rota chavenfe

This commit is contained in:
unknown
2025-03-29 15:06:21 -03:00
parent 5e4ef04b4a
commit 32bd7c14b3
29 changed files with 709 additions and 241 deletions

View File

@@ -0,0 +1,21 @@
import { Injectable, NotFoundException } from '@nestjs/common';
import { InvoiceRepository } from '../repositories/invoice.repository';
import { InvoiceDto } from '../dto/invoice.dto';
@Injectable()
export class InvoiceService {
constructor(private readonly invoiceRepo: InvoiceRepository) {}
async getInvoiceByChave(chavenfe: string): Promise<InvoiceDto> {
const invoice = await this.invoiceRepo.findInvoiceByChave(chavenfe);
if (!invoice) {
throw new NotFoundException('Nota fiscal não localizada.');
}
const itens = await this.invoiceRepo.findInvoiceItems(invoice.transactionId);
return {
...invoice,
itens,
};
}
}

View File

@@ -0,0 +1,6 @@
///← Orquestra operações de pedido
import { Injectable } from '@nestjs/common';