@devline-smart-taxi/common 2.3.34 → 2.3.37

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.
@@ -0,0 +1,3 @@
1
+ export declare class CreateCarManufacturerDto {
2
+ name: string;
3
+ }
@@ -0,0 +1,27 @@
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.CreateCarManufacturerDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const error_prompt_1 = require("../prompt/error-prompt");
16
+ class CreateCarManufacturerDto {
17
+ }
18
+ exports.CreateCarManufacturerDto = CreateCarManufacturerDto;
19
+ __decorate([
20
+ (0, swagger_1.ApiProperty)({
21
+ description: 'Ishlab chiqaruvchi nomi',
22
+ example: 'Chevrolet',
23
+ }),
24
+ (0, class_validator_1.IsNotEmpty)({ message: error_prompt_1.errorPrompt.EMPTY_MANUFACTURER_NAME.key }),
25
+ (0, class_validator_1.IsString)({ message: error_prompt_1.errorPrompt.EMPTY_MANUFACTURER_NAME.key }),
26
+ __metadata("design:type", String)
27
+ ], CreateCarManufacturerDto.prototype, "name", void 0);
@@ -0,0 +1,4 @@
1
+ export declare class CreateCarModelDto {
2
+ name: string;
3
+ manufacturerId: string;
4
+ }
@@ -0,0 +1,36 @@
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.CreateCarModelDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const error_prompt_1 = require("../prompt/error-prompt");
16
+ class CreateCarModelDto {
17
+ }
18
+ exports.CreateCarModelDto = CreateCarModelDto;
19
+ __decorate([
20
+ (0, swagger_1.ApiProperty)({
21
+ description: 'Model nomi',
22
+ example: 'Cobalt',
23
+ }),
24
+ (0, class_validator_1.IsNotEmpty)({ message: error_prompt_1.errorPrompt.EMPTY_MODEL_NAME.key }),
25
+ (0, class_validator_1.IsString)({ message: error_prompt_1.errorPrompt.EMPTY_MODEL_NAME.key }),
26
+ __metadata("design:type", String)
27
+ ], CreateCarModelDto.prototype, "name", void 0);
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({
30
+ description: 'Ishlab chiqaruvchi ID (UUID)',
31
+ example: '550e8400-e29b-41d4-a716-446655440000',
32
+ }),
33
+ (0, class_validator_1.IsNotEmpty)({ message: error_prompt_1.errorPrompt.EMPTY_MANUFACTURER_ID.key }),
34
+ (0, class_validator_1.IsUUID)('4', { message: error_prompt_1.errorPrompt.INVALID_MANUFACTURER_ID.key }),
35
+ __metadata("design:type", String)
36
+ ], CreateCarModelDto.prototype, "manufacturerId", void 0);
@@ -0,0 +1,4 @@
1
+ export declare class UpdateCarManufacturerDto {
2
+ id?: string;
3
+ name?: string;
4
+ }
@@ -0,0 +1,33 @@
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.UpdateCarManufacturerDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ class UpdateCarManufacturerDto {
16
+ }
17
+ exports.UpdateCarManufacturerDto = UpdateCarManufacturerDto;
18
+ __decorate([
19
+ (0, swagger_1.ApiHideProperty)(),
20
+ (0, class_validator_1.IsOptional)(),
21
+ (0, class_validator_1.IsString)(),
22
+ __metadata("design:type", String)
23
+ ], UpdateCarManufacturerDto.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)({
26
+ description: 'Ishlab chiqaruvchi nomi',
27
+ example: 'Toyota',
28
+ required: false,
29
+ }),
30
+ (0, class_validator_1.IsOptional)(),
31
+ (0, class_validator_1.IsString)(),
32
+ __metadata("design:type", String)
33
+ ], UpdateCarManufacturerDto.prototype, "name", void 0);
@@ -0,0 +1,5 @@
1
+ export declare class UpdateCarModelDto {
2
+ id?: string;
3
+ name?: string;
4
+ manufacturerId?: string;
5
+ }
@@ -0,0 +1,44 @@
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.UpdateCarModelDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const error_prompt_1 = require("../prompt/error-prompt");
16
+ class UpdateCarModelDto {
17
+ }
18
+ exports.UpdateCarModelDto = UpdateCarModelDto;
19
+ __decorate([
20
+ (0, swagger_1.ApiHideProperty)(),
21
+ (0, class_validator_1.IsOptional)(),
22
+ (0, class_validator_1.IsString)(),
23
+ __metadata("design:type", String)
24
+ ], UpdateCarModelDto.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({
27
+ description: 'Model nomi',
28
+ example: 'Lacetti',
29
+ required: false,
30
+ }),
31
+ (0, class_validator_1.IsOptional)(),
32
+ (0, class_validator_1.IsString)(),
33
+ __metadata("design:type", String)
34
+ ], UpdateCarModelDto.prototype, "name", void 0);
35
+ __decorate([
36
+ (0, swagger_1.ApiProperty)({
37
+ description: 'Ishlab chiqaruvchi ID (UUID)',
38
+ example: '550e8400-e29b-41d4-a716-446655440000',
39
+ required: false,
40
+ }),
41
+ (0, class_validator_1.IsOptional)(),
42
+ (0, class_validator_1.IsUUID)('4', { message: error_prompt_1.errorPrompt.INVALID_MANUFACTURER_ID.key }),
43
+ __metadata("design:type", String)
44
+ ], UpdateCarModelDto.prototype, "manufacturerId", void 0);
package/dist/index.d.ts CHANGED
@@ -32,5 +32,11 @@ export * from './dto/get-transactions.dto';
32
32
  export * from './proto/balance-proto-path';
