@sportsbroker/firebase-structure 3.33.2-2 → 3.34.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;
@@ -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,44 +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
- [teamID: string]: NflTeamRanking;
27
+ [teamID: string]: TeamRanking;
52
28
  };
53
29
  };
54
30
  };
@@ -6,7 +6,8 @@ import { Notifications } from "./notifications";
6
6
  import { OwnedShares } from "./ownedShares";
7
7
  import { Transactions } from './transactions';
8
8
  import { Messages } from './messages';
9
- ​
9
+ import { PromoOffers } from './promoOffers';
10
+
10
11
  export interface Users {
11
12
  orders: Orders;
12
13
  status: Status;
@@ -16,4 +17,5 @@ export interface Users {
16
17
  ownedShares: OwnedShares;
17
18
  transactions: Transactions;
18
19
  messages: Messages;
20
+ promoOffers: PromoOffers;
19
21
  }
@@ -13,7 +13,8 @@ export type NotificationType =
13
13
  | 'SHARE_BUY_SUCCESSFUL'
14
14
  | 'SHARE_SELL_SUCCESSFUL'
15
15
  | 'SHARE_BUY_UNSUCCESSFUL'
16
- | 'SHARE_SELL_UNSUCCESSFUL';
16
+ | 'SHARE_SELL_UNSUCCESSFUL'
17
+ | 'FOOTBALL_PASSPORT_STAMP_ACQUIRED';
17
18
 
18
19
  export type VariablesMap = {
19
20
  ['CUSTOM']: {
@@ -56,6 +57,11 @@ export type VariablesMap = {
56
57
  teamId: string;
57
58
  teamName: string;
58
59
  };
60
+ ['FOOTBALL_PASSPORT_STAMP_ACQUIRED']: {
61
+ tournamentId: string;
62
+ refundAmount: number;
63
+ promoEndDate: string;
64
+ };
59
65
  }
60
66
 
61
67
  export interface Notification<T extends NotificationType> {
@@ -0,0 +1,35 @@
1
+ import { ISODate } from '../../global';
2
+
3
+ type PromoCode = 'FOOTBALL_PASSPORT';
4
+
5
+ export type PromoOffers = Record<PromoCode, UserPromoOffer<PromoCode>>;
6
+
7
+ export interface UserPromoOffer<P extends PromoCode> {
8
+ active: true;
9
+ details: UserPromoOfferDetails[P];
10
+ }
11
+
12
+ export interface UserPromoOfferDetails {
13
+ FOOTBALL_PASSPORT: FootballPassportDetails;
14
+ }
15
+
16
+ export interface FootballPassportDetails {
17
+ tournaments: {
18
+ [tournamentId: string]: FootballPassportTournamentDetails;
19
+ }
20
+ }
21
+
22
+ export interface FootballPassportTournamentDetails {
23
+ tournamentId: string;
24
+ from: ISODate;
25
+ to: ISODate;
26
+ invested: number;
27
+ investmentThreshold: number;
28
+ stamp: FootballPassportTournamentStamp;
29
+ }
30
+
31
+ export interface FootballPassportTournamentStamp {
32
+ acquired: boolean;
33
+ acquiredAt: ISODate | null;
34
+ url: string;
35
+ }
@@ -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.33.2-2",
3
+ "version": "3.34.0",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {