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 #180 from Grupo-G03-4SOAT-FIAP/feature/93/flag-cog…
Browse files Browse the repository at this point in the history
…nito

fix: Remove a flag ENABLE_AMZ_COGNITO_CIAM
  • Loading branch information
dannevesdantas authored Apr 13, 2024
2 parents 67a1814 + eb221ec commit 8b518fd
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ DB_NAME=rms
DB_SSL=false

# Amazon Cognito
ENABLE_AMZ_COGNITO_CIAM=false
COGNITO_USER_POOL_ID=
COGNITO_CLIENT_ID=

Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ services:
DB_PASSWORD: ${DB_PASSWORD:-pgpwd}
DB_NAME: ${DB_NAME:-rms}
DB_SSL: ${DB_SSL:-false}
ENABLE_AMZ_COGNITO_CIAM: ${ENABLE_AMZ_COGNITO_CIAM:-false}
COGNITO_USER_POOL_ID: ${COGNITO_USER_POOL_ID:-}
COGNITO_CLIENT_ID: ${COGNITO_CLIENT_ID:-}
ENABLE_MERCADOPAGO: ${ENABLE_MERCADOPAGO:-false}
Expand Down
1 change: 0 additions & 1 deletion k8s/development/bff/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ metadata:
data:
DB_NAME: "rms"
DB_SSL: "false"
ENABLE_AMZ_COGNITO_CIAM: "false"
ENABLE_MERCADOPAGO: "false"
IDEMPOTENCY_KEY_MERCADOPAGO: "a005986e-f97c-4274-91cf-b32d2672824f"
1 change: 0 additions & 1 deletion k8s/production/bff/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ metadata:
data:
DB_NAME: "rms"
DB_SSL: "false"
ENABLE_AMZ_COGNITO_CIAM: "true"
ENABLE_MERCADOPAGO: "true"
IDEMPOTENCY_KEY_MERCADOPAGO: "a005986e-f97c-4274-91cf-b32d2672824f"
3 changes: 0 additions & 3 deletions src/mocks/pedido.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ export const pedidoTypeORMMock: jest.Mocked<Repository<PedidoModel>> = {

export const configServiceMock = {
get: jest.fn((key: string) => {
if (key === 'ENABLE_AMZ_COGNITO_CIAM') {
return 'true';
}
if (key === 'ENABLE_MERCADOPAGO') {
return 'false';
}
Expand Down
10 changes: 0 additions & 10 deletions src/presentation/rest/v1/controllers/pedido/pedido.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ export class PedidoController {
@Body() criaPedidoDTO: CriaPedidoDTO,
) {
const criaClienteDTO = new CriaClienteDTO();
if (this.amazonCognitoIsEnabled()) {
criaPedidoDTO.cpfCliente = username;
criaClienteDTO.nome = name;
criaClienteDTO.email = email;
criaClienteDTO.cpf = username;
}
try {
return await this.pedidoUseCase.criarPedido(
criaClienteDTO,
Expand Down Expand Up @@ -188,12 +186,4 @@ export class PedidoController {
throw error;
}
}

private amazonCognitoIsEnabled(): boolean {
return (
this.configService
.get<string>('ENABLE_AMZ_COGNITO_CIAM')
?.toLowerCase() === 'true'
);
}
}

0 comments on commit 8b518fd

Please sign in to comment.