@devline-smart-taxi/common 2.3.26

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.
Files changed (92) hide show
  1. package/README.md +18 -0
  2. package/dist/decorators/access-roles.decorator.d.ts +3 -0
  3. package/dist/decorators/access-roles.decorator.js +8 -0
  4. package/dist/decorators/current-user.decorator.d.ts +6 -0
  5. package/dist/decorators/current-user.decorator.js +14 -0
  6. package/dist/dto/add-earning.dto.d.ts +8 -0
  7. package/dist/dto/add-earning.dto.js +41 -0
  8. package/dist/dto/branch-response.dto.d.ts +15 -0
  9. package/dist/dto/branch-response.dto.js +15 -0
  10. package/dist/dto/create-transaction.dto.d.ts +8 -0
  11. package/dist/dto/create-transaction.dto.js +41 -0
  12. package/dist/dto/create-trip.dto.d.ts +8 -0
  13. package/dist/dto/create-trip.dto.js +83 -0
  14. package/dist/dto/driver-response.dto.d.ts +30 -0
  15. package/dist/dto/driver-response.dto.js +23 -0
  16. package/dist/dto/filter.dto.d.ts +4 -0
  17. package/dist/dto/filter.dto.js +24 -0
  18. package/dist/dto/get-transactions.dto.d.ts +4 -0
  19. package/dist/dto/get-transactions.dto.js +22 -0
  20. package/dist/dto/manager-response.dto.d.ts +27 -0
  21. package/dist/dto/manager-response.dto.js +22 -0
  22. package/dist/dto/pagination.dto.d.ts +4 -0
  23. package/dist/dto/pagination.dto.js +36 -0
  24. package/dist/dto/trip-action.dto.d.ts +6 -0
  25. package/dist/dto/trip-action.dto.js +54 -0
  26. package/dist/dto/trip-response.dto.d.ts +19 -0
  27. package/dist/dto/trip-response.dto.js +12 -0
  28. package/dist/dto/update-trip.dto.d.ts +6 -0
  29. package/dist/dto/update-trip.dto.js +8 -0
  30. package/dist/dto/user-response.dto.d.ts +28 -0
  31. package/dist/dto/user-response.dto.js +23 -0
  32. package/dist/dto/users-image-response.dto.d.ts +15 -0
  33. package/dist/dto/users-image-response.dto.js +15 -0
  34. package/dist/dto/withdraw-balance.dto.d.ts +4 -0
  35. package/dist/dto/withdraw-balance.dto.js +26 -0
  36. package/dist/enums/driver-status.enum.d.ts +7 -0
  37. package/dist/enums/driver-status.enum.js +11 -0
  38. package/dist/enums/payment.enum.d.ts +10 -0
  39. package/dist/enums/payment.enum.js +15 -0
  40. package/dist/enums/roles.enum.d.ts +7 -0
  41. package/dist/enums/roles.enum.js +11 -0
  42. package/dist/enums/trip-status.enum.d.ts +11 -0
  43. package/dist/enums/trip-status.enum.js +15 -0
  44. package/dist/index.d.ts +33 -0
  45. package/dist/index.js +50 -0
  46. package/dist/prompt/error-prompt.d.ts +72 -0
  47. package/dist/prompt/error-prompt.js +76 -0
  48. package/dist/proto/auth-proto-path.d.ts +1 -0
  49. package/dist/proto/auth-proto-path.js +4 -0
  50. package/dist/proto/auth-proto-path.ts +3 -0
  51. package/dist/proto/auth.proto +12 -0
  52. package/dist/proto/balance-proto-path.d.ts +1 -0
  53. package/dist/proto/balance-proto-path.js +4 -0
  54. package/dist/proto/balance-proto-path.ts +2 -0
  55. package/dist/proto/balance.proto +114 -0
  56. package/dist/proto/branch-proto-path.d.ts +1 -0
  57. package/dist/proto/branch-proto-path.js +4 -0
  58. package/dist/proto/branch-proto-path.ts +3 -0
  59. package/dist/proto/branch.proto +84 -0
  60. package/dist/proto/common-proto-path.d.ts +1 -0
  61. package/dist/proto/common-proto-path.js +4 -0
  62. package/dist/proto/common-proto-path.ts +3 -0
  63. package/dist/proto/common.proto +33 -0
  64. package/dist/proto/driver-proto-path.d.ts +1 -0
  65. package/dist/proto/driver-proto-path.js +4 -0
  66. package/dist/proto/driver-proto-path.ts +3 -0
  67. package/dist/proto/driver.proto +354 -0
  68. package/dist/proto/manager-proto-path.d.ts +1 -0
  69. package/dist/proto/manager-proto-path.js +4 -0
  70. package/dist/proto/manager-proto-path.ts +3 -0
  71. package/dist/proto/manager.proto +128 -0
  72. package/dist/proto/matching-proto-path.d.ts +1 -0
  73. package/dist/proto/matching-proto-path.js +4 -0
  74. package/dist/proto/matching-proto-path.ts +3 -0
  75. package/dist/proto/matching.proto +63 -0
  76. package/dist/proto/rating-proto-path.d.ts +1 -0
  77. package/dist/proto/rating-proto-path.js +4 -0
  78. package/dist/proto/rating-proto-path.ts +3 -0
  79. package/dist/proto/rating.proto +60 -0
  80. package/dist/proto/trip-proto-path.d.ts +1 -0
  81. package/dist/proto/trip-proto-path.js +4 -0
  82. package/dist/proto/trip-proto-path.ts +3 -0
  83. package/dist/proto/trip.proto +162 -0
  84. package/dist/proto/user-proto-path.d.ts +1 -0
  85. package/dist/proto/user-proto-path.js +4 -0
  86. package/dist/proto/user-proto-path.ts +3 -0
  87. package/dist/proto/user.proto +165 -0
  88. package/dist/proto/users-image-proto-path.d.ts +1 -0
  89. package/dist/proto/users-image-proto-path.js +4 -0
  90. package/dist/proto/users-image-proto-path.ts +3 -0
  91. package/dist/proto/users-image.proto +93 -0
  92. package/package.json +33 -0
@@ -0,0 +1,84 @@
1
+ // ==========================================
2
+ // PROTO FILE
3
+ // ==========================================
4
+ syntax = "proto3";
5
+
6
+ // ==========================================
7
+ // PACKAGE
8
+ // ==========================================
9
+
10
+ package branch;
11
+
12
+ import "common.proto";
13
+
14
+ // ==========================================
15
+ // 1. SERVICES
16
+ // ==========================================
17
+ service BranchService {
18
+ rpc CreateBranch (CreateBranchRequest) returns (BranchResponse);
19
+ rpc UpdateBranch (UpdateBranchRequest) returns (common.SuccessResponseResult);
20
+ rpc GetAllBranches (GetAllBranchesRequest) returns (BranchPaginationResponse);
21
+ rpc GetBranchById (common.IdRequest) returns (BranchResponse);
22
+ rpc GetMyBranches (common.NoParams) returns (MyBranchResponse);
23
+ rpc DeleteBranch (common.IdRequest) returns (common.SuccessResponseResult);
24
+ rpc DeactivateBranch (common.IdRequest) returns (common.SuccessResponseResult);
25
+ }
26
+
27
+ // ==========================================
28
+ // 2. REQUESTS
29
+ // ==========================================
30
+ message CreateBranchRequest {
31
+ string name = 1;
32
+ string region = 2;
33
+ }
34
+
35
+ message UpdateBranchRequest {
36
+ string id = 1;
37
+ optional string name = 2;
38
+ optional string region = 3;
39
+ }
40
+
41
+ message GetAllBranchesRequest {
42
+ optional int32 page = 1;
43
+ optional int32 pageSize = 2;
44
+ optional string search = 3;
45
+ }
46
+
47
+ // ==========================================
48
+ // 3. RESPONSE MESSAGES
49
+ // ==========================================
50
+
51
+ message BranchResponse {
52
+ int32 statusCode = 1;
53
+ string message = 2;
54
+ BranchData data = 3;
55
+ }
56
+
57
+ message BranchPaginationResponse {
58
+ repeated BranchData data = 1;
59
+ int32 totalElements = 2;
60
+ int32 totalPages = 3;
61
+ int32 pageSize = 4;
62
+ int32 currentPage = 5;
63
+ int32 from = 6;
64
+ int32 to = 7;
65
+ int32 statusCode = 8;
66
+ string message = 9;
67
+ }
68
+
69
+ message BranchData {
70
+ string id = 1;
71
+ string name = 2;
72
+ string region = 3;
73
+ bool isActive = 4;
74
+ bool isDeleted = 5;
75
+ string createdAt = 6;
76
+ optional string updatedAt = 7;
77
+ repeated string manager_ids = 8;
78
+ }
79
+
80
+ message MyBranchResponse {
81
+ int32 statusCode = 1;
82
+ string message = 2;
83
+ repeated BranchData data = 3;
84
+ }
@@ -0,0 +1 @@
1
+ export declare const commonProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commonProtoPath = void 0;
4
+ exports.commonProtoPath = `${__dirname}/common.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const commonProtoPath = `${__dirname}/common.proto`;
@@ -0,0 +1,33 @@
1
+ syntax = "proto3";
2
+
3
+ package common;
4
+
5
+ // ==========================================
6
+ // SHARED MESSAGES
7
+ // ==========================================
8
+
9
+ message MultiLangMessage {
10
+ string uz = 1;
11
+ string ru = 2;
12
+ string en = 3;
13
+ }
14
+
15
+ message SuccessResponse {
16
+ bool success = 1;
17
+ }
18
+
19
+ message SuccessResponseResult {
20
+ SuccessResponse data = 1;
21
+ string message = 2;
22
+ int32 statusCode = 3;
23
+ }
24
+
25
+ message IdRequest {
26
+ string id = 1;
27
+ }
28
+
29
+ message IdsRequest {
30
+ repeated string ids = 1;
31
+ }
32
+
33
+ message NoParams {}
@@ -0,0 +1 @@
1
+ export declare const driverProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.driverProtoPath = void 0;
4
+ exports.driverProtoPath = `${__dirname}/driver.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const driverProtoPath = `${__dirname}/driver.proto`;
@@ -0,0 +1,354 @@
1
+ syntax = "proto3";
2
+
3
+ package driver;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+ service DriverService {
11
+ // Ro'yxatdan o'tish uchun OTP yuborish
12
+ rpc SendOtpRegistration (SendOtpRequest) returns (SendOtpResponse);
13
+
14
+ // OTP kodini tasdiqlash va autentifikatsiya
15
+ rpc VerifyOtpAndAuth (VerifyOtpRequest) returns (VerifyOtpResponse);
16
+
17
+ // Passwordni kiritadi
18
+ rpc Password (PasswordRequest) returns (PasswordResponse);
19
+
20
+ // Registration Step 2: Shaxsiy ma'lumotlar va ID karta
21
+ rpc SavePersonalInfo (SavePersonalRequest) returns (SavePersonalInfoResponse);
22
+
23
+ // Registration Step 3: Mashina ma'lumotlari
24
+ rpc SaveCarInfo (SaveCarInfoRequest) returns (SaveCarInfoResponse);
25
+
26
+ // Registration Step 4: Haydovchilik guvohnomasi ma'lumotlari
27
+ rpc SaveDriverLicense (SaveDriverLicenseRequest) returns (SaveDriverLicenseResponse);
28
+
29
+ // Barcha haydovchilarni pagination bilan olish
30
+ rpc GetAllDrivers (GetAllDriversRequest) returns (DriversPaginationResponse);
31
+
32
+ // ID bo'yicha haydovchi ma'lumotlarini olish
33
+ rpc GetDriverById (common.IdRequest) returns (DriverResponse);
34
+
35
+ // Haydovchi profileni ko'rishi
36
+ rpc GetDriverProfile (common.IdRequest) returns (DriverResponse);
37
+
38
+ // Haydovchini soft delete qilish
39
+ rpc DeleteDriver (common.IdRequest) returns (common.SuccessResponseResult);
40
+
41
+ // Haydovchini bloklash qilish
42
+ rpc BlockDriver (BlockDriverRequest) returns (common.SuccessResponseResult);
43
+
44
+ // Rasm yuklash uchun step OTP tekshirish (OTP o'chirilmaydi)
45
+ rpc VerifyStepOtpForImageUpload (VerifyStepOtpForImageUploadRequest) returns (VerifyStepOtpForImageUploadResponse);
46
+
47
+ // Haydovchini tasdiqlash
48
+ rpc ApproveDriver (common.IdRequest) returns (common.SuccessResponseResult);
49
+
50
+ // Haydovchini rad etish
51
+ rpc RejectDriver (RejectDriverRequest) returns (common.SuccessResponseResult);
52
+
53
+ // Haydovchini qayta faollashtirish
54
+ rpc ReactivateDriver (ReactivateDriverRequest) returns (common.SuccessResponseResult);
55
+
56
+ // Shaxsiy ma'lumotlarni yangilash
57
+ rpc UpdatePersonalInfo (UpdateDriverPersonalInfoRequest) returns (common.SuccessResponseResult);
58
+
59
+ // Mashina ma'lumotlarini yangilash
60
+ rpc UpdateCarInfo (UpdateDriverCarInfoRequest) returns (common.SuccessResponseResult);
61
+
62
+ // Haydovchilik guvohnomasini yangilash
63
+ rpc UpdateDriverLicense (UpdateDriverLicenseRequest) returns (common.SuccessResponseResult);
64
+
65
+ // Haydovchi reytingini yangilash (Faqat internal xizmatlar uchun)
66
+ rpc UpdateDriverRating (UpdateDriverRatingRequest) returns (common.SuccessResponseResult);
67
+ }
68
+
69
+ // ==========================================
70
+ // 2. REQUEST MESSAGES
71
+ // ==========================================
72
+ message SendOtpRequest {
73
+ string phoneNumber = 1;
74
+ bool hasDataConsent = 2;
75
+ }
76
+
77
+ message VerifyOtpRequest {
78
+ string phoneNumber = 1;
79
+ int32 otp = 2;
80
+ }
81
+
82
+ message SavePersonalRequest {
83
+ string phoneNumber = 1;
84
+ string firstName = 2;
85
+ string lastName = 3;
86
+ string birthDate = 4;
87
+ string pinfl = 5; // JSHSHIR raqami (14 ta raqam)
88
+ string cardFrontId = 6; // UsersImage ID (UUID)
89
+ string cardBackId = 7; // UsersImage ID (UUID)
90
+ string selfieWithCardId = 8; // UsersImage ID (UUID)
91
+ string secretOtp = 9; // Oldingi stepdan kelgan maxfiy OTP
92
+ }
93
+
94
+ message SaveCarInfoRequest {
95
+ string phoneNumber = 1;
96
+ string carBrand = 2;
97
+ string carModel = 3;
98
+ string carNumber = 4;
99
+ string carColor = 5;
100
+ bool isOwner = 6;
101
+ string documentFrontId = 7; // UsersImage ID (UUID) - Tex-pasport oldi rasmi
102
+ string documentBackId = 8; // UsersImage ID (UUID) - Tex-pasport orqa rasmi
103
+ string secretOtp = 9; // Oldingi stepdan kelgan maxfiy OTP
104
+ }
105
+
106
+ message GetAllDriversRequest {
107
+ optional int32 page = 1; // Sahifa raqami (default: 1)
108
+ optional int32 pageSize = 2; // Sahifa o'lchami (default: 10)
109
+ optional string search = 3; // Qidiruv so'zi (phoneNumber bo'yicha)
110
+ }
111
+
112
+ message SaveDriverLicenseRequest {
113
+ string phoneNumber = 1; // Haydovchi telefon raqami
114
+ string licenseNumber = 2; // Haydovchilik guvohnomasi raqami
115
+ string expiryDate = 3; // Amal qilish muddati (string)
116
+ int32 experience = 4; // Haydash tajribasi (yillar)
117
+ string licenseFrontId = 5; // UsersImage ID (UUID)
118
+ string licenseBackId = 6; // UsersImage ID (UUID)
119
+ string secretOtp = 7; // Oldingi stepdan kelgan maxfiy OTP
120
+ }
121
+
122
+ message PasswordRequest{
123
+ string password = 1;
124
+ string phoneNumber = 2;
125
+ string secretOtp = 3; // Oldingi stepdan kelgan maxfiy OTP
126
+ }
127
+
128
+ message BlockDriverRequest {
129
+ string id = 1;
130
+ optional string reason = 2; // Bloklash sababi
131
+ }
132
+
133
+ message VerifyStepOtpForImageUploadRequest {
134
+ string step = 1; // DriverRegistrationSteps enum qiymati
135
+ string phoneNumber = 2;
136
+ string otp = 3;
137
+ }
138
+
139
+ message RejectDriverRequest {
140
+ string driverId = 1;
141
+ string reason = 2;
142
+ }
143
+
144
+ message ReactivateDriverRequest {
145
+ string id = 1;
146
+ optional string reason = 2;
147
+ }
148
+
149
+ message UpdateDriverRatingRequest {
150
+ string driverId = 1;
151
+ float rating = 2;
152
+ }
153
+
154
+ message UpdateDriverPersonalInfoRequest {
155
+ string id = 1;
156
+ optional string firstName = 2;
157
+ optional string lastName = 3;
158
+ optional string birthDate = 4;
159
+ optional string cardFrontId = 5;
160
+ optional string cardBackId = 6;
161
+ optional string selfieWithCardId = 7;
162
+ }
163
+
164
+ message UpdateDriverCarInfoRequest {
165
+ string id = 1;
166
+ optional string carBrand = 2;
167
+ optional string carModel = 3;
168
+ optional string carNumber = 4;
169
+ optional string carColor = 5;
170
+ optional bool isOwner = 6;
171
+ optional string documentFrontId = 7;
172
+ optional string documentBackId = 8;
173
+ }
174
+
175
+ message UpdateDriverLicenseRequest {
176
+ string id = 1;
177
+ optional string licenseNumber = 2;
178
+ optional string expiryDate = 3;
179
+ optional int32 experience = 4;
180
+ optional string licenseFrontId = 5;
181
+ optional string licenseBackId = 6;
182
+ }
183
+
184
+ message VerifyStepOtpForImageUploadResponse {
185
+ int32 statusCode = 1;
186
+ string message = 2;
187
+ bool isValid = 3;
188
+ }
189
+
190
+ // ==========================================
191
+ // 3. RESPONSE MESSAGES
192
+ // ==========================================
193
+ message SendOtpResponse {
194
+ int32 statusCode = 1;
195
+ string message = 2;
196
+ OtpData data = 3;
197
+ }
198
+
199
+ message VerifyOtpResponse {
200
+ int32 statusCode = 1;
201
+ string message = 2;
202
+ VerifyOtpData data = 3;
203
+ }
204
+
205
+ message SavePersonalInfoResponse {
206
+ int32 statusCode = 1;
207
+ string message = 2;
208
+ StepResponseData data = 3;
209
+ }
210
+
211
+ message SaveCarInfoResponse {
212
+ int32 statusCode = 1;
213
+ string message = 2;
214
+ StepResponseData data = 3;
215
+ }
216
+
217
+ message SaveDriverLicenseResponse {
218
+ int32 statusCode = 1;
219
+ string message = 2;
220
+ StepResponseData data = 3;
221
+ }
222
+
223
+ message DriversPaginationResponse {
224
+ repeated DriverData data = 1;
225
+ int32 totalElements = 2;
226
+ int32 totalPages = 3;
227
+ int32 pageSize = 4;
228
+ int32 currentPage = 5;
229
+ int32 from = 6;
230
+ int32 to = 7;
231
+ int32 statusCode = 8;
232
+ string message = 9;
233
+ }
234
+
235
+ message DriverResponse {
236
+ int32 statusCode = 1;
237
+ string message = 2;
238
+ DriverData data = 3;
239
+ }
240
+
241
+ message PasswordResponse {
242
+ string message = 1;
243
+ int32 statusCode = 2;
244
+ PasswordData data = 3;
245
+ }
246
+
247
+ // ==========================================
248
+ // 4. DATA TYPES (SUB-MESSAGES)
249
+ // ==========================================
250
+
251
+ // Ko'p tilli xabarlar uchun standart format
252
+ message MultiLangMessage {
253
+ string uz = 1;
254
+ string ru = 2;
255
+ string en = 3;
256
+ }
257
+
258
+ // SendOtpResponse uchun ma'lumotlar strukturasi
259
+ message OtpData {
260
+ string phoneNumber = 1;
261
+ optional int32 expiresIn = 2;
262
+ optional int32 otp = 3;
263
+ optional string step = 4;
264
+
265
+ // agar ro'yxatda bo'lsa success qaytaramiz
266
+ optional bool success = 5;
267
+ }
268
+
269
+
270
+
271
+ // VerifyOtpResponse uchun ma'lumotlar strukturasi
272
+ message VerifyOtpData {
273
+ string phoneNumber = 1;
274
+ optional string step = 2;
275
+ optional string secretOtp = 3; // Keyingi step uchun maxfiy OTP
276
+ optional string accessToken = 4; // Faqat ACTIVE haydovchi uchun
277
+ optional string refreshToken = 5; // Faqat ACTIVE haydovchi uchun
278
+ bool isRegistered = 6; // true = ACTIVE haydovchi, false = ro'yxatdan o'tish jarayonida
279
+ optional string reason = 7; // REJECTED/BLOCKED sababi
280
+ }
281
+
282
+ // SavePersonalInfo va SaveCarInfo response uchun umumiy ma'lumotlar strukturasi
283
+ message StepResponseData {
284
+ string step = 1;
285
+ string phoneNumber = 2;
286
+ optional string secretOtp = 3; // Keyingi step uchun maxfiy OTP (oxirgi stepda bo'lmaydi)
287
+ }
288
+
289
+ message DriverData {
290
+ string id = 1;
291
+ string phoneNumber = 2;
292
+ string firstName = 3;
293
+ string lastName = 4;
294
+ optional string email = 5;
295
+ optional string birthDate = 6;
296
+ optional string address = 7;
297
+ string role = 8;
298
+ bool hasDataConsent = 9;
299
+ string stepRegistration = 10;
300
+ string status = 11;
301
+ int32 drivingExperience = 12;
302
+ bool isActive = 13;
303
+ bool isDeleted = 14;
304
+ bool isBlocked = 15;
305
+ string createdAt = 16;
306
+ optional string updatedAt = 17;
307
+ optional DriverDocumentsData documents = 18;
308
+ repeated DriverCarData cars = 19;
309
+ optional string branchId = 20;
310
+ optional float rating = 21;
311
+ }
312
+
313
+ // Haydovchining hujjatlari (ID karta, selfi, haydovchilik guvohnomasi)
314
+ message DriverDocumentsData {
315
+ string id = 1;
316
+ UsersImageData cardFront = 2;
317
+ UsersImageData cardBack = 3;
318
+ UsersImageData selfieWithCard = 4;
319
+ UsersImageData driverLicenseFront = 5;
320
+ UsersImageData driverLicenseBack = 6;
321
+ string driverLicenseSerialNumber = 7;
322
+ string driverLicenseExpiryDate = 8;
323
+ string jshshirNumber = 9;
324
+ }
325
+
326
+ // Haydovchining mashinasi
327
+ message DriverCarData {
328
+ string id = 1;
329
+ string carBrand = 2;
330
+ string carModel = 3;
331
+ string carNumber = 4;
332
+ string carColor = 5;
333
+ string carTariff = 6;
334
+ bool isOwner = 7;
335
+ UsersImageData documentFront = 8;
336
+ UsersImageData documentBack = 9;
337
+ }
338
+
339
+ // Rasm (UsersImage) ma'lumotlari (short format)
340
+ message UsersImageData {
341
+ string id = 1;
342
+ string url = 2;
343
+ int32 size = 3;
344
+ string type = 4;
345
+ string name = 5;
346
+ }
347
+
348
+ // Registratsiyadan o'tadish uchun
349
+ message PasswordData {
350
+ bool success = 1;
351
+ string step = 2;
352
+ string phoneNumber = 3;
353
+ string secretOtp = 4; // Keyingi step uchun maxfiy OTP
354
+ }
@@ -0,0 +1 @@
1
+ export declare const managerProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.managerProtoPath = void 0;
4
+ exports.managerProtoPath = `${__dirname}/manager.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const managerProtoPath = `${__dirname}/manager.proto`;
@@ -0,0 +1,128 @@
1
+ syntax = "proto3";
2
+
3
+ package manager;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+ service ManagerService {
11
+ rpc SignIn (ManagerSignInRequest) returns (TokenResponse);
12
+ rpc SendOtpForReset (SendOtpForResetRequest) returns (common.SuccessResponseResult);
13
+ rpc ResetPassword (ResetPasswordRequest) returns (common.SuccessResponseResult);
14
+ rpc CreateManager (CreateManagerRequest) returns (common.SuccessResponseResult);
15
+ rpc UpdateManager (UpdateManagerRequest) returns (common.SuccessResponseResult);
16
+ rpc GetAllManagers (GetAllManagersRequest) returns (ManagerPaginationResponse);
17
+ rpc GetManagerById (common.IdRequest) returns (ManagerResponse);
18
+ rpc GetMyProfile (common.NoParams) returns (ManagerResponse);
19
+ rpc DeleteManager (common.IdRequest) returns (common.SuccessResponseResult);
20
+ rpc DeactivateManager (common.IdRequest) returns (common.SuccessResponseResult);
21
+ rpc RefreshToken (RefreshTokenRequest) returns (TokenResponse);
22
+ rpc GetManagersByIds (common.IdsRequest) returns (ManagerListResponse);
23
+ }
24
+
25
+ // ==========================================
26
+ // 2. REQUEST MESSAGES
27
+ // ==========================================
28
+ message ManagerSignInRequest {
29
+ string identifier = 1; // username yoki phoneNumber
30
+ string password = 2;
31
+ }
32
+
33
+ message SendOtpForResetRequest {
34
+ string phoneNumber = 1;
35
+ }
36
+
37
+ message ResetPasswordRequest {
38
+ string phoneNumber = 1;
39
+ int32 otp = 2;
40
+ string newPassword = 3;
41
+ }
42
+
43
+ message CreateManagerRequest {
44
+ string phoneNumber = 1;
45
+ string username = 2;
46
+ string firstName = 3;
47
+ string lastName = 4;
48
+ optional string email = 5;
49
+ optional string branchId = 6;
50
+ string password = 7;
51
+ string role = 8;
52
+ }
53
+
54
+ message UpdateManagerRequest {
55
+ string id = 1;
56
+ optional string username = 2;
57
+ optional string firstName = 3;
58
+ optional string lastName = 4;
59
+ optional string email = 5;
60
+ optional string branchId = 6;
61
+ optional string password = 7;
62
+ }
63
+
64
+ message GetAllManagersRequest {
65
+ optional int32 page = 1;
66
+ optional int32 pageSize = 2;
67
+ optional string search = 3;
68
+ }
69
+
70
+ message RefreshTokenRequest {
71
+ string refreshToken = 1;
72
+ }
73
+
74
+ // ==========================================
75
+ // 3. RESPONSE MESSAGES
76
+ // ==========================================
77
+ message ManagerResponse {
78
+ int32 statusCode = 1;
79
+ string message = 2;
80
+ ManagerData data = 3;
81
+ }
82
+
83
+ message ManagerPaginationResponse {
84
+ repeated ManagerData data = 1;
85
+ int32 totalElements = 2;
86
+ int32 totalPages = 3;
87
+ int32 pageSize = 4;
88
+ int32 currentPage = 5;
89
+ int32 from = 6;
90
+ int32 to = 7;
91
+ int32 statusCode = 8;
92
+ string message = 9;
93
+ }
94
+
95
+ message TokenResponse {
96
+ int32 statusCode = 1;
97
+ string message = 2;
98
+ Token data = 3;
99
+ }
100
+
101
+ message ManagerListResponse {
102
+ int32 statusCode = 1;
103
+ string message = 2;
104
+ repeated ManagerData data = 3;
105
+ }
106
+
107
+ // ==========================================
108
+ // 4. DATA TYPES
109
+ // ==========================================
110
+ message ManagerData {
111
+ string id = 1;
112
+ string username = 2;
113
+ string phoneNumber = 3;
114
+ optional string email = 4;
115
+ string role = 5;
116
+ optional string branchId = 6;
117
+ bool isActive = 7;
118
+ bool isDeleted = 8;
119
+ string createdAt = 9;
120
+ optional string updatedAt = 10;
121
+ }
122
+
123
+ message Token {
124
+ string accessToken = 1;
125
+ string refreshToken = 2;
126
+ string id = 3;
127
+ optional string branchId = 4;
128
+ }
@@ -0,0 +1 @@
1
+ export declare const matchingProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matchingProtoPath = void 0;
4
+ exports.matchingProtoPath = `${__dirname}/matching.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const matchingProtoPath = `${__dirname}/matching.proto`;