Write patch to pull in weekly player data to database; start player/team stat models
This commit is contained in:
18
app/models/Matchup.model.js
Normal file
18
app/models/Matchup.model.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const { Model } = require('flitter-orm')
|
||||
|
||||
class Matchup extends Model {
|
||||
static get services() {
|
||||
return [...super.services, 'models']
|
||||
}
|
||||
|
||||
static get schema() {
|
||||
return {
|
||||
home_team_id: String,
|
||||
visitor_team_id: String,
|
||||
week_num: Number,
|
||||
complete: { type: Boolean, default: false },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports = Matchup
|
||||
18
app/models/WeeklyPlayerStat.model.js
Normal file
18
app/models/WeeklyPlayerStat.model.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const { Model } = require('flitter-orm')
|
||||
|
||||
class WeeklyPlayerStat extends Model {
|
||||
static get services() {
|
||||
return [...super.services, 'models']
|
||||
}
|
||||
|
||||
static get schema() {
|
||||
return {
|
||||
player_id: String,
|
||||
week_num: Number,
|
||||
patch_player_id: String,
|
||||
fantasy_points: Number,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports = WeeklyPlayerStat
|
||||
19
app/models/WeeklyTeamStat.model.js
Normal file
19
app/models/WeeklyTeamStat.model.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { Model } = require('flitter-orm')
|
||||
|
||||
class WeeklyTeamStat extends Model {
|
||||
static get services() {
|
||||
return [...super.services, 'models']
|
||||
}
|
||||
|
||||
static get schema() {
|
||||
return {
|
||||
team_id: String,
|
||||
lineup_id: String,
|
||||
week_num: Number,
|
||||
player_ids: [String],
|
||||
fantasy_points: Number,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports = WeeklyTeamStat
|
||||
Reference in New Issue
Block a user