Skip to content

Commit

Permalink
Criação de tabela e modelo de Income Type (admissoesevida#19) (admiss…
Browse files Browse the repository at this point in the history
…oesevida#38)

* Criação de tabela e modelo de Income Type (admissoesevida#19)

* Quick fix Codecov

* Update Package-lock.json
  • Loading branch information
paulojunior95 authored Mar 31, 2019
1 parent 7d2a207 commit b71ee79
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 1,194 deletions.
41 changes: 30 additions & 11 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions api/src/models/incomeType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = (sequelize, DataTypes) => {
const IncomeType = sequelize.define(
'incomeType',
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
name: {
type: DataTypes.STRING(500),
allowNull: false
},
note: DataTypes.STRING(5000)
},
{
freezeTableName: true
}
);

IncomeType.associate = models => {
IncomeType.hasMany(models.incoming);
};

// Caso faça alguma alteração na estrutura da tabela,
// descomente uma das linhas de sincronização no index.js desta pasta

return IncomeType;
};
4 changes: 4 additions & 0 deletions api/src/models/incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ module.exports = (sequelize, DataTypes) => {
Incoming.belongsTo(models.member);
};

Incoming.associate = models => {
Incoming.belongsTo(models.incomeType);
};

// Caso faça alguma alteração na estrutura da tabela,
// descomente uma das linhas de sincronização no index.js desta pasta

Expand Down
41 changes: 30 additions & 11 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ coverage:
status:
project:
default: false
tests:
target: 100%
paths: "tests/"
app:
paths: "!tests/"
Loading

0 comments on commit b71ee79

Please sign in to comment.