@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,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserListResponseDto = exports.UserResponseDto = exports.UserAuthResponseDto = void 0;
4
+ class UserAuthResponseDto {
5
+ constructor() {
6
+ this.email = null;
7
+ }
8
+ }
9
+ exports.UserAuthResponseDto = UserAuthResponseDto;
10
+ class UserResponseDto {
11
+ constructor() {
12
+ this.email = null;
13
+ this.birthDate = null;
14
+ this.address = null;
15
+ }
16
+ }
17
+ exports.UserResponseDto = UserResponseDto;
18
+ class UserListResponseDto {
19
+ constructor() {
20
+ this.items = [];
21
+ }
22
+ }
23
+ exports.UserListResponseDto = UserListResponseDto;
@@ -0,0 +1,15 @@
1
+ export declare class UsersImageResponseDto {
2
+ id: string;
3
+ userId: string;
4
+ imageUrl: string;
5
+ imageType: string | null;
6
+ isActive: boolean;
7
+ createdAt: string;
8
+ updatedAt: string;
9
+ }
10
+ export declare class UsersImageListResponseDto {
11
+ items: UsersImageResponseDto[];
12
+ total: number;
13
+ page: number;
14
+ pages: number;
15
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UsersImageListResponseDto = exports.UsersImageResponseDto = void 0;
4
+ class UsersImageResponseDto {
5
+ constructor() {
6
+ this.imageType = null;
7
+ }
8
+ }
9
+ exports.UsersImageResponseDto = UsersImageResponseDto;
10
+ class UsersImageListResponseDto {
11
+ constructor() {
12
+ this.items = [];
13
+ }
14
+ }
15
+ exports.UsersImageListResponseDto = UsersImageListResponseDto;
@@ -0,0 +1,4 @@
1
+ export declare class WithdrawBalanceDto {
2
+ driverId: string;
3
+ amount: number;
4
+ }
@@ -0,0 +1,26 @@
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);
@@ -0,0 +1,7 @@
1
+ export declare enum DriverStatus {
2
+ OFFLINE = "OFFLINE",
3
+ ONLINE = "ONLINE",
4
+ RESERVED = "RESERVED",
5
+ ON_ROAD = "ON_ROAD",
6
+ BUSY = "BUSY"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DriverStatus = void 0;
4
+ var DriverStatus;
5
+ (function (DriverStatus) {
6
+ DriverStatus["OFFLINE"] = "OFFLINE";
7
+ DriverStatus["ONLINE"] = "ONLINE";
8
+ DriverStatus["RESERVED"] = "RESERVED";
9
+ DriverStatus["ON_ROAD"] = "ON_ROAD";
10
+ DriverStatus["BUSY"] = "BUSY";
11
+ })(DriverStatus || (exports.DriverStatus = DriverStatus = {}));
@@ -0,0 +1,10 @@
1
+ export declare enum PaymentMethod {
2
+ CASH = "cash",// naqd pul orqali to`lov
3
+ CARD = "card"
4
+ }
5
+ export declare enum PaymentStatus {
6
+ PENDING = "pending",// to`lov amalga oshirilmagan holat
7
+ PAID = "paid",// to`lov muvaffaqiyatli amalga oshirilgan holat
8
+ FAILED = "failed",// to`lov amalga oshirilmagan yoki muvaffaqiyatsiz holat
9
+ CANCELLED = "cancelled"
10
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentStatus = exports.PaymentMethod = void 0;
4
+ var PaymentMethod;
5
+ (function (PaymentMethod) {
6
+ PaymentMethod["CASH"] = "cash";
7
+ PaymentMethod["CARD"] = "card";
8
+ })(PaymentMethod || (exports.PaymentMethod = PaymentMethod = {}));
9
+ var PaymentStatus;
10
+ (function (PaymentStatus) {
11
+ PaymentStatus["PENDING"] = "pending";
12
+ PaymentStatus["PAID"] = "paid";
13
+ PaymentStatus["FAILED"] = "failed";
14
+ PaymentStatus["CANCELLED"] = "cancelled";
15
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
@@ -0,0 +1,7 @@
1
+ export declare enum RolesEnum {
2
+ SUPER_ADMIN = "SUPER_ADMIN",
3
+ MANAGER = "MANAGER",
4
+ WORKER = "WORKER",
5
+ DRIVER = "DRIVER",
6
+ CLIENT = "CLIENT"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RolesEnum = void 0;
4
+ var RolesEnum;
5
+ (function (RolesEnum) {
6
+ RolesEnum["SUPER_ADMIN"] = "SUPER_ADMIN";
7
+ RolesEnum["MANAGER"] = "MANAGER";
8
+ RolesEnum["WORKER"] = "WORKER";
9
+ RolesEnum["DRIVER"] = "DRIVER";
10
+ RolesEnum["CLIENT"] = "CLIENT";
11
+ })(RolesEnum || (exports.RolesEnum = RolesEnum = {}));
@@ -0,0 +1,11 @@
1
+ export declare enum TripStatus {
2
+ REQUESTED = "REQUESTED",// Trip yaratildi
3
+ PENDING = "PENDING",// Driverlarga notification yuborilmoqda
4
+ PHONE_CALL = "PHONE_CALL",// Driver qabul qildi, user bilan gaplashmoqda
5
+ CONFIRMED = "CONFIRMED",// Telefonda gaplashib tasdiqlandi
6
+ DECLINED = "DECLINED",// Hamma driverlar rad etdi
7
+ ARRIVED = "ARRIVED",// Haydovchi yetib keldi
8
+ CANCELED = "CANCELED",// Client bekor qildi
9
+ ON_ROAD = "ON_ROAD",// Yo'lda (mijozni olib ketyapti)
10
+ FINISHED = "FINISHED"
11
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TripStatus = void 0;
4
+ var TripStatus;
5
+ (function (TripStatus) {
6
+ TripStatus["REQUESTED"] = "REQUESTED";
7
+ TripStatus["PENDING"] = "PENDING";
8
+ TripStatus["PHONE_CALL"] = "PHONE_CALL";
9
+ TripStatus["CONFIRMED"] = "CONFIRMED";
10
+ TripStatus["DECLINED"] = "DECLINED";
11
+ TripStatus["ARRIVED"] = "ARRIVED";
12
+ TripStatus["CANCELED"] = "CANCELED";
13
+ TripStatus["ON_ROAD"] = "ON_ROAD";
14
+ TripStatus["FINISHED"] = "FINISHED";
15
+ })(TripStatus || (exports.TripStatus = TripStatus = {}));
@@ -0,0 +1,33 @@
1
+ export * from './dto/pagination.dto';
2
+ export * from './dto/filter.dto';
3
+ export * from './dto/manager-response.dto';
4
+ export * from './dto/user-response.dto';
5
+ export * from './dto/driver-response.dto';
6
+ export * from './dto/branch-response.dto';
7
+ export * from './dto/users-image-response.dto';
8
+ export * from './enums/driver-status.enum';
9
+ export * from './enums/roles.enum';
10
+ export * from './enums/trip-status.enum';
11
+ export * from './enums/payment.enum';
12
+ export * from './proto/common-proto-path';
13
+ export * from './proto/user-proto-path';
14
+ export * from './proto/driver-proto-path';
15
+ export * from './proto/users-image-proto-path';
16
+ export * from './proto/manager-proto-path';
17
+ export * from './proto/branch-proto-path';
18
+ export * from './proto/trip-proto-path';
19
+ export * from './proto/auth-proto-path';
20
+ export * from './decorators/access-roles.decorator';
21
+ export * from './decorators/current-user.decorator';
22
+ export * from './prompt/error-prompt';
23
+ export * from './proto/matching-proto-path';
24
+ export * from './dto/create-trip.dto';
25
+ export * from './dto/update-trip.dto';
26
+ export * from './dto/trip-action.dto';
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
+ export * from './proto/rating-proto-path';
package/dist/index.js ADDED
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // src/index.ts
18
+ __exportStar(require("./dto/pagination.dto"), exports);
19
+ __exportStar(require("./dto/filter.dto"), exports);
20
+ __exportStar(require("./dto/manager-response.dto"), exports);
21
+ __exportStar(require("./dto/user-response.dto"), exports);
22
+ __exportStar(require("./dto/driver-response.dto"), exports);
23
+ __exportStar(require("./dto/branch-response.dto"), exports);
24
+ __exportStar(require("./dto/users-image-response.dto"), exports);
25
+ __exportStar(require("./enums/driver-status.enum"), exports);
26
+ __exportStar(require("./enums/roles.enum"), exports);
27
+ __exportStar(require("./enums/trip-status.enum"), exports);
28
+ __exportStar(require("./enums/payment.enum"), exports);
29
+ __exportStar(require("./proto/common-proto-path"), exports);
30
+ __exportStar(require("./proto/user-proto-path"), exports);
31
+ __exportStar(require("./proto/driver-proto-path"), exports);
32
+ __exportStar(require("./proto/users-image-proto-path"), exports);
33
+ __exportStar(require("./proto/manager-proto-path"), exports);
34
+ __exportStar(require("./proto/branch-proto-path"), exports);
35
+ __exportStar(require("./proto/trip-proto-path"), exports);
36
+ __exportStar(require("./proto/auth-proto-path"), exports);
37
+ __exportStar(require("./decorators/access-roles.decorator"), exports);
38
+ __exportStar(require("./decorators/current-user.decorator"), exports);
39
+ __exportStar(require("./prompt/error-prompt"), exports);
40
+ __exportStar(require("./proto/matching-proto-path"), exports);
41
+ __exportStar(require("./dto/create-trip.dto"), exports);
42
+ __exportStar(require("./dto/update-trip.dto"), exports);
43
+ __exportStar(require("./dto/trip-action.dto"), exports);
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
+ __exportStar(require("./proto/rating-proto-path"), exports);
@@ -0,0 +1,72 @@
1
+ export declare const errorPrompt: {
2
+ EXPIRE_TOKEN_ERROR: {
3
+ key: string;
4
+ uz: string;
5
+ ru: string;
6
+ en: string;
7
+ grpcCode: number;
8
+ };
9
+ INVALID_TOKEN: {
10
+ key: string;
11
+ uz: string;
12
+ ru: string;
13
+ en: string;
14
+ grpcCode: number;
15
+ };
16
+ PERMISSION_DENIED: {
17
+ key: string;
18
+ uz: string;
19
+ ru: string;
20
+ en: string;
21
+ grpcCode: number;
22
+ };
23
+ CLIENT_ID_REQUIRED: {
24
+ key: string;
25
+ uz: string;
26
+ ru: string;
27
+ en: string;
28
+ grpcCode: number;
29
+ };
30
+ INVALID_CLIENT_ID: {
31
+ key: string;
32
+ uz: string;
33
+ ru: string;
34
+ en: string;
35
+ grpcCode: number;
36
+ };
37
+ INVALID_DRIVER_ID: {
38
+ key: string;
39
+ uz: string;
40
+ ru: string;
41
+ en: string;
42
+ grpcCode: number;
43
+ };
44
+ INVALID_TRIP_ID: {
45
+ key: string;
46
+ uz: string;
47
+ ru: string;
48
+ en: string;
49
+ grpcCode: number;
50
+ };
51
+ PAYMENT_METHOD_REQUIRED: {
52
+ key: string;
53
+ uz: string;
54
+ ru: string;
55
+ en: string;
56
+ grpcCode: number;
57
+ };
58
+ INVALID_PAYMENT_METHOD: {
59
+ key: string;
60
+ uz: string;
61
+ ru: string;
62
+ en: string;
63
+ grpcCode: number;
64
+ };
65
+ INVALID_PICKUP_LOCATION: {
66
+ key: string;
67
+ uz: string;
68
+ ru: string;
69
+ en: string;
70
+ grpcCode: number;
71
+ };
72
+ };
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.errorPrompt = void 0;
4
+ exports.errorPrompt = {
5
+ EXPIRE_TOKEN_ERROR: {
6
+ key: 'EXPIRE_TOKEN_ERROR',
7
+ uz: 'Token muddati tugagan!',
8
+ ru: 'Срок действия токена истёк!',
9
+ en: 'Token has already expired!',
10
+ grpcCode: 16,
11
+ },
12
+ INVALID_TOKEN: {
13
+ key: 'INVALID_TOKEN',
14
+ uz: 'Token yaroqsiz!',
15
+ ru: 'Недействительный токен!',
16
+ en: 'Invalid token!',
17
+ grpcCode: 16,
18
+ },
19
+ PERMISSION_DENIED: {
20
+ key: 'PERMISSION_DENIED',
21
+ uz: "Sizda ushbu amalni bajarish uchun ruxsat yo'q!",
22
+ ru: 'У вас нет прав на выполнение этого действия!',
23
+ en: "You don't have permission to perform this action!",
24
+ grpcCode: 7, // PERMISSION_DENIED kodi
25
+ },
26
+ // Trip related errors
27
+ CLIENT_ID_REQUIRED: {
28
+ key: 'CLIENT_ID_REQUIRED',
29
+ uz: 'Mijoz ID si talab qilinadi!',
30
+ ru: 'Требуется ID клиента!',
31
+ en: 'Client ID is required!',
32
+ grpcCode: 3, // INVALID_ARGUMENT
33
+ },
34
+ INVALID_CLIENT_ID: {
35
+ key: 'INVALID_CLIENT_ID',
36
+ uz: "Mijoz ID si noto'g'ri!",
37
+ ru: 'Неверный ID клиента!',
38
+ en: 'Invalid Client ID!',
39
+ grpcCode: 3,
40
+ },
41
+ INVALID_DRIVER_ID: {
42
+ key: 'INVALID_DRIVER_ID',
43
+ uz: "Haydovchi ID si noto'g'ri!",
44
+ ru: 'Неверный ID водителя!',
45
+ en: 'Invalid Driver ID!',
46
+ grpcCode: 3,
47
+ },
48
+ INVALID_TRIP_ID: {
49
+ key: 'INVALID_TRIP_ID',
50
+ uz: "Trip ID si noto'g'ri!",
51
+ ru: 'Неверный ID поездки!',
52
+ en: 'Invalid Trip ID!',
53
+ grpcCode: 3,
54
+ },
55
+ PAYMENT_METHOD_REQUIRED: {
56
+ key: 'PAYMENT_METHOD_REQUIRED',
57
+ uz: "To'lov turi talab qilinadi!",
58
+ ru: 'Требуется способ оплаты!',
59
+ en: 'Payment method is required!',
60
+ grpcCode: 3,
61
+ },
62
+ INVALID_PAYMENT_METHOD: {
63
+ key: 'INVALID_PAYMENT_METHOD',
64
+ uz: "To'lov turi noto'g'ri!",
65
+ ru: 'Неверный способ оплаты!',
66
+ en: 'Invalid payment method!',
67
+ grpcCode: 3,
68
+ },
69
+ INVALID_PICKUP_LOCATION: {
70
+ key: 'INVALID_PICKUP_LOCATION',
71
+ uz: "Olib ketish joyi noto'g'ri!",
72
+ ru: 'Неверное место посадки!',
73
+ en: 'Invalid pickup location!',
74
+ grpcCode: 3,
75
+ },
76
+ };
@@ -0,0 +1 @@
1
+ export declare const authProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.authProtoPath = void 0;
4
+ exports.authProtoPath = `${__dirname}/auth.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const authProtoPath = `${__dirname}/auth.proto`;
@@ -0,0 +1,12 @@
1
+ syntax = "proto3";
2
+
3
+ package auth;
4
+
5
+ service AuthService {
6
+ rpc Ping (PingRequest) returns (PingResponse);
7
+ }
8
+
9
+ message PingRequest {}
10
+ message PingResponse {
11
+ string message = 1;
12
+ }
@@ -0,0 +1 @@
1
+ export declare const balanceProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.balanceProtoPath = void 0;
4
+ exports.balanceProtoPath = `${__dirname}/balance.proto`;
@@ -0,0 +1,2 @@
1
+ declare const __dirname: string;
2
+ export const balanceProtoPath = `${__dirname}/balance.proto`;
@@ -0,0 +1,114 @@
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
+ }
@@ -0,0 +1 @@
1
+ export declare const branchProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.branchProtoPath = void 0;
4
+ exports.branchProtoPath = `${__dirname}/branch.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const branchProtoPath = `${__dirname}/branch.proto`;