This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tech.cereshub.springcrmbff.group.entity; | |
import com.fasterxml.jackson.annotation.JsonManagedReference; | |
import lombok.*; | |
import javax.persistence.*; | |
import java.time.LocalDateTime; | |
import java.util.Set; | |
@Data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Getter | |
@Setter | |
@Builder | |
@NoArgsConstructor | |
@AllArgsConstructor | |
@Entity | |
@Table(name = "passwords") | |
public class Password { | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const https = require('https'); | |
const cors = require('cors')({ | |
origin: true, | |
}); | |
exports.searchCnpj = functions.https.onRequest(async (req, res) => { | |
return cors(req, res, () => { | |
const cnpj = req.query.cnpj; | |
https.get('https://www.receitaws.com.br/v1/cnpj/' + cnpj, (resp) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createParamDecorator } from '@nestjs/common'; | |
import { User } from 'src/users/user.entity'; | |
export const GetUser = createParamDecorator( | |
(data, req): User => { | |
const user = req.args[0].user; | |
return user; | |
}, | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { TypeOrmModuleOptions } from '@nestjs/typeorm'; | |
export const typeOrmConfig: TypeOrmModuleOptions = { | |
type: 'postgres', | |
host: 'pgsql', | |
port: 5432, | |
username: 'pguser', | |
password: 'pgpassword', | |
database: 'nestjs', | |
entities: [__dirname + '/../**/*.entity.{js,ts}'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
api: | |
build: | |
context: . | |
dockerfile: api.Dockerfile | |
ports: | |
- '3000:3000' | |
container_name: api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
logs | |
Dockerfile | |
docker-compose.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:alpine | |
# diretório alvo | |
RUN mkdir -p /usr/src/node-api | |
WORKDIR /usr/src/node-api | |
# instalação de dependências | |
RUN apk update && apk upgrade | |
RUN apk add python3 g++ make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Test, TestingModule } from '@nestjs/testing'; | |
import { UserRepository } from './../users/users.repository'; | |
import { UsersService } from './users.service'; | |
import { UserRole } from './user-roles.enum'; | |
import { CreateUserDto } from './dto/create-user.dto'; | |
import { | |
UnprocessableEntityException, | |
NotFoundException, | |
} from '@nestjs/common'; | |
import { FindUsersQueryDto } from './dto/find-users-query-dto'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Injectable, | |
UnprocessableEntityException, | |
NotFoundException, | |
} from '@nestjs/common'; | |
import { InjectRepository } from '@nestjs/typeorm'; | |
import { UserRepository } from './users.repository'; | |
import { CreateUserDto } from './dto/create-user.dto'; | |
import { User } from './user.entity'; | |
import { UserRole } from './user-roles.enum'; |
NewerOlder