33
33
  export * from './proto/rating-proto-path';
34
34
  export * from './proto/car-class-proto-path';
35
+ export * from './proto/car-manufacturer-proto-path';
36
+ export * from './proto/car-model-proto-path';
37
+ export * from './dto/create-car-manufacturer.dto';
38
+ export * from './dto/update-car-manufacturer.dto';
39
+ export * from './dto/create-car-model.dto';
40
+ export * from './dto/update-car-model.dto';
35
41
  export * from './proto/wallet-proto-path';
36
42
  export * from './proto/bonus-campaign-proto-path';
package/dist/index.js CHANGED
@@ -49,5 +49,11 @@ __exportStar(require("./dto/get-transactions.dto"), exports);
49
49
  __exportStar(require("./proto/balance-proto-path"), exports);
50
50
  __exportStar(require("./proto/rating-proto-path"), exports);
51
51
  __exportStar(require("./proto/car-class-proto-path"), exports);
52
+ __exportStar(require("./proto/car-manufacturer-proto-path"), exports);
53
+ __exportStar(require("./proto/car-model-proto-path"), exports);
54
+ __exportStar(require("./dto/create-car-manufacturer.dto"), exports);
55
+ __exportStar(require("./dto/update-car-manufacturer.dto"), exports);
56
+ __exportStar(require("./dto/create-car-model.dto"), exports);
57
+ __exportStar(require("./dto/update-car-model.dto"), exports);
52
58
  __exportStar(require("./proto/wallet-proto-path"), exports);
53
59
  __exportStar(require("./proto/bonus-campaign-proto-path"), exports);
@@ -69,4 +69,53 @@ export declare const errorPrompt: {
69
69
  en: string;
70
70
  grpcCode: number;
71
71
  };
72
+ EMPTY_MANUFACTURER_NAME: {
73
+ key: string;
74
+ uz: string;
75
+ ru: string;
76
+ en: string;
77
+ grpcCode: number;
78
+ };
79
+ MANUFACTURER_ALREADY_EXISTS: {
80
+ key: string;
81
+ uz: string;
82
+ ru: string;
83
+ en: string;
84
+ grpcCode: number;
85
+ };
86
+ MANUFACTURER_NOT_FOUND: {
87
+ key: string;
88
+ uz: string;
89
+ ru: string;
90
+ en: string;
91
+ grpcCode: number;
92
+ };
93
+ EMPTY_MODEL_NAME: {
94
+ key: string;
95
+ uz: string;
96
+ ru: string;
97
+ en: string;
98
+ grpcCode: number;
99
+ };
100
+ EMPTY_MANUFACTURER_ID: {
101
+ key: string;
102
+ uz: string;
103
+ ru: string;
104
+ en: string;
105
+ grpcCode: number;
106
+ };
107
+ INVALID_MANUFACTURER_ID: {
108
+ key: string;
109
+ uz: string;
110
+ ru: string;
111
+ en: string;
112
+ grpcCode: number;
113
+ };
114
+ MODEL_ALREADY_EXISTS: {
115
+ key: string;
116
+ uz: string;
117
+ ru: string;
118
+ en: string;
119
+ grpcCode: number;
120
+ };
72
121
  };
@@ -73,4 +73,55 @@ exports.errorPrompt = {
73
73
  en: 'Invalid pickup location!',
74
74
  grpcCode: 3,
75
75
  },
