@winible/winible-typed 2.74.0 → 2.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winible/winible-typed",
3
- "version": "2.74.0",
3
+ "version": "2.75.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -72,7 +72,7 @@ export { default as Market } from "./market";
72
72
  export { default as Sportsbook } from "./sportsbook";
73
73
  export { default as ComplianceRule } from "./compliance-rule";
74
74
  export { default as League } from "./league";
75
- export { default as MarketOnBetSport } from "./market-on-bet-sport";
75
+ export { default as MarketOnLeague } from "./market-on-league";
76
76
  export { default as AffiliateLink } from "./affiliate-link";
77
77
  export { default as Odd } from "./odd";
78
78
  export { default as Parlay } from "./parlay";
@@ -2,38 +2,36 @@ import {
2
2
  Model,
3
3
  InferAttributes,
4
4
  InferCreationAttributes,
5
- CreationOptional,
6
5
  DataTypes,
7
- fn,
8
6
  } from "sequelize";
9
7
 
10
8
  import sequelize from "./pb-sequelize";
11
9
  import { StatusType } from "../src/types";
12
- import BetSport from "./bet-sport";
10
+ import League from "./league";
13
11
  import Market from "./market";
14
12
 
15
13
  // order of InferAttributes & InferCreationAttributes is important.
16
- class MarketOnBetSport extends Model<
17
- InferAttributes<MarketOnBetSport>,
18
- InferCreationAttributes<MarketOnBetSport>
14
+ class MarketOnLeague extends Model<
15
+ InferAttributes<MarketOnLeague>,
16
+ InferCreationAttributes<MarketOnLeague>
19
17
  > {
20
18
  // 'CreationOptional' is a special type that marks the field as optional
21
19
  // when creating an instance of the model (such as using Model.create()).
22
- declare betSportId: string;
20
+ declare leagueId: string;
23
21
  declare marketId: string;
24
22
  declare status: StatusType;
25
23
  }
26
24
 
27
- MarketOnBetSport.init(
25
+ MarketOnLeague.init(
28
26
  {
29
- betSportId: {
27
+ leagueId: {
30
28
  type: DataTypes.BIGINT,
31
29
  allowNull: false,
32
30
  references: {
33
- model: BetSport,
31
+ model: League,
34
32
  key: "id",
35
33
  },
36
- field: "bet_sport_id",
34
+ field: "league_id",
37
35
  },
38
36
  marketId: {
39
37
  type: DataTypes.BIGINT,
@@ -50,27 +48,27 @@ MarketOnBetSport.init(
50
48
  },
51
49
  },
52
50
  {
53
- tableName: "markets_on_bet_sports",
54
- comment: "Junction table that relates a bet_sport to a market",
51
+ tableName: "markets_on_leagues",
52
+ comment: "Junction table that relates a league to a market",
55
53
  timestamps: false,
56
54
  sequelize,
57
55
  }
58
56
  );
59
57
 
60
- BetSport.belongsToMany(Market, {
61
- through: MarketOnBetSport,
62
- foreignKey: "betSportId",
58
+ League.belongsToMany(Market, {
59
+ through: MarketOnLeague,
60
+ foreignKey: "leagueId",
63
61
  sourceKey: "id",
64
62
  onDelete: "NO ACTION",
65
63
  constraints: false,
66
64
  });
67
65
 
68
- Market.belongsToMany(BetSport, {
69
- through: MarketOnBetSport,
66
+ Market.belongsToMany(League, {
67
+ through: MarketOnLeague,
70
68
  foreignKey: "marketId",
71
69
  sourceKey: "id",
72
70
  onDelete: "NO ACTION",
73
71
  constraints: false,
74
72
  });
75
73
 
76
- export default MarketOnBetSport;
74
+ export default MarketOnLeague;