@sportsbroker/firebase-structure 3.45.0-0 → 3.45.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.
@@ -6,10 +6,10 @@ export interface Score {
6
6
  export interface MatchScore {
7
7
  home: number | null; // total without penalties
8
8
  away: number | null; // total without penalties
9
- periods: SoccerPeriods | NFLPeriods;
9
+ periods: MatchPeriods;
10
10
  }
11
11
 
12
- export interface SoccerPeriods {
12
+ export interface MatchPeriods {
13
13
  firstHalf?: Score;
14
14
  secondHalf?: Score;
15
15
  firstOvertime?: Score;
@@ -17,10 +17,6 @@ export interface SoccerPeriods {
17
17
  shootoutPenalties?: Score;
18
18
  }
19
19
 
20
- export interface NFLPeriods {
21
- [sequenceName: string]: Score
22
- }
23
-
24
20
  export interface Scores {
25
21
  [sportID: string]: {
26
22
  [matchID: string]: MatchScore;
@@ -6,9 +6,7 @@ export interface TeamsStats {
6
6
  /**
7
7
  * @see: https://sportsbroker.slite.com/app/channels/VOZ0prjzHu/notes/tOQ3uR_FUT
8
8
  */
9
- export type MatchStats = ISoccerStats | INFLStats;
10
-
11
- export interface ISoccerStats {
9
+ export interface MatchStats {
12
10
  // possession
13
11
  possessionPercentageLast15: TeamsStats,
14
12
  possessionPercentageLast30: TeamsStats,
@@ -79,42 +77,6 @@ export interface ISoccerStats {
79
77
  penaltyTaken: TeamsStats,
80
78
  }
81
79
 
82
- export interface INFLStats {
83
- firstDowns : TeamsStats,
84
- firstDownsPassing: TeamsStats,
85
- firstDownsRushing: TeamsStats,
86
- firstDownsFromPenalties: TeamsStats,
87
- thirdDownEfficiency: TeamsStats,
88
- fourthDownEfficiency: TeamsStats,
89
- totalPlays: TeamsStats,
90
- totalYards: TeamsStats,
91
- totalDrives: TeamsStats,
92
- yardsPerPlay: TeamsStats,
93
- passing: TeamsStats,
94
- passingCompletions: TeamsStats,
95
- passingAttempts: TeamsStats,
96
- yardsPerPass: TeamsStats,
97
- interceptionsThrown: TeamsStats,
98
- rushing: TeamsStats,
99
- rushingAttempts: TeamsStats,
100
- yardsPerRush: TeamsStats,
101
- redZone: TeamsStats,
102
- turnovers: TeamsStats,
103
- fumblesLost: TeamsStats,
104
- possession: TeamsStats,
105
- thirdDownEfficiencySuccess: TeamsStats
106
- thirdDownEfficiencyAttempts: TeamsStats
107
- fourthDownEfficiencySuccess: TeamsStats
108
- fourthDownEfficiencyAttempts: TeamsStats
109
- redZoneAttempts: TeamsStats
110
- redZoneSuccess: TeamsStats
111
- penaltiesYards: TeamsStats
112
- specialTeamsTDs: TeamsStats
113
- sackYardLostSacks: TeamsStats
114
- sackYardLostSackYards: TeamsStats
115
- penaltiesTotal: TeamsStats
116
- }
117
-
118
80
  export interface Stats {
119
81
  [sportID: string]: {
120
82
  [matchID: string]: MatchStats
@@ -1,4 +1,4 @@
1
- export interface SoccerTeamRanking {
1
+ export interface TeamRanking {
2
2
  position: number;
3
3
  positionChange: number;
4
4
  points: number;
@@ -11,46 +11,20 @@ export interface SoccerTeamRanking {
11
11
  goalsAgainst: number;
12
12
  }
13
13
 
14
- export interface NflTeamRanking {
15
- won: number;
16
- lost: number;
17
- draw: number;
18
- played: number;
19
- winningPercentage: number;
20
- position: number;
21
- lastPosition?: number;
22
- }
23
-
24
- export type TeamRanking = SoccerTeamRanking | NflTeamRanking;
25
-
26
14
  export interface Ranking {
27
15
  groups: {
28
- soccer: {
16
+ [sportID: string]: {
29
17
  [seasonID: string]: {
30
18
  [groupID: string]: {
31
- [teamID: string]: SoccerTeamRanking;
19
+ [teamID: string]: TeamRanking;
32
20
  };
33
21
  };
34
22
  };
35
- nfl: {
36
- [seasonID: string]: {
37
- [groupID: string]: {
38
- [teamID: string]: NflTeamRanking;
39
- };
40
- };
41
- }
42
23
  };
43
24
  leagues: {
44
- soccer: {
45
- [seasonID: string]: {
46
- [teamID: string]: SoccerTeamRanking;
47
- };
48
- };
49
- nfl: {
25
+ [sportID: string]: {
50
26
  [seasonID: string]: {
51
- [groupId: string]: {
52
- [teamID: string]: NflTeamRanking;
53
- }
27
+ [teamID: string]: TeamRanking;
54
28
  };
55
29
  };
56
30
  };
@@ -8,7 +8,6 @@ import { Transactions } from './transactions';
8
8
  import { Messages } from './messages';
9
9
  import { PromoOffers } from './promoOffers';
10
10
  import { UserVerificationStatuses } from './verificationStatus';
11
- import { Leaderboard } from './leaderboard';
12
11
 
13
12
  export interface Users {
14
13
  orders: Orders;
@@ -20,6 +19,5 @@ export interface Users {
20
19
  transactions: Transactions;
21
20
  messages: Messages;
22
21
  promoOffers?: PromoOffers;
23
- verificationStatus: UserVerificationStatuses;
24
- leaderboard: Leaderboard;
22
+ verificationStatus: UserVerificationStatuses
25
23
  }
@@ -2,74 +2,75 @@ import { ISODate } from "../../global";
2
2
 
3
3
  export type NotificationID = string;
4
4
 
5
- export type OrderType =
6
- | 'MARKET'
7
- | 'LIMIT';
5
+ export type OrderType = "MARKET" | "LIMIT";
8
6
 
9
7
  export type NotificationType =
10
- | 'CUSTOM'
11
- | 'TEAM_BANKRUPT'
12
- | 'SHARE_SPLIT'
13
- | 'SHARE_BUY_SUCCESSFUL'
14
- | 'SHARE_SELL_SUCCESSFUL'
15
- | 'SHARE_BUY_UNSUCCESSFUL'
16
- | 'SHARE_SELL_UNSUCCESSFUL'
17
- | 'FOOTBALL_PASSPORT_STAMP_ACQUIRED'
18
- | 'APP_RATING'
19
- | 'APPSFLYER_BUY_ORDER_SUCCESSFUL'
20
- | 'APPSFLYER_DEPOSIT_SUCCESSFUL'
21
- | 'APPSFLYER_WITHDRAWAL_SUCCESSFUL'
22
- | 'APPSFLYER_USER_REGISTRATION_SUCCESSFUL'
23
- ;
8
+ | "CUSTOM"
9
+ | "TEAM_BANKRUPT"
10
+ | "SHARE_SPLIT"
11
+ | "SHARE_BUY_SUCCESSFUL"
12
+ | "SHARE_SELL_SUCCESSFUL"
13
+ | "SHARE_BUY_UNSUCCESSFUL"
14
+ | "SHARE_SELL_UNSUCCESSFUL"
15
+ | "FOOTBALL_PASSPORT_STAMP_ACQUIRED"
16
+ | "APP_RATING"
17
+ | "APPSFLYER_BUY_ORDER_SUCCESSFUL"
18
+ | "APPSFLYER_DEPOSIT_SUCCESSFUL"
19
+ | "APPSFLYER_WITHDRAWAL_SUCCESSFUL"
20
+ | "APPSFLYER_USER_REGISTRATION_SUCCESSFUL"
21
+ | "REFERRAL_BONUS_GRANTED";
24
22
 
25
23
  export type VariablesMap = {
26
- ['CUSTOM']: {
24
+ ["REFERRAL_BONUS_GRANTED"]: {
25
+ bonusAmount: number;
26
+ };
27
+ ["CUSTOM"]: {
27
28
  title: string;
28
29
  content: string;
29
30
  icon?: string;
30
31
  };
31
- ['TEAM_BANKRUPT']: {
32
+ ["TEAM_BANKRUPT"]: {
32
33
  teamId: string;
33
34
  teamName: string;
34
35
  };
35
- ['SHARE_SPLIT']: {};
36
- ['SHARE_BUY_SUCCESSFUL']: {
36
+ ["SHARE_SPLIT"]: {};
37
+ ["SHARE_BUY_SUCCESSFUL"]: {
37
38
  orderId: number;
38
- orderType: OrderType,
39
+ orderType: OrderType;
39
40
  shareAmount: number;
40
41
  teamId: string;
41
42
  teamName: string;
42
43
  };
43
- ['SHARE_SELL_SUCCESSFUL']: {
44
+ ["SHARE_SELL_SUCCESSFUL"]: {
44
45
  orderId: number;
45
- orderType: OrderType,
46
+ orderType: OrderType;
46
47
  shareAmount: number;
47
48
  teamId: string;
48
49
  teamName: string;
49
50
  };
50
- ['SHARE_BUY_UNSUCCESSFUL']: {
51
+ ["SHARE_BUY_UNSUCCESSFUL"]: {
51
52
  orderId: number;
52
- orderType: OrderType,
53
+ orderType: OrderType;
53
54
  shareAmount: number;
54
55
  teamId: string;
55
56
  teamName: string;
56
57
  };
57
- ['SHARE_SELL_UNSUCCESSFUL']: {
58
+ ["SHARE_SELL_UNSUCCESSFUL"]: {
58
59
  orderId: number;
59
- orderType: OrderType,
60
+ orderType: OrderType;
60
61
  shareAmount: number;
61
62
  teamId: string;
62
63
  teamName: string;
63
64
  };
64
- ['FOOTBALL_PASSPORT_STAMP_ACQUIRED']: {
65
+ ["FOOTBALL_PASSPORT_STAMP_ACQUIRED"]: {
65
66
  tournamentId: string;
66
67
  tournamentName: string;
67
68
  refundAmount: number;
68
69
  promoEndDate: string;
69
70
  stampUrl: string;
70
71
  };
71
- ['APP_RATING']: {};
72
- ['APPSFLYER_BUY_ORDER_SUCCESSFUL']: {
72
+ ["APP_RATING"]: {};
73
+ ["APPSFLYER_BUY_ORDER_SUCCESSFUL"]: {
73
74
  orderId: string;
74
75
  teamId: string;
75
76
  teamName: string;
@@ -78,22 +79,22 @@ export type VariablesMap = {
78
79
  currency: string;
79
80
  platform: string;
80
81
  };
81
- ['APPSFLYER_DEPOSIT_SUCCESSFUL']: {
82
+ ["APPSFLYER_DEPOSIT_SUCCESSFUL"]: {
82
83
  revenue: number;
83
84
  currency: string;
84
85
  transactionId: string;
85
86
  platform: string;
86
87
  };
87
- ['APPSFLYER_WITHDRAWAL_SUCCESSFUL']: {
88
+ ["APPSFLYER_WITHDRAWAL_SUCCESSFUL"]: {
88
89
  revenue: number;
89
90
  currency: string;
90
91
  transactionId: string;
91
92
  platform: string;
92
93
  };
93
- ['APPSFLYER_USER_REGISTRATION_SUCCESSFUL']: {
94
+ ["APPSFLYER_USER_REGISTRATION_SUCCESSFUL"]: {
94
95
  platform: string;
95
96
  };
96
- }
97
+ };
97
98
 
98
99
  export interface Notification<T extends NotificationType> {
99
100
  type: T;
@@ -109,7 +110,8 @@ export interface Notification<T extends NotificationType> {
109
110
  export interface Notifications {
110
111
  [userId: string]: {
111
112
  unreadCount: number;
112
- en: { // This is for backward compatibility
113
+ en: {
114
+ // This is for backward compatibility
113
115
  entries: {
114
116
  [notificationId: string]: Notification<NotificationType>;
115
117
  };
@@ -1,4 +1,4 @@
1
- import {ISODate, TeamID, Percentage} from "../../global";
1
+ import {ISODate, SportID, TeamID, Percentage} from "../../global";
2
2
 
3
3
  export type OrderActionType = "BUY" | "SELL";
4
4
 
@@ -32,6 +32,7 @@ export interface Order {
32
32
  processedMoney: number;
33
33
  processedFee: number;
34
34
  processedTotalMoney: number; // processedMoney + processedFee
35
+ sportId: SportID;
35
36
  teamId: TeamID;
36
37
  transactionFee: Percentage;
37
38
  type: OrderTransactionType;
@@ -1,6 +1,7 @@
1
1
  import {ISODate, MatchID, SportID, TeamSide} from "../../global";
2
2
 
3
3
  export interface UserOwnedShares {
4
+ sportId: SportID;
4
5
  amount: number;
5
6
  availableAmount: number;
6
7
  invested: number;
@@ -23,7 +23,7 @@ export type ISODate = string;
23
23
  /**
24
24
  * Currently support only soccer
25
25
  */
26
- export type SportID = "soccer" | "nfl" | string;
26
+ export type SportID = "soccer" | string;
27
27
 
28
28
  export type Language = "en" | "de" | string;
29
29
 
@@ -29,27 +29,17 @@ export interface GroupTable {
29
29
 
30
30
  export interface TableSummary {
31
31
  groups: {
32
- soccer: {
32
+ [sportID: string]: {
33
33
  [seasonID: string]: {
34
34
  [groupId: string]: GroupTable;
35
35
  }
36
- },
37
- nfl: {
38
- [seasonID: string]: {
39
- [groupId: string]: GroupTable;
40
- }
41
- },
36
+ }
42
37
  };
43
38
  leagues: {
44
- soccer: {
45
- [seasonID: string]: {
46
- [teamID: string]: TeamTable;
47
- };
48
- },
49
- nfl: {
39
+ [sportID: string]: {
50
40
  [seasonID: string]: {
51
41
  [teamID: string]: TeamTable;
52
42
  };
53
- },
43
+ };
54
44
  };
55
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.45.0-0",
3
+ "version": "3.45.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -1,7 +0,0 @@
1
- export interface LeaderboardValue {
2
- allTime: number;
3
- }
4
-
5
- export interface Leaderboard {
6
- [userID: string]: LeaderboardValue;
7
- }