- Composição
-
Todos os povos da terra média, devem ter uma lista de equipamentos
- Equipamentos tem: nome e preço
- Uma pessoa da terra média começa sempre com:
- Adaga Enferrujada
- Custa 5 dinheiros
-
Implementação sem composição
import People from "./People";
-
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
class Turma { | |
constructor(private inspiracao = 100){} | |
incrementInspiracao(valor: number){ | |
this.inspiracao += valor | |
} | |
getInspiracao(){ | |
return this.inspiracao | |
} |
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
// no mongo ou mongosh | |
// use aula_11_4; | |
// no vscode \/ | |
use("aula_11_4"); | |
db.students.drop() | |
db.students.insertMany( | |
[ |
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
// undefined = nenhum parâmetro é necessário, enquanto que: | |
// z.object({ | |
// id: z.string({ | |
// invalid_type_error: 'INVALID_ID_TYPE', | |
// required_error: 'REQUIRED_ID', | |
// }), | |
//}) representa uma rota que espera os parâmetros no seguinte formato: { id: string } | |
const appRoutes = { | |
home: undefined, |
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
// "strictPropertyInitialization": false, | |
class Person { | |
name: string | |
} | |
const person = new Person(); | |
// erro no runtime: cannot read properties of undefined, reading "length" | |
person.name.length |
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 connection = require('./connection'); | |
const insert = async (travel) => { | |
const { passengerId, startingAddress, endingAddress } = travel; | |
const [{ insertId }] = await connection.execute( | |
'INSERT INTO travels' | |
+ '(passenger_id, starting_address, ending_address)' | |
+ 'VALUE (?, ?, ?)', | |
[passengerId, startingAddress, endingAddress], |
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
# PetTrybe - Testes (pré TFC ⚽) | |
- Assuntos importantes | |
- Mockar JWT ✅ | |
- Associações (propriedades a mais) ✅ | |
- Tipagem de stubs ✅ | |
- Cobertura de testes :x: | |
- Script | |
- Introdução | |
- Dar contexto que aplicaremos testes de integração |
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
// no mongo ou mongosh | |
// use aula_29_2; | |
// no vscode \/ | |
// use("aula_29_2"); | |
db.filmes.drop(); | |
db.filmes.insertMany( | |
[ |
- Academia
- Dados
- Problema:
- Uma academia quer fazer um sistema que gerencia as fichas de treino das pessoas que lá treinam
- Premissas
- Cada ficha:
- só pode estar vinculada a uma pessoa cliente.
- Cada ficha:
- tem uma pessoa responsável que é professora na academia.
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
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; | |
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; | |
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; | |
DROP database IF EXISTS `northwind-dev` ; | |
CREATE database IF NOT EXISTS `northwind-dev` DEFAULT CHARACTER SET latin1 ; | |
USE `northwind-dev` ; | |
-- ----------------------------------------------------- | |
-- Table `northwind-dev`.`customers` |