Write patch to pull in weekly player data to database; start player/team stat models

This commit is contained in:
2020-11-07 12:10:19 -06:00
parent 9d3d614c20
commit 5cc3d31415
8 changed files with 166 additions and 6 deletions

View 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

View 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

View 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