push da documentacao da api

This commit is contained in:
JurTI-BR
2025-04-02 18:18:13 -03:00
parent 4719279ab7
commit 15bb11fc4c
6 changed files with 578 additions and 337 deletions

190
README.md
View File

@@ -1,73 +1,157 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>
# Portal Juru API
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
API para gerenciamento de pedidos, pagamentos e consultas de dados do sistema Portal Juru.
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
## 🚀 Tecnologias
## Description
- [NestJS](https://nestjs.com/) - Framework Node.js
- [TypeORM](https://typeorm.io/) - ORM para banco de dados
- [Swagger](https://swagger.io/) - Documentação da API
- [Oracle Database](https://www.oracle.com/database/) - Banco de dados
- [Redis](https://redis.io/) - Cache em memória
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
## 📋 Pré-requisitos
## Installation
- Node.js (v16 ou superior)
- Oracle Database
- Redis
- npm ou yarn
## 🔧 Instalação
1. Clone o repositório:
```bash
$ npm install
git clone https://github.com/seu-usuario/portaljuru-api.git
cd portaljuru-api
```
## Running the app
2. Instale as dependências:
```bash
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
npm install
# ou
yarn install
```
## Test
3. Configure as variáveis de ambiente:
```bash
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
cp .env.example .env
# Edite o arquivo .env com suas configurações
```
## Support
4. Inicie o servidor:
```bash
npm run start:dev
# ou
yarn start:dev
```
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
## 📚 Documentação da API
## Stay in touch
A documentação completa da API está disponível em `/api` quando o servidor estiver rodando.
- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)
### Endpoints Principais
## License
#### Consulta de Dados
- `GET /api/v1/data-consult/stores` - Lista todas as lojas
- `GET /api/v1/data-consult/sellers` - Lista todos os vendedores
- `GET /api/v1/data-consult/billings` - Retorna informações de faturamento
- `GET /api/v1/data-consult/customers/:filter` - Filtra clientes
- `GET /api/v1/data-consult/products/:filter` - Busca produtos filtrados
Nest is [MIT licensed](LICENSE).
#### Pedidos e Pagamentos
- `GET /api/v1/orders-payment/orders/:id` - Lista pedidos de uma loja
- `GET /api/v1/orders-payment/orders/:id/:orderId` - Busca pedido específico
- `GET /api/v1/orders-payment/payments/:id` - Lista pagamentos de um pedido
- `POST /api/v1/orders-payment/payments/create` - Cria novo pagamento
- `POST /api/v1/orders-payment/invoice/create` - Cria nova fatura
## 🛠️ Estrutura do Projeto
```
src/
├── core/ # Configurações e utilitários core
│ ├── configs/ # Configurações do projeto
│ ├── database/ # Configuração do banco de dados
│ └── constants/ # Constantes do sistema
├── data-consult/ # Módulo de consulta de dados
│ ├── dto/ # Data Transfer Objects
│ ├── controllers/ # Controladores
│ └── services/ # Serviços
├── orders-payment/ # Módulo de pedidos e pagamentos
│ ├── dto/ # Data Transfer Objects
│ ├── controllers/ # Controladores
│ └── services/ # Serviços
└── orders/ # Módulo de pedidos
├── modules/ # Módulos
├── controllers/ # Controladores
├── services/ # Serviços
└── repositories/ # Repositórios
```
## 🔐 Autenticação
A API utiliza autenticação JWT. Para acessar os endpoints protegidos, inclua o token no header:
```
Authorization: Bearer seu-token-jwt
```
## 📦 DTOs (Data Transfer Objects)
### OrderDto
```typescript
{
createDate: Date; // Data de criação do pedido
storeId: string; // ID da loja
orderId: number; // ID do pedido
customerId: string; // ID do cliente
customerName: string; // Nome do cliente
sellerId: string; // ID do vendedor
sellerName: string; // Nome do vendedor
billingId: string; // ID da forma de pagamento
billingName: string; // Nome da forma de pagamento
planId: string; // ID do plano de pagamento
planName: string; // Nome do plano de pagamento
amount: number; // Valor total do pedido
installments: number; // Número de parcelas
amountPaid: number; // Valor total pago
}
```
### PaymentDto
```typescript
{
orderId: number; // ID do pedido
payDate: Date; // Data do pagamento
card: string; // Número do cartão
installments: number; // Número de parcelas
flagName: string; // Nome da bandeira
type: string; // Tipo de pagamento
amount: number; // Valor do pagamento
userId: string; // ID do usuário
nsu: string; // NSU da transação
auth: string; // Código de autorização
}
```
## 🧪 Testes
Para executar os testes:
```bash
npm run test
# ou
yarn test
```
## 📝 Licença
Este projeto está sob a licença MIT. Veja o arquivo [LICENSE](LICENSE) para mais detalhes.
## 🤝 Contribuição
1. Faça o fork do projeto
2. Crie uma branch para sua feature (`git checkout -b feature/AmazingFeature`)
3. Commit suas mudanças (`git commit -m 'Add some AmazingFeature'`)
4. Push para a branch (`git push origin feature/AmazingFeature`)
5. Abra um Pull Request