@devline-smart-taxi/common 2.3.26 → 2.3.27

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.
@@ -4,5 +4,6 @@ export declare class CreateTripDto {
4
4
  clientLongitude: number;
5
5
  destinationLatitude?: number;
6
6
  destinationLongitude?: number;
7
+ carClassId: string;
7
8
  paymentMethod: PaymentMethod;
8
9
  }
@@ -71,6 +71,15 @@ __decorate([
71
71
  (0, class_validator_1.Max)(180),
72
72
  __metadata("design:type", Number)
73
73
  ], CreateTripDto.prototype, "destinationLongitude", void 0);
74
+ __decorate([
75
+ (0, swagger_1.ApiProperty)({
76
+ description: 'Car class ID',
77
+ example: '550e8400-e29b-41d4-a716-446655440000',
78
+ }),
79
+ (0, class_validator_1.IsNotEmpty)(),
80
+ (0, class_validator_1.IsUUID)(),
81
+ __metadata("design:type", String)
82
+ ], CreateTripDto.prototype, "carClassId", void 0);
74
83
  __decorate([
75
84
  (0, swagger_1.ApiProperty)({
76
85
  description: 'Payment method',
package/dist/index.d.ts CHANGED
@@ -31,3 +31,4 @@ export * from './dto/withdraw-balance.dto';
31
31
  export * from './dto/get-transactions.dto';
32
32
  export * from './proto/balance-proto-path';
33
33
  export * from './proto/rating-proto-path';
34
+ export * from './proto/car-class-proto-path';
package/dist/index.js CHANGED
@@ -48,3 +48,4 @@ __exportStar(require("./dto/withdraw-balance.dto"), exports);
48
48
  __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
+ __exportStar(require("./proto/car-class-proto-path"), exports);
@@ -0,0 +1 @@
1
+ export declare const carClassProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.carClassProtoPath = void 0;
4
+ exports.carClassProtoPath = `${__dirname}/car-class.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const carClassProtoPath = `${__dirname}/car-class.proto`;
@@ -0,0 +1,93 @@
1
+ syntax = "proto3";
2
+
3
+ package car_class;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+ service CarClassService {
11
+ rpc CreateCarClass (CreateCarClassRequest) returns (CarClassResponse);
12
+ rpc UpdateCarClass (UpdateCarClassRequest) returns (CarClassResponse);
13
+ rpc DeleteCarClass (common.IdRequest) returns (common.SuccessResponseResult);
14
+ // Public — faqat name qaytadi
15
+ rpc GetAllCarClasses (common.NoParams) returns (CarClassPublicListResponse);
16
+ rpc GetCarClassById (common.IdRequest) returns (CarClassPublicResponse);
17
+ // Admin — to'liq data
18
+ rpc GetAllCarClassesAdmin (common.NoParams) returns (CarClassListResponse);
19
+ rpc GetCarClassByIdAdmin (common.IdRequest) returns (CarClassResponse);
20
+ // Service-to-service — narx olish (ServiceOnly)
21
+ rpc GetCarClassPricing (common.IdRequest) returns (CarClassPricingResponse);
22
+ }
23
+
24
+ // ==========================================
25
+ // 2. REQUESTS
26
+ // ==========================================
27
+ message CreateCarClassRequest {
28
+ string name = 1;
29
+ string description = 2;
30
+ float basePrice = 3;
31
+ float pricePerKm = 4;
32
+ }
33
+
34
+ message UpdateCarClassRequest {
35
+ string id = 1;
36
+ optional string name = 2;
37
+ optional string description = 3;
38
+ optional float basePrice = 4;
39
+ optional float pricePerKm = 5;
40
+ }
41
+
42
+ // ==========================================
43
+ // 3. RESPONSES
44
+ // ==========================================
45
+
46
+ // Public — faqat id va name
47
+ message CarClassPublicData {
48
+ string id = 1;
49
+ string name = 2;
50
+ }
51
+
52
+ message CarClassPublicResponse {
53
+ int32 statusCode = 1;
54
+ string message = 2;
55
+ CarClassPublicData data = 3;
56
+ }
57
+
58
+ message CarClassPublicListResponse {
59
+ int32 statusCode = 1;
60
+ string message = 2;
61
+ repeated CarClassPublicData data = 3;
62
+ }
63
+
64
+ // Admin — to'liq data
65
+ message CarClassData {
66
+ string id = 1;
67
+ string name = 2;
68
+ string description = 3;
69
+ float basePrice = 4;
70
+ float pricePerKm = 5;
71
+ bool isActive = 6;
72
+ string createdAt = 7;
73
+ }
74
+
75
+ message CarClassResponse {
76
+ int32 statusCode = 1;
77
+ string message = 2;
78
+ CarClassData data = 3;
79
+ }
80
+
81
+ message CarClassListResponse {
82
+ int32 statusCode = 1;
83
+ string message = 2;
84
+ repeated CarClassData data = 3;
85
+ }
86
+
87
+ // Service-to-service — narx ma'lumotlari
88
+ message CarClassPricingResponse {
89
+ int32 statusCode = 1;
90
+ string message = 2;
91
+ float basePrice = 3;
92
+ float pricePerKm = 4;
93
+ }
@@ -21,6 +21,7 @@ message SearchNearbyDriversRequest {
21
21
  double lng = 2; // Longitude (-180 dan 180 gacha)
22
22
  optional int32 limit = 3; // Max natijalar soni (default: 10, max: 50)
23
23
  optional double radius_km = 4; // Qidiruv radiusi km da (default: 5, max: 100)
24
+ optional string car_class_id = 5; // CarClass bo'yicha filter
24
25
  }
25
26
 
26
27
  message NearbyDriver {
@@ -53,6 +53,7 @@ message CreateTripRequest {
53
53
  optional float destinationLatitude = 5;
54
54
  optional float destinationLongitude = 6;
55
55
  string paymentMethod = 7;
56
+ string carClassId = 8;
56
57
  }
57
58
 
58
59
  message TripActionRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devline-smart-taxi/common",
3
- "version": "2.3.26",
3
+ "version": "2.3.27",
4
4
  "description": "Reusable NestJS common library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",