Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #181 from Grupo-G03-4SOAT-FIAP/feature/97/sonar
Browse files Browse the repository at this point in the history
Feature/97/sonar
  • Loading branch information
dannevesdantas authored Apr 12, 2024
2 parents 7bf16b0 + 19f6762 commit 1490fbc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 25 deletions.
5 changes: 4 additions & 1 deletion k8s/development/bff/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ spec:
# based on CPU utilization
requests:
cpu: "250m"
memory: "512Mi"
memory: "256Mi"
limits:
cpu: "0.5"
memory: "1Gi"
9 changes: 9 additions & 0 deletions k8s/development/postgres/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ spec:
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgredb
resources:
# You must specify requests for CPU to autoscale
# based on CPU utilization
requests:
cpu: "250m"
memory: "512Mi"
limits:
cpu: "2"
memory: "4Gi"
volumes:
- name: postgredb
persistentVolumeClaim:
Expand Down
4 changes: 2 additions & 2 deletions k8s/production/bff/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ spec:
# You must specify requests for CPU to autoscale
# based on CPU utilization
requests:
cpu: "200m"
cpu: "250m"
memory: "256Mi"
limits:
cpu: "0.5"
memory: "512Mi"
memory: "1Gi"
17 changes: 1 addition & 16 deletions src/domain/pedido/factories/pedido.dto.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,7 @@ export class PedidoDTOFactory implements IPedidoDTOFactory {

criarListaPedidoDTO(pedidos: PedidoEntity[]): PedidoDTO[] | [] {
const listaPedidosDTO = pedidos.map((pedido: PedidoEntity) => {
const itensPedido = this.criarListaItemPedidoDTO(pedido.itensPedido);

let cliente: ClienteDTO | ClienteModel | null = pedido.cliente;
if (cliente) {
cliente = this.clienteDTOFactory.criarClienteDTO(pedido.cliente);
}

const pedidoDTO = new PedidoDTO();
pedidoDTO.id = pedido.id;
pedidoDTO.numeroPedido = pedido.numeroPedido;
pedidoDTO.itensPedido = itensPedido;
pedidoDTO.pago = pedido.pago;
pedidoDTO.statusPedido = pedido.statusPedido;
pedidoDTO.criadoEm = pedido.criadoEm;
pedidoDTO.atualizadoEm = pedido.atualizadoEm;
pedidoDTO.cliente = cliente;
const pedidoDTO = this.criarPedidoDTO(pedido);
return pedidoDTO;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import {
} from 'src/mocks/categoria.mock';
import { SQLDTOFactory } from '../../factories/sql.dto.factory';

class softDeleteMock {
class SoftDeleteMock {
softDelete: jest.Mock = jest.fn();
}

const categoriaSoftDeleteMock = new softDeleteMock();
const categoriaSoftDeleteMock = new SoftDeleteMock();

describe('CategoriaRepository', () => {
let categoriaRepository: CategoriaRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import {
} from 'src/mocks/cliente.mock';
import { SQLDTOFactory } from '../../factories/sql.dto.factory';

class softDeleteMock {
class SoftDeleteMock {
softDelete: jest.Mock = jest.fn();
}

const clienteSoftDeleteMock = new softDeleteMock();
const clienteSoftDeleteMock = new SoftDeleteMock();

describe('ClienteRepository', () => {
let clienteRepository: ClienteRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
} from 'src/mocks/produto.mock';
import { SQLDTOFactory } from '../../factories/sql.dto.factory';

class softDeleteMock {
class SoftDeleteMock {
softDelete: jest.Mock = jest.fn();
}

const produtoSoftDeleteMock = new softDeleteMock();
const produtoSoftDeleteMock = new SoftDeleteMock();

describe('ProdutoRepository', () => {
let produtoRepository: ProdutoRepository;
Expand Down

0 comments on commit 1490fbc

Please sign in to comment.