@devline-smart-taxi/common 2.3.51 → 2.3.53
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/dist/enums/payment.enum.d.ts +17 -0
- package/dist/enums/payment.enum.js +21 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1 -5
- package/dist/proto/chat-message-proto-path.d.ts +1 -0
- package/dist/proto/chat-message-proto-path.js +4 -0
- package/dist/proto/chat-message-proto-path.ts +3 -0
- package/dist/proto/chat-message.proto +72 -0
- package/dist/proto/wallet.proto +183 -3
- package/package.json +1 -1
- package/dist/dto/add-earning.dto.d.ts +0 -8
- package/dist/dto/add-earning.dto.js +0 -41
- package/dist/dto/create-transaction.dto.d.ts +0 -8
- package/dist/dto/create-transaction.dto.js +0 -41
- package/dist/dto/get-transactions.dto.d.ts +0 -4
- package/dist/dto/get-transactions.dto.js +0 -22
- package/dist/dto/withdraw-balance.dto.d.ts +0 -4
- package/dist/dto/withdraw-balance.dto.js +0 -26
- package/dist/proto/balance-proto-path.d.ts +0 -1
- package/dist/proto/balance-proto-path.js +0 -4
- package/dist/proto/balance-proto-path.ts +0 -2
- package/dist/proto/balance.proto +0 -114
|
@@ -8,3 +8,20 @@ export declare enum PaymentStatus {
|
|
|
8
8
|
FAILED = "failed",// to`lov amalga oshirilmagan yoki muvaffaqiyatsiz holat
|
|
9
9
|
CANCELLED = "cancelled"
|
|
10
10
|
}
|
|
11
|
+
export declare enum WalletOwnerType {
|
|
12
|
+
CLIENT = "CLIENT",
|
|
13
|
+
DRIVER = "DRIVER"
|
|
14
|
+
}
|
|
15
|
+
export declare enum WalletTransactionType {
|
|
16
|
+
PROMO_CODE = "PROMO_CODE",
|
|
17
|
+
REFERRAL_BONUS = "REFERRAL_BONUS",
|
|
18
|
+
TRIP_PAYMENT = "TRIP_PAYMENT",
|
|
19
|
+
TRIP_COUNT_BONUS = "TRIP_COUNT_BONUS",
|
|
20
|
+
TRIP_EARNING = "TRIP_EARNING",
|
|
21
|
+
WITHDRAWAL = "WITHDRAWAL"
|
|
22
|
+
}
|
|
23
|
+
export declare enum WithdrawalStatus {
|
|
24
|
+
PENDING = "PENDING",
|
|
25
|
+
APPROVED = "APPROVED",
|
|
26
|
+
REJECTED = "REJECTED"
|
|
27
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentStatus = exports.PaymentMethod = void 0;
|
|
3
|
+
exports.WithdrawalStatus = exports.WalletTransactionType = exports.WalletOwnerType = exports.PaymentStatus = exports.PaymentMethod = void 0;
|
|
4
4
|
var PaymentMethod;
|
|
5
5
|
(function (PaymentMethod) {
|
|
6
6
|
PaymentMethod["CASH"] = "cash";
|
|
@@ -13,3 +13,23 @@ var PaymentStatus;
|
|
|
13
13
|
PaymentStatus["FAILED"] = "failed";
|
|
14
14
|
PaymentStatus["CANCELLED"] = "cancelled";
|
|
15
15
|
})(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
|
|
16
|
+
var WalletOwnerType;
|
|
17
|
+
(function (WalletOwnerType) {
|
|
18
|
+
WalletOwnerType["CLIENT"] = "CLIENT";
|
|
19
|
+
WalletOwnerType["DRIVER"] = "DRIVER";
|
|
20
|
+
})(WalletOwnerType || (exports.WalletOwnerType = WalletOwnerType = {}));
|
|
21
|
+
var WalletTransactionType;
|
|
22
|
+
(function (WalletTransactionType) {
|
|
23
|
+
WalletTransactionType["PROMO_CODE"] = "PROMO_CODE";
|
|
24
|
+
WalletTransactionType["REFERRAL_BONUS"] = "REFERRAL_BONUS";
|
|
25
|
+
WalletTransactionType["TRIP_PAYMENT"] = "TRIP_PAYMENT";
|
|
26
|
+
WalletTransactionType["TRIP_COUNT_BONUS"] = "TRIP_COUNT_BONUS";
|
|
27
|
+
WalletTransactionType["TRIP_EARNING"] = "TRIP_EARNING";
|
|
28
|
+
WalletTransactionType["WITHDRAWAL"] = "WITHDRAWAL";
|
|
29
|
+
})(WalletTransactionType || (exports.WalletTransactionType = WalletTransactionType = {}));
|
|
30
|
+
var WithdrawalStatus;
|
|
31
|
+
(function (WithdrawalStatus) {
|
|
32
|
+
WithdrawalStatus["PENDING"] = "PENDING";
|
|
33
|
+
WithdrawalStatus["APPROVED"] = "APPROVED";
|
|
34
|
+
WithdrawalStatus["REJECTED"] = "REJECTED";
|
|
35
|
+
})(WithdrawalStatus || (exports.WithdrawalStatus = WithdrawalStatus = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -25,11 +25,6 @@ export * from './dto/create-trip.dto';
|
|
|
25
25
|
export * from './dto/update-trip.dto';
|
|
26
26
|
export * from './dto/trip-action.dto';
|
|
27
27
|
export * from './dto/trip-response.dto';
|
|
28
|
-
export * from './dto/create-transaction.dto';
|
|
29
|
-
export * from './dto/add-earning.dto';
|
|
30
|
-
export * from './dto/withdraw-balance.dto';
|
|
31
|
-
export * from './dto/get-transactions.dto';
|
|
32
|
-
export * from './proto/balance-proto-path';
|
|
33
28
|
export * from './proto/rating-proto-path';
|
|
34
29
|
export * from './proto/car-class-proto-path';
|
|
35
30
|
export * from './proto/car-manufacturer-proto-path';
|
|
@@ -42,3 +37,4 @@ export * from './proto/wallet-proto-path';
|
|
|
42
37
|
export * from './proto/bonus-campaign-proto-path';
|
|
43
38
|
export * from './proto/support-contact-proto-path';
|
|
44
39
|
export * from './proto/legal-document-proto-path';
|
|
40
|
+
export * from './proto/chat-message-proto-path';
|
package/dist/index.js
CHANGED
|
@@ -42,11 +42,6 @@ __exportStar(require("./dto/create-trip.dto"), exports);
|
|
|
42
42
|
__exportStar(require("./dto/update-trip.dto"), exports);
|
|
43
43
|
__exportStar(require("./dto/trip-action.dto"), exports);
|
|
44
44
|
__exportStar(require("./dto/trip-response.dto"), exports);
|
|
45
|
-
__exportStar(require("./dto/create-transaction.dto"), exports);
|
|
46
|
-
__exportStar(require("./dto/add-earning.dto"), exports);
|
|
47
|
-
__exportStar(require("./dto/withdraw-balance.dto"), exports);
|
|
48
|
-
__exportStar(require("./dto/get-transactions.dto"), exports);
|
|
49
|
-
__exportStar(require("./proto/balance-proto-path"), exports);
|
|
50
45
|
__exportStar(require("./proto/rating-proto-path"), exports);
|
|
51
46
|
__exportStar(require("./proto/car-class-proto-path"), exports);
|
|
52
47
|
__exportStar(require("./proto/car-manufacturer-proto-path"), exports);
|
|
@@ -59,3 +54,4 @@ __exportStar(require("./proto/wallet-proto-path"), exports);
|
|
|
59
54
|
__exportStar(require("./proto/bonus-campaign-proto-path"), exports);
|
|
60
55
|
__exportStar(require("./proto/support-contact-proto-path"), exports);
|
|
61
56
|
__exportStar(require("./proto/legal-document-proto-path"), exports);
|
|
57
|
+
__exportStar(require("./proto/chat-message-proto-path"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const chatMessageProtoPath: string;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package chat_message;
|
|
4
|
+
|
|
5
|
+
import "common.proto";
|
|
6
|
+
|
|
7
|
+
// ==========================================
|
|
8
|
+
// 1. SERVICE
|
|
9
|
+
// ==========================================
|
|
10
|
+
|
|
11
|
+
service ChatMessageService {
|
|
12
|
+
rpc GetMyMessages (GetMyMessagesRequest) returns (MessageListResponse);
|
|
13
|
+
rpc GetByTripId (GetByTripIdRequest) returns (MessageListResponse);
|
|
14
|
+
rpc GetById (common.IdRequest) returns (SingleMessageResponse);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// ==========================================
|
|
18
|
+
// 2. DATA MESSAGES
|
|
19
|
+
// ==========================================
|
|
20
|
+
|
|
21
|
+
message MessageData {
|
|
22
|
+
string id = 1;
|
|
23
|
+
optional string correlationId = 2;
|
|
24
|
+
optional string tripId = 3;
|
|
25
|
+
string senderId = 4;
|
|
26
|
+
string senderType = 5;
|
|
27
|
+
string recipientId = 6;
|
|
28
|
+
string recipientType = 7;
|
|
29
|
+
string category = 8;
|
|
30
|
+
string type = 9;
|
|
31
|
+
string content = 10;
|
|
32
|
+
optional string metadata = 11;
|
|
33
|
+
string priority = 12;
|
|
34
|
+
string status = 13;
|
|
35
|
+
string createdAt = 14;
|
|
36
|
+
optional string updatedAt = 15;
|
|
37
|
+
optional string sentAt = 16;
|
|
38
|
+
optional string deliveredAt = 17;
|
|
39
|
+
optional string readAt = 18;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// ==========================================
|
|
43
|
+
// 3. REQUESTS
|
|
44
|
+
// ==========================================
|
|
45
|
+
|
|
46
|
+
message GetMyMessagesRequest {
|
|
47
|
+
string userId = 1;
|
|
48
|
+
int32 limit = 2;
|
|
49
|
+
int32 offset = 3;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message GetByTripIdRequest {
|
|
53
|
+
string tripId = 1;
|
|
54
|
+
int32 limit = 2;
|
|
55
|
+
int32 offset = 3;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ==========================================
|
|
59
|
+
// 4. RESPONSES
|
|
60
|
+
// ==========================================
|
|
61
|
+
|
|
62
|
+
message MessageListResponse {
|
|
63
|
+
int32 statusCode = 1;
|
|
64
|
+
string message = 2;
|
|
65
|
+
repeated MessageData data = 3;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message SingleMessageResponse {
|
|
69
|
+
int32 statusCode = 1;
|
|
70
|
+
string message = 2;
|
|
71
|
+
MessageData data = 3;
|
|
72
|
+
}
|
package/dist/proto/wallet.proto
CHANGED
|
@@ -5,21 +5,34 @@ package wallet;
|
|
|
5
5
|
import "common.proto";
|
|
6
6
|
|
|
7
7
|
// ==========================================
|
|
8
|
-
// 1.
|
|
8
|
+
// 1. SERVICE
|
|
9
9
|
// ==========================================
|
|
10
10
|
|
|
11
11
|
service WalletService {
|
|
12
|
+
// Client
|
|
12
13
|
rpc GetMyWallet (GetMyWalletRequest) returns (WalletResponse);
|
|
14
|
+
rpc ApplyPromoCode (ApplyPromoCodeRequest) returns (WalletResponse);
|
|
15
|
+
|
|
16
|
+
// Driver
|
|
17
|
+
rpc GetDriverBalance (GetDriverBalanceRequest) returns (DriverBalanceResponse);
|
|
18
|
+
rpc AddDriverEarning (AddDriverEarningRequest) returns (AddDriverEarningResponse);
|
|
19
|
+
rpc GetDriverTransactions (GetDriverTransactionsRequest) returns (DriverTransactionListResponse);
|
|
20
|
+
rpc RequestWithdrawal (RequestWithdrawalRequest) returns (WithdrawalResponse);
|
|
21
|
+
|
|
22
|
+
// Admin
|
|
23
|
+
rpc ProcessWithdrawal (ProcessWithdrawalRequest) returns (ProcessWithdrawalResponse);
|
|
24
|
+
rpc GetPendingWithdrawals (GetPendingWithdrawalsRequest) returns (PendingWithdrawalsResponse);
|
|
25
|
+
rpc GetAllDriverBalances (GetAllDriverBalancesRequest) returns (AllDriverBalancesResponse);
|
|
13
26
|
}
|
|
14
27
|
|
|
15
28
|
// ==========================================
|
|
16
|
-
// 2. COMMON MESSAGES
|
|
29
|
+
// 2. COMMON DATA MESSAGES
|
|
17
30
|
// ==========================================
|
|
18
31
|
|
|
19
32
|
message WalletTransactionData {
|
|
20
33
|
string id = 1;
|
|
21
34
|
float amount = 2;
|
|
22
|
-
string type = 3;
|
|
35
|
+
string type = 3;
|
|
23
36
|
string description = 4;
|
|
24
37
|
string createdAt = 5;
|
|
25
38
|
}
|
|
@@ -29,20 +42,187 @@ message WalletData {
|
|
|
29
42
|
repeated WalletTransactionData transactions = 2;
|
|
30
43
|
}
|
|
31
44
|
|
|
45
|
+
message DriverTransactionData {
|
|
46
|
+
string id = 1;
|
|
47
|
+
float amount = 2;
|
|
48
|
+
string type = 3;
|
|
49
|
+
string description = 4;
|
|
50
|
+
optional string paymentMethod = 5;
|
|
51
|
+
optional string status = 6;
|
|
52
|
+
optional string tripId = 7;
|
|
53
|
+
optional string clientId = 8;
|
|
54
|
+
string createdAt = 9;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message WithdrawalData {
|
|
58
|
+
string id = 1;
|
|
59
|
+
string driverId = 2;
|
|
60
|
+
float amount = 3;
|
|
61
|
+
string cardNumber = 4;
|
|
62
|
+
string cardHolderName = 5;
|
|
63
|
+
string status = 6;
|
|
64
|
+
string createdAt = 7;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message DriverBalanceData {
|
|
68
|
+
string driverId = 1;
|
|
69
|
+
float balance = 2;
|
|
70
|
+
}
|
|
71
|
+
|
|
32
72
|
// ==========================================
|
|
33
73
|
// 3. REQUESTS
|
|
34
74
|
// ==========================================
|
|
35
75
|
|
|
76
|
+
// Client
|
|
36
77
|
message GetMyWalletRequest {
|
|
37
78
|
string clientId = 1;
|
|
38
79
|
}
|
|
39
80
|
|
|
81
|
+
message ApplyPromoCodeRequest {
|
|
82
|
+
string clientId = 1;
|
|
83
|
+
string promoCode = 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Driver
|
|
87
|
+
message GetDriverBalanceRequest {
|
|
88
|
+
string driverId = 1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
message AddDriverEarningRequest {
|
|
92
|
+
string driverId = 1;
|
|
93
|
+
string clientId = 2;
|
|
94
|
+
string tripId = 3;
|
|
95
|
+
float amount = 4;
|
|
96
|
+
string type = 5;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message GetDriverTransactionsRequest {
|
|
100
|
+
string driverId = 1;
|
|
101
|
+
int32 page = 2;
|
|
102
|
+
int32 pageSize = 3;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message RequestWithdrawalRequest {
|
|
106
|
+
string driverId = 1;
|
|
107
|
+
float amount = 2;
|
|
108
|
+
string cardNumber = 3;
|
|
109
|
+
string cardHolderName = 4;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Admin
|
|
113
|
+
message ProcessWithdrawalRequest {
|
|
114
|
+
string withdrawalId = 1;
|
|
115
|
+
string action = 2;
|
|
116
|
+
string processedBy = 3;
|
|
117
|
+
optional string rejectionReason = 4;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message GetPendingWithdrawalsRequest {
|
|
121
|
+
int32 page = 1;
|
|
122
|
+
int32 pageSize = 2;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
message GetAllDriverBalancesRequest {
|
|
126
|
+
int32 page = 1;
|
|
127
|
+
int32 pageSize = 2;
|
|
128
|
+
}
|
|
129
|
+
|
|
40
130
|
// ==========================================
|
|
41
131
|
// 4. RESPONSES
|
|
42
132
|
// ==========================================
|
|
43
133
|
|
|
134
|
+
// Client
|
|
44
135
|
message WalletResponse {
|
|
45
136
|
int32 statusCode = 1;
|
|
46
137
|
string message = 2;
|
|
47
138
|
WalletData data = 3;
|
|
48
139
|
}
|
|
140
|
+
|
|
141
|
+
// Driver balance
|
|
142
|
+
message DriverBalanceResponse {
|
|
143
|
+
int32 statusCode = 1;
|
|
144
|
+
string message = 2;
|
|
145
|
+
DriverBalanceData data = 3;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Driver earning added
|
|
149
|
+
message AddDriverEarningData {
|
|
150
|
+
string transactionId = 1;
|
|
151
|
+
float balance = 2;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
message AddDriverEarningResponse {
|
|
155
|
+
int32 statusCode = 1;
|
|
156
|
+
string message = 2;
|
|
157
|
+
AddDriverEarningData data = 3;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Driver transactions
|
|
161
|
+
message DriverTransactionListData {
|
|
162
|
+
repeated DriverTransactionData transactions = 1;
|
|
163
|
+
int32 total = 2;
|
|
164
|
+
int32 page = 3;
|
|
165
|
+
int32 pageSize = 4;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
message DriverTransactionListResponse {
|
|
169
|
+
int32 statusCode = 1;
|
|
170
|
+
string message = 2;
|
|
171
|
+
DriverTransactionListData data = 3;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Withdrawal request created
|
|
175
|
+
message WithdrawalResponseData {
|
|
176
|
+
string id = 1;
|
|
177
|
+
float amount = 2;
|
|
178
|
+
string cardNumber = 3;
|
|
179
|
+
string status = 4;
|
|
180
|
+
string createdAt = 5;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
message WithdrawalResponse {
|
|
184
|
+
int32 statusCode = 1;
|
|
185
|
+
string message = 2;
|
|
186
|
+
WithdrawalResponseData data = 3;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Withdrawal processed
|
|
190
|
+
message ProcessWithdrawalData {
|
|
191
|
+
string id = 1;
|
|
192
|
+
string status = 2;
|
|
193
|
+
optional string processedAt = 3;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
message ProcessWithdrawalResponse {
|
|
197
|
+
int32 statusCode = 1;
|
|
198
|
+
string message = 2;
|
|
199
|
+
ProcessWithdrawalData data = 3;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Pending withdrawals list
|
|
203
|
+
message PendingWithdrawalsData {
|
|
204
|
+
repeated WithdrawalData withdrawals = 1;
|
|
205
|
+
int32 total = 2;
|
|
206
|
+
int32 page = 3;
|
|
207
|
+
int32 pageSize = 4;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
message PendingWithdrawalsResponse {
|
|
211
|
+
int32 statusCode = 1;
|
|
212
|
+
string message = 2;
|
|
213
|
+
PendingWithdrawalsData data = 3;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// All driver balances
|
|
217
|
+
message AllDriverBalancesData {
|
|
218
|
+
repeated DriverBalanceData wallets = 1;
|
|
219
|
+
int32 total = 2;
|
|
220
|
+
int32 page = 3;
|
|
221
|
+
int32 pageSize = 4;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
message AllDriverBalancesResponse {
|
|
225
|
+
int32 statusCode = 1;
|
|
226
|
+
string message = 2;
|
|
227
|
+
AllDriverBalancesData data = 3;
|
|
228
|
+
}
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AddEarningDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const payment_enum_1 = require("../enums/payment.enum");
|
|
15
|
-
class AddEarningDto {
|
|
16
|
-
}
|
|
17
|
-
exports.AddEarningDto = AddEarningDto;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, class_validator_1.IsUUID)('4', { message: "INVALID_ID" }),
|
|
20
|
-
(0, class_validator_1.IsNotEmpty)({ message: "EMPTY_ID" }),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], AddEarningDto.prototype, "driverId", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, class_validator_1.IsUUID)('4', { message: "INVALID_ID" }),
|
|
25
|
-
(0, class_validator_1.IsNotEmpty)({ message: "EMPTY_ID" }),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], AddEarningDto.prototype, "clientId", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, class_validator_1.IsUUID)('4', { message: "INVALID_ID" }),
|
|
30
|
-
(0, class_validator_1.IsNotEmpty)({ message: "EMPTY_ID" }),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], AddEarningDto.prototype, "tripId", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, class_validator_1.IsNumber)({}, { message: "INVALID_AMOUNT" }),
|
|
35
|
-
(0, class_validator_1.Min)(0, { message: "INVALID_AMOUNT" }),
|
|
36
|
-
__metadata("design:type", Number)
|
|
37
|
-
], AddEarningDto.prototype, "amount", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, class_validator_1.IsEnum)(payment_enum_1.PaymentMethod, { message: "INVALID_PAYMENT_TYPE" }),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], AddEarningDto.prototype, "type", void 0);
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CreateTransactionDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const payment_enum_1 = require("../enums/payment.enum");
|
|
15
|
-
class CreateTransactionDto {
|
|
16
|
-
}
|
|
17
|
-
exports.CreateTransactionDto = CreateTransactionDto;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, class_validator_1.IsUUID)('4', { message: "INVALID_ID" }),
|
|
20
|
-
(0, class_validator_1.IsNotEmpty)({ message: "EMPTY_ID" }),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], CreateTransactionDto.prototype, "driverId", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, class_validator_1.IsUUID)('4', { message: "INVALID_ID" }),
|
|
25
|
-
(0, class_validator_1.IsNotEmpty)({ message: "EMPTY_ID" }),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], CreateTransactionDto.prototype, "clientId", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, class_validator_1.IsUUID)('4', { message: "INVALID_ID" }),
|
|
30
|
-
(0, class_validator_1.IsNotEmpty)({ message: "EMPTY_ID" }),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], CreateTransactionDto.prototype, "tripId", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, class_validator_1.IsNumber)({}, { message: "INVALID_AMOUNT" }),
|
|
35
|
-
(0, class_validator_1.Min)(0, { message: "INVALID_AMOUNT" }),
|
|
36
|
-
__metadata("design:type", Number)
|
|
37
|
-
], CreateTransactionDto.prototype, "amount", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, class_validator_1.IsEnum)(payment_enum_1.PaymentMethod, { message: "INVALID_PAYMENT_TYPE" }),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], CreateTransactionDto.prototype, "type", void 0);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.GetTransactionsDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const filter_dto_1 = require("./filter.dto");
|
|
15
|
-
class GetTransactionsDto extends filter_dto_1.FilterDto {
|
|
16
|
-
}
|
|
17
|
-
exports.GetTransactionsDto = GetTransactionsDto;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, class_validator_1.IsUUID)('4', { message: "INVALID_ID" }),
|
|
20
|
-
(0, class_validator_1.IsNotEmpty)({ message: "EMPTY_ID" }),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], GetTransactionsDto.prototype, "driverId", void 0);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.WithdrawBalanceDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class WithdrawBalanceDto {
|
|
15
|
-
}
|
|
16
|
-
exports.WithdrawBalanceDto = WithdrawBalanceDto;
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, class_validator_1.IsUUID)('4', { message: "INVALID_ID" }),
|
|
19
|
-
(0, class_validator_1.IsNotEmpty)({ message: "EMPTY_ID" }),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
-
], WithdrawBalanceDto.prototype, "driverId", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, class_validator_1.IsNumber)({}, { message: "INVALID_AMOUNT" }),
|
|
24
|
-
(0, class_validator_1.Min)(1, { message: "INVALID_AMOUNT" }),
|
|
25
|
-
__metadata("design:type", Number)
|
|
26
|
-
], WithdrawBalanceDto.prototype, "amount", void 0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const balanceProtoPath: string;
|
package/dist/proto/balance.proto
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package balance;
|
|
4
|
-
|
|
5
|
-
import "common.proto";
|
|
6
|
-
|
|
7
|
-
// ==========================================
|
|
8
|
-
// 1. SERVICE
|
|
9
|
-
// ==========================================
|
|
10
|
-
service BalanceService {
|
|
11
|
-
// Driver balansini olish
|
|
12
|
-
rpc GetBalance (common.IdRequest) returns (BalanceResponse);
|
|
13
|
-
|
|
14
|
-
// Trip daromadini qo'shish (core-service chaqiradi)
|
|
15
|
-
rpc AddEarning (AddEarningRequest) returns (AddEarningResponse);
|
|
16
|
-
|
|
17
|
-
// Pul yechish (admin tasdiqlaydi)
|
|
18
|
-
rpc WithdrawBalance (WithdrawBalanceRequest) returns (BalanceResponse);
|
|
19
|
-
|
|
20
|
-
// Transaction yaratish (trip tugaganda)
|
|
21
|
-
rpc CreateTransaction (CreateTransactionRequest) returns (TransactionResponse);
|
|
22
|
-
|
|
23
|
-
// Driver transaction tarixini olish
|
|
24
|
-
rpc GetDriverTransactions (GetDriverTransactionsRequest) returns (TransactionListResponse);
|
|
25
|
-
|
|
26
|
-
// Trip bo'yicha transactionlarni olish
|
|
27
|
-
rpc GetTransactionsByTrip (common.IdRequest) returns (TransactionListResponse);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// ==========================================
|
|
31
|
-
// 2. REQUEST MESSAGES
|
|
32
|
-
// ==========================================
|
|
33
|
-
message AddEarningRequest {
|
|
34
|
-
string driverId = 1;
|
|
35
|
-
float amount = 2;
|
|
36
|
-
string tripId = 3;
|
|
37
|
-
string clientId = 4;
|
|
38
|
-
string type = 5; // 'cash' | 'card'
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
message WithdrawBalanceRequest {
|
|
42
|
-
string driverId = 1;
|
|
43
|
-
float amount = 2;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
message CreateTransactionRequest {
|
|
47
|
-
string driverId = 1;
|
|
48
|
-
string clientId = 2;
|
|
49
|
-
string tripId = 3;
|
|
50
|
-
float amount = 4;
|
|
51
|
-
string type = 5; // 'cash' | 'card'
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
message GetDriverTransactionsRequest {
|
|
55
|
-
string driverId = 1;
|
|
56
|
-
optional int32 page = 2;
|
|
57
|
-
optional int32 pageSize = 3;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// ==========================================
|
|
61
|
-
// 3. RESPONSE MESSAGES
|
|
62
|
-
// ==========================================
|
|
63
|
-
message BalanceResponse {
|
|
64
|
-
int32 statusCode = 1;
|
|
65
|
-
string message = 2;
|
|
66
|
-
optional BalanceData data = 3;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
message BalanceData {
|
|
70
|
-
string driverId = 1;
|
|
71
|
-
float balance = 2;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
message AddEarningResponse {
|
|
75
|
-
int32 statusCode = 1;
|
|
76
|
-
string message = 2;
|
|
77
|
-
optional AddEarningData data = 3;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
message AddEarningData {
|
|
81
|
-
string transactionId = 1;
|
|
82
|
-
float balance = 2;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
message TransactionResponse {
|
|
86
|
-
int32 statusCode = 1;
|
|
87
|
-
string message = 2;
|
|
88
|
-
optional TransactionData data = 3;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
message TransactionData {
|
|
92
|
-
string id = 1;
|
|
93
|
-
string driverId = 2;
|
|
94
|
-
string clientId = 3;
|
|
95
|
-
string tripId = 4;
|
|
96
|
-
float amount = 5;
|
|
97
|
-
string type = 6;
|
|
98
|
-
string status = 7;
|
|
99
|
-
optional string paymeTransactionId = 8;
|
|
100
|
-
string createdAt = 9;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
message TransactionListResponse {
|
|
104
|
-
int32 statusCode = 1;
|
|
105
|
-
string message = 2;
|
|
106
|
-
optional TransactionListData data = 3;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
message TransactionListData {
|
|
110
|
-
repeated TransactionData transactions = 1;
|
|
111
|
-
int32 total = 2;
|
|
112
|
-
int32 page = 3;
|
|
113
|
-
int32 pageSize = 4;
|
|
114
|
-
}
|