@sportsbroker/firebase-structure 3.2.0 → 3.3.1

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.
@@ -1,3 +1,7 @@
1
+ import {Percentage} from "../global";
2
+
1
3
  export interface Config {
2
- statusCheckRequired: Boolean;
4
+ statusCheckRequired: boolean;
5
+ buyPriceFee: Percentage;
6
+ instantSellPriceFactor: Percentage;
3
7
  }
@@ -1,16 +1,19 @@
1
- export interface MatchTeamShares {
1
+ export interface MatchTeamSharePriceImpact {
2
2
  price: number;
3
- openingPrice: number;
4
- priceChangePercentage: number;
3
+ preMatchPrice?: number;
4
+ afterMatchPrice?: number;
5
+ adjustedPrice?: number;
6
+ priceChangePercentage?: number;
7
+ priceChange?: number;
5
8
  }
6
9
 
7
- export interface MatchShares {
8
- home: MatchTeamShares;
9
- away: MatchTeamShares;
10
+ export interface MatchSharePriceImpact {
11
+ home: MatchTeamSharePriceImpact;
12
+ away: MatchTeamSharePriceImpact;
10
13
  }
11
14
 
12
15
  export interface Shares {
13
16
  [sportID: string]: {
14
- [matchID: string]: MatchShares;
17
+ [matchID: string]: MatchSharePriceImpact;
15
18
  };
16
19
  }
@@ -1,5 +1,7 @@
1
1
  import { TeamID } from "../../global";
2
2
 
3
+ export type TradingInactiveReason = "SPLIT_IN_PROGRESS" | "NONE";
4
+
3
5
  export interface MarketIndicators {
4
6
  dailyHigh: number;
5
7
  dailyLow: number;
@@ -11,6 +13,11 @@ export interface MarketIndicators {
11
13
  capacity: number;
12
14
  }
13
15
 
16
+ export interface TradingStatus {
17
+ isTradingActive: boolean;
18
+ inactivityReason: TradingInactiveReason;
19
+ }
20
+
14
21
  export interface TeamShare {
15
22
  seasonPriceChangePercentage: number;
16
23
  price: number;
@@ -20,6 +27,7 @@ export interface TeamShare {
20
27
  sellPrice: number;
21
28
  id: TeamID;
22
29
  market?: MarketIndicators;
30
+ tradingStatus: TradingStatus;
23
31
  }
24
32
 
25
33
  export interface Shares {
@@ -1,4 +1,4 @@
1
- import {ISODate, SportID, TeamID} from "../../global";
1
+ import {ISODate, SportID, TeamID, Percentage} from "../../global";
2
2
 
3
3
  export type OrderActionType = "BUY" | "SELL";
4
4
 
@@ -21,7 +21,7 @@ export interface Order {
21
21
  processedTotalMoney: number; // processedMoney + processedFee
22
22
  sportId: SportID;
23
23
  teamId: TeamID;
24
- transactionFee: number;
24
+ transactionFee: Percentage;
25
25
  type: OrderTransactionType;
26
26
  updatedAt: ISODate;
27
27
  status: OrderStatus;
@@ -1,4 +1,5 @@
1
1
  import { SportID } from "../../global";
2
+ import { OwnedSharesSplit } from "./ownedSharesSplit";
2
3
 
3
4
  export interface UserOwnedShares {
4
5
  sportId: SportID;
@@ -7,6 +8,7 @@ export interface UserOwnedShares {
7
8
  profit: number;
8
9
  invested: number;
9
10
  averagePricePerShare: number;
11
+ splits?: OwnedSharesSplits;
10
12
  }
11
13
 
12
14
  /**
@@ -18,3 +20,7 @@ export interface OwnedShares {
18
20
  [teamID: string]: UserOwnedShares;
19
21
  };
20
22
  }
23
+
24
+ export interface OwnedSharesSplits {
25
+ [matchId: string]: OwnedSharesSplit
26
+ }
@@ -0,0 +1,9 @@
1
+ import { MatchID, ISODate } from "../../global";
2
+
3
+ export interface OwnedSharesSplit {
4
+ matchId: MatchID;
5
+ date: ISODate;
6
+ sharesAmountAfterSplit: number;
7
+ sharesAmountDiff: number;
8
+ profit: number;
9
+ }
@@ -1,5 +1,3 @@
1
- import { UserID } from "../../global";
2
-
3
1
  export interface UserRanking {
4
2
  change: number;
5
3
  equity: number;
@@ -9,5 +7,5 @@ export interface UserRanking {
9
7
 
10
8
  //Restricted access only to own data
11
9
  export interface Ranking {
12
- [userId: UserID]: UserRanking;
10
+ [userId: string]: UserRanking;
13
11
  }
@@ -25,6 +25,8 @@ export type SeasonID = string;
25
25
 
26
26
  export type GroupID = string;
27
27
 
28
+ export type Percentage = number // 0.0-1.0
29
+
28
30
  export interface Image {
29
31
  default: string;
30
32
  }
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.2.0",
3
+ "version": "3.3.1",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/SportsBroker-HQ/firebase-structure"
9
9
  },
10
- "author": "Lukasz Ostrowski <lukasz.ostrowski@sportsbroker.com>",
11
- "contributors": ["Mikolaj :)"],
10
+ "author": "SportsBroker",
12
11
  "license": "ISC",
13
12
  "bugs": {
14
13
  "url": "https://github.com/BonFireITLTD/firebase-structure/issues"