76
+ // ====== Car Manufacturer ======
77
+ EMPTY_MANUFACTURER_NAME: {
78
+ key: 'EMPTY_MANUFACTURER_NAME',
79
+ uz: 'Ishlab chiqaruvchi nomini kiritish majburiy!',
80
+ ru: 'Название производителя обязательно!',
81
+ en: 'Manufacturer name is required!',
82
+ grpcCode: 3,
83
+ },
84
+ MANUFACTURER_ALREADY_EXISTS: {
85
+ key: 'MANUFACTURER_ALREADY_EXISTS',
86
+ uz: 'Bunday ishlab chiqaruvchi allaqachon mavjud!',
87
+ ru: 'Такой производитель уже существует!',
88
+ en: 'Manufacturer already exists!',
89
+ grpcCode: 6,
90
+ },
91
+ MANUFACTURER_NOT_FOUND: {
92
+ key: 'MANUFACTURER_NOT_FOUND',
93
+ uz: 'Ishlab chiqaruvchi topilmadi!',
94
+ ru: 'Производитель не найден!',
95
+ en: 'Manufacturer not found!',
96
+ grpcCode: 5,
97
+ },
98
+ // ====== Car Model ======
99
+ EMPTY_MODEL_NAME: {
100
+ key: 'EMPTY_MODEL_NAME',
101
+ uz: 'Model nomini kiritish majburiy!',
102
+ ru: 'Название модели обязательно!',
103
+ en: 'Model name is required!',
104
+ grpcCode: 3,
105
+ },
106
+ EMPTY_MANUFACTURER_ID: {
107
+ key: 'EMPTY_MANUFACTURER_ID',
108
+ uz: 'Ishlab chiqaruvchi ID sini kiritish majburiy!',
109
+ ru: 'ID производителя обязателен!',
110
+ en: 'Manufacturer ID is required!',
111
+ grpcCode: 3,
112
+ },
113
+ INVALID_MANUFACTURER_ID: {
114
+ key: 'INVALID_MANUFACTURER_ID',
115
+ uz: 'Ishlab chiqaruvchi ID si noto\'g\'ri formatda!',
116
+ ru: 'Неверный формат ID производителя!',
117
+ en: 'Invalid manufacturer ID format!',
118
+ grpcCode: 3,
119
+ },
120
+ MODEL_ALREADY_EXISTS: {
121
+ key: 'MODEL_ALREADY_EXISTS',
122
+ uz: 'Bu ishlab chiqaruvchida bunday model allaqachon mavjud!',
123
+ ru: 'Такая модель у этого производителя уже существует!',
124
+ en: 'This model already exists for this manufacturer!',
125
+ grpcCode: 6,
126
+ },
76
127
  };
