This file contains 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 { Entity, PrimaryGeneratedColumn, Column, ManyToMany, JoinTable } from 'typeorm'; | |
import Company from './Company'; | |
@Entity('clients') | |
export default class Client { | |
@PrimaryGeneratedColumn() | |
id: number; | |
@Column() |
This file contains 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
test: | |
services: | |
- name: postgres:latest | |
alias: postgres | |
command: | |
- --max_connections=200 |
This file contains 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
CREATE OR REPLACE FUNCTION checkClientType(int) RETURNS varchar as $$ | |
DECLARE | |
type varchar; | |
BEGIN | |
SELECT client_type INTO type FROM clients WHERE id = $1; | |
RETURN type; | |
END; | |
$$ LANGUAGE plpgsql; |
This file contains 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
CREATE TABLE clients ( | |
id SERIAL UNIQUE, | |
name varchar(255) NOT NULL, | |
client_type client_type NOT NULL, | |
cpf varchar(11), | |
cnpj varchar(14), | |
CHECK(CASE WHEN client_type = 'F' THEN cpf IS NOT NULL END), | |
CHECK(CASE WHEN client_type = 'J' THEN cnpj IS NOT NULL END) | |
); |
This file contains 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
module.exports = { | |
globals: { | |
'ts-jest': { | |
compiler: 'ttypescript', | |
}, | |
}, | |
bail: 1, | |
clearMocks: true, | |
collectCoverage: true, | |
collectCoverageFrom: ['./src/app/**/*.(ts|js)', './src/lib/Mail.ts'], |
This file contains 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 React from 'react'; | |
import './App.css'; | |
import User from '~/components/User'; | |
function App() { | |
return ( | |
<User /> | |
); | |
} |
This file contains 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
module.exports = { | |
env: { | |
browser: true, | |
es6: true, | |
}, | |
extends: [ | |
'plugin:@typescript-eslint/recommended', | |
'plugin:react/recommended', | |
'airbnb', | |
'plugin:import/typescript', |
This file contains 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
{ | |
"compilerOptions": { | |
"baseUrl": "src", | |
"paths": { | |
"~/*": ["*"], | |
"#redux/*": ["store/modules/*"] | |
} | |
} | |
} |
This file contains 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 { override, addBabelPlugin } = require('customize-cra'); | |
// Exportamos a função 'override' para sobreescrever algumas funcionalidades do webpack | |
module.exports = override( | |
// Utilizamos a função 'addBabelPlugin' para adicionar um novo plugin | |
addBabelPlugin([ | |
// Informamos o nome do plugin na primeira posição do array | |
'babel-plugin-root-import', | |
// E as configurações na segunda posição | |
{ |
This file contains 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
module.exports = { | |
env: { | |
browser: true, | |
es6: true, | |
}, | |
extends: [ | |
'plugin:@typescript-eslint/recommended', | |
'plugin:react/recommended', | |
'airbnb', | |
'plugin:import/typescript', |