summaryrefslogtreecommitdiff
path: root/model.js
blob: 7f465597ae7583e4f78ed9797c74ba43ed87aa22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* jshint esnext:true */
"use strict";

module.exports = (seq, Seq) => {
    let // core data
        Match = seq.import("./models/match.js"),
        Asset = seq.import("./models/asset.js"),
        Roster = seq.import("./models/roster.js"),
        Participant = seq.import("./models/participant.js"),
        Player = seq.import("./models/player.js"),

        // mappings
        Item = seq.import("./models/item.js"),

        // Telemetry
        ItemParticipant = seq.import("./models/item_participant.js"),

        // data stats
        ParticipantExt = seq.import("./models/participant_ext.js"),
        PlayerExt = seq.import("./models/player_ext.js"),

        // stats mappings
        StatsDimensions = seq.import("./models/stats_dimensions.js"),
        Heros = seq.import("./models/heros.js"),

        // hero stats
        HeroStats = seq.import("./models/hero_stats.js"),
        HeroDimension = seq.import("./models/hero_dimension.js");


    Roster.belongsTo(Match, { foreignKey: "match_api_id", targetKey: "api_id" });
    Participant.belongsTo(Roster, { foreignKey: "roster_api_id", targetKey: "api_id" });
    Participant.belongsTo(Heros, { foreignKey: "actor", targetKey: "api_name" });

    return {
        Match, Roster, Participant, Player, Asset,
        Item,
        ItemParticipant,
        ParticipantExt, PlayerExt,
        StatsDimensions, Heros,
        HeroStats, HeroDimension
    };
};