@sportsbroker/firebase-structure 2.1.0 → 2.4.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/models/details/ranking/_index.d.ts +3 -0
- package/models/details/teams/overviews.d.ts +3 -0
- package/models/details/users/_index.d.ts +2 -0
- package/models/details/users/overviews.d.ts +2 -3
- package/models/details/users/ranking.d.ts +11 -0
- package/models/details/users/transactions.d.ts +47 -0
- package/package.json +1 -1
- package/sportsbroker-firebase-structure-2.4.0.tgz +0 -0
|
@@ -4,6 +4,7 @@ import { Wallet } from "./wallet";
|
|
|
4
4
|
import { Watchlist } from "./watchlist";
|
|
5
5
|
import { Notifications } from "./notifications";
|
|
6
6
|
import { OwnedShares } from "./ownedShares";
|
|
7
|
+
import { Transactions } from './transactions';
|
|
7
8
|
|
|
8
9
|
export interface Users {
|
|
9
10
|
orders: Orders;
|
|
@@ -12,4 +13,5 @@ export interface Users {
|
|
|
12
13
|
watchlist: Watchlist;
|
|
13
14
|
notifications: Notifications;
|
|
14
15
|
ownedShares: OwnedShares;
|
|
16
|
+
transactions: Transactions;
|
|
15
17
|
}
|
|
@@ -13,7 +13,6 @@ export interface Overviews {
|
|
|
13
13
|
[userID: string]: {
|
|
14
14
|
username: string;
|
|
15
15
|
email: string;
|
|
16
|
-
rank: number;
|
|
17
16
|
id: UserID;
|
|
18
17
|
status: {
|
|
19
18
|
emailVerified: boolean;
|
|
@@ -27,13 +26,13 @@ export interface Overviews {
|
|
|
27
26
|
lastName?: string;
|
|
28
27
|
birthdate?: string;
|
|
29
28
|
};
|
|
30
|
-
address
|
|
29
|
+
address: {
|
|
31
30
|
addressLine1?: string;
|
|
32
31
|
addressLine2?: string;
|
|
33
32
|
county?: string;
|
|
34
33
|
city?: string;
|
|
35
34
|
postalCode?: string;
|
|
36
|
-
|
|
35
|
+
countryCode: string;
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
38
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Date, SportID, UserID } from "../../global";
|
|
2
|
+
|
|
3
|
+
type TransactionID = string;
|
|
4
|
+
|
|
5
|
+
export enum TransactionType {
|
|
6
|
+
WITHDRAW = "WITHDRAW",
|
|
7
|
+
DEPOSIT = "DEPOSIT",
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// currently only one supported, but will be more
|
|
11
|
+
export enum TransactionPaymentMethod {
|
|
12
|
+
SKRILL = "SKRILL"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* unified statuses for all transactions
|
|
17
|
+
* (internally backend uses different statuses, per each provider)
|
|
18
|
+
*/
|
|
19
|
+
export enum TransactionStatus {
|
|
20
|
+
PREPARED = "PREPARED",
|
|
21
|
+
PENDING = "PENDING",
|
|
22
|
+
SUCCEED = "SUCCEED",
|
|
23
|
+
FAILED = "FAILED",
|
|
24
|
+
CANCELLED = "CANCELLED",
|
|
25
|
+
IN_REVIEW = "IN_REVIEW",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* userID: UserID
|
|
30
|
+
* transactionID: TransactionID
|
|
31
|
+
*/
|
|
32
|
+
export interface Transactions {
|
|
33
|
+
[userID: string]: {
|
|
34
|
+
[transactionID: string]: {
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
executedAt?: Date;
|
|
38
|
+
id: TransactionID,
|
|
39
|
+
status: TransactionStatus;
|
|
40
|
+
type: TransactionType;
|
|
41
|
+
paymentMethod: TransactionPaymentMethod;
|
|
42
|
+
amount: number;
|
|
43
|
+
fee?: number;
|
|
44
|
+
balance?: number; // an initialize transaction balance would be null, and after finished will be filled
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
package/package.json
CHANGED
|
Binary file
|