@sportsbroker/firebase-structure 3.3.0 → 3.3.2

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,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,5 +1,4 @@
1
- import { SportID } from "../../global";
2
- import { OwnedSharesSplit } from "./ownedSharesSplit";
1
+ import {ISODate, MatchID, SportID, TeamType} from "../../global";
3
2
 
4
3
  export interface UserOwnedShares {
5
4
  sportId: SportID;
@@ -8,15 +7,28 @@ export interface UserOwnedShares {
8
7
  profit: number;
9
8
  invested: number;
10
9
  averagePricePerShare: number;
11
- splits?: OwnedSharesSplit[];
10
+ splits?: OwnedSharesSplits;
12
11
  }
13
12
 
14
13
  /**
15
14
  * teamID: TeamID
16
- * userID: userID
15
+ * userID: UserID
17
16
  */
18
17
  export interface OwnedShares {
19
18
  [userID: string]: {
20
19
  [teamID: string]: UserOwnedShares;
21
20
  };
22
21
  }
22
+
23
+ export interface OwnedSharesSplits {
24
+ [matchId: string]: OwnedSharesSplit;
25
+ }
26
+
27
+ export interface OwnedSharesSplit {
28
+ matchId: MatchID;
29
+ teamType: TeamType;
30
+ date: ISODate;
31
+ sharesAmountAfterSplit: number;
32
+ sharesAmountDiff: number;
33
+ profit: number;
34
+ }
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
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"
@@ -1,10 +0,0 @@
1
- import { MatchID, ISODate } from "../../global";
2
-
3
- export interface OwnedSharesSplit {
4
- id: string;
5
- matchId: MatchID;
6
- date: ISODate;
7
- sharesAmountAfterSplit: number;
8
- sharesAmountDiff: number;
9
- profit: number;
10
- }