@@ -0,0 +1 @@
1
+ export declare const carManufacturerProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.carManufacturerProtoPath = void 0;
4
+ exports.carManufacturerProtoPath = `${__dirname}/car-manufacturer.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const carManufacturerProtoPath = `${__dirname}/car-manufacturer.proto`;
@@ -0,0 +1,68 @@
1
+ syntax = "proto3";
2
+
3
+ package car_manufacturer;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+ service CarManufacturerService {
11
+ rpc CreateCarManufacturer (CreateCarManufacturerRequest) returns (CarManufacturerResponse);
12
+ rpc UpdateCarManufacturer (UpdateCarManufacturerRequest) returns (CarManufacturerResponse);
13
+ rpc DeleteCarManufacturer (common.IdRequest) returns (common.SuccessResponseResult);
14
+
15
+ // Public — id, name
16
+ rpc GetAllCarManufacturers (common.NoParams) returns (CarManufacturerPublicListResponse);
17
+
18
+ // Admin — full data
19
+ rpc GetAllCarManufacturersAdmin (common.NoParams) returns (CarManufacturerListResponse);
20
+ }
21
+
22
+ // ==========================================
23
+ // 2. REQUESTS
24
+ // ==========================================
25
+ message CreateCarManufacturerRequest {
26
+ string name = 1;
27
+ }
28
+
29
+ message UpdateCarManufacturerRequest {
30
+ string id = 1;
31
+ optional string name = 2;
32
+ }
33
+
34
+ // ==========================================
35
+ // 3. RESPONSES
36
+ // ==========================================
37
+
38
+ // Public — id, name
39
+ message CarManufacturerPublicData {
40
+ string id = 1;
41
+ string name = 2;
42
+ }
43
+
44
+ message CarManufacturerPublicListResponse {
45
+ int32 statusCode = 1;
46
+ string message = 2;
47
+ repeated CarManufacturerPublicData data = 3;
48
+ }
49
+
50
+ // Admin — full data
51
+ message CarManufacturerData {
52
+ string id = 1;
53
+ string name = 2;
54
+ bool isActive = 3;
55
+ string createdAt = 4;
56
+ }
57
+
58
+ message CarManufacturerResponse {
59
+ int32 statusCode = 1;
60
+ string message = 2;
61
+ CarManufacturerData data = 3;
62
+ }
63
+
64
+ message CarManufacturerListResponse {
65
+ int32 statusCode = 1;
66
+ string message = 2;
67
+ repeated CarManufacturerData data = 3;
68
+ }
@@ -0,0 +1 @@
1
+ export declare const carModelProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.carModelProtoPath = void 0;
4
+ exports.carModelProtoPath = `${__dirname}/car-model.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const carModelProtoPath = `${__dirname}/car-model.proto`;
@@ -0,0 +1,74 @@
1
+ syntax = "proto3";
2
+
3
+ package car_model;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+ service CarModelService {
11
+ rpc CreateCarModel (CreateCarModelRequest) returns (CarModelResponse);
12
+ rpc UpdateCarModel (UpdateCarModelRequest) returns (CarModelResponse);
13
+ rpc DeleteCarModel (common.IdRequest) returns (common.SuccessResponseResult);
14
+
15
+ // Public — manufacturer bo'yicha modellar
16
+ rpc GetCarModelsByManufacturer (common.IdRequest) returns (CarModelPublicListResponse);
17
+
18
+ // Admin — full data
19
+ rpc GetAllCarModelsAdmin (common.NoParams) returns (CarModelListResponse);
20
+ }
21
+
22
+ // ==========================================
23
+ // 2. REQUESTS
24
+ // ==========================================
25
+ message CreateCarModelRequest {
26
+ string name = 1;
27
+ string manufacturerId = 2;
28
+ }
29
+
30
+ message UpdateCarModelRequest {
31
+ string id = 1;
32
+ optional string name = 2;
33
+ optional string manufacturerId = 3;
34
+ }
35
+
36
+ // ==========================================
37
+ // 3. RESPONSES
38
+ // ==========================================
39
+
40
+ // Public — id, name, manufacturer info
41
+ message CarModelPublicData {
42
+ string id = 1;
43
+ string name = 2;
44
+ string manufacturerId = 3;
45
+ string manufacturerName = 4;
46
+ }
47
+
48
+ message CarModelPublicListResponse {
49
+ int32 statusCode = 1;
50
+ string message = 2;
51
+ repeated CarModelPublicData data = 3;
52
+ }
53
+
54
+ // Admin — full data
55
+ message CarModelData {
56
+ string id = 1;
57
+ string name = 2;
58
+ string manufacturerId = 3;
59
+ string manufacturerName = 4;
60
+ bool isActive = 5;
61
+ string createdAt = 6;
62
+ }
63
+
64
+ message CarModelResponse {
65
+ int32 statusCode = 1;
66
+ string message = 2;
67
+ CarModelData data = 3;
68
+ }
69
+
70
+ message CarModelListResponse {
71
+ int32 statusCode = 1;
72
+ string message = 2;
73
+ repeated CarModelData data = 3;
74
+ }
@@ -77,6 +77,7 @@ message SendOtpRequest {
77
77
  message VerifyOtpRequest {
78
78
  string phoneNumber = 1;
79
79
  int32 otp = 2;
80
+ optional string fcmToken = 3;
80
81
  }
81
82
 
82
83
  message SavePersonalRequest {
@@ -309,6 +310,7 @@ message DriverData {
309
310
  repeated DriverCarData cars = 19;
310
311
  optional string branchId = 20;
311
312
  optional float rating = 21;
313
+ optional string fcm_token = 22;
312
314
  }
313
315
 
314
316
  // Haydovchining hujjatlari (ID karta, selfi, haydovchilik guvohnomasi)
@@ -45,6 +45,7 @@ message UserData {
45
45
  optional string profilePhotoUrl = 14;
46
46
  optional string referralCode = 15;
47
47
  optional string referredById = 16;
48
+ optional string fcmToken = 17;
48
49
  }
49
50
 
50
51
  message Id{
@@ -70,6 +71,7 @@ message SendOtpRequest {
70
71
  message VerifyOtpRequest {
71
72
  string phoneNumber = 1;
72
73
  int32 otp = 2;
74
+ optional string fcmToken = 3;
73
75
  }
74
76
 
75
77
  message CreateUserRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devline-smart-taxi/common",
3
- "version": "2.3.34",
3
+ "version": "2.3.37",
4
4
  "description": "Reusable NestJS common library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",