@devline-smart-taxi/common 2.3.26 → 2.3.28

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/README.md CHANGED
@@ -1,18 +1,67 @@
1
- ## Common Package
1
+ # @devline-smart-taxi/common
2
2
 
3
- ### Ma\'lumot
4
- Bu `package` ga bir martadan ortiq service da qo\'llaniladigan class/interface/enum kabi code bloklari joylanadi.
3
+ ## Ma'lumot
5
4
 
6
- Yangi qo\'shimchalar kiritilgach quyidagicha `package` yangi versiyasi e\'lon qilinadi:
5
+ Bu `package` ga bir martadan ortiq service da qo'llaniladigan class/interface/enum kabi code bloklari joylanadi.
7
6
 
8
- `npm version patch`
7
+ ## O'rnatish
9
8
 
10
- `npm publish`
9
+ ```bash
10
+ npm install @devline-smart-taxi/common
11
+ ```
11
12
 
12
- Shunaqa ko'rinishda yangilanganligini bilishimiz mumkin bo`ladi:
13
+ Hech qanday token yoki `.npmrc` konfiguratsiya talab qilinmaydi — package npm registryda **public** holatda mavjud.
13
14
 
14
- ```+ @devline-smart-taxi/common@1.0.1```
15
+ ## Publishing (CI/CD)
15
16
 
17
+ Package **npm** va **GitHub Packages** registrylariga GitHub Actions orqali avtomatik publish qilinadi.
16
18
 
17
- ### O\'rnatish
18
- ```npm install @devline-smart-taxi/common```
19
+ ### Avtomatik publishing
20
+
21
+ Publishing faqat **Pull Request `dev` branchga merge bo'lganda** ishga tushadi. Workflow quyidagilarni bajaradi:
22
+
23
+ 1. Patch versionni avtomatik bump qiladi
24
+ 2. npm registryga publish qiladi
25
+ 3. GitHub Packages ga publish qiladi
26
+
27
+ > **Eslatma:** `dev` branchga to'g'ridan-to'g'ri push qilish publishing ni **ishga tushirmaydi**. Faqat PR merge va manual trigger ishlaydi.
28
+
29
+ ### Manual publishing
30
+
31
+ Publishingni qo'lda ham ishga tushirish mumkin:
32
+
33
+ 1. **Actions → Publish Package** ga o'ting
34
+ 2. **"Run workflow"** tugmasini bosing
35
+ 3. `dev` branchni tanlang
36
+ 4. **"Run workflow"** ni bosing
37
+
38
+ ### CI ni o'tkazib yuborish
39
+
40
+ Agar `dev` ga push qilayotganda publish workflow ishlamasligi kerak bo'lsa, commit message ga `[skip ci]` qo'shing:
41
+
42
+ ```bash
43
+ git commit -m "docs: readme yangilandi [skip ci]"
44
+ ```
45
+
46
+ ## Development
47
+
48
+ ### Build
49
+
50
+ ```bash
51
+ npm run build
52
+ ```
53
+
54
+ ### Versioning
55
+
56
+ Version bump CI/CD pipeline tomonidan avtomatik boshqariladi. Merge qilishdan oldin versiyani qo'lda o'zgartirish **shart emas**.
57
+
58
+ ## Project Structure
59
+
60
+ ```
61
+ src/
62
+ ├── decorators/ # Custom decoratorlar (roles, current user)
63
+ ├── dto/ # Umumiy DTOlar
64
+ ├── enums/ # Umumiy enumlar (roles, trip status, payment, va h.k.)
65
+ ├── prompt/ # Error prompt utilitylari
66
+ └── proto/ # Protobuf definitionlar va path helperlar
67
+ ```
@@ -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,98 @@
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
+ optional string image_url = 5;
33
+ }
34
+
35
+ message UpdateCarClassRequest {
36
+ string id = 1;
37
+ optional string name = 2;
38
+ optional string description = 3;
39
+ optional float basePrice = 4;
40
+ optional float pricePerKm = 5;
41
+ optional string image_url = 6;
42
+ }
43
+
44
+ // ==========================================
45
+ // 3. RESPONSES
46
+ // ==========================================
47
+
48
+ // Public — id, name va imageUrl
49
+ message CarClassPublicData {
50
+ string id = 1;
51
+ string name = 2;
52
+ optional string image_url = 3;
53
+ float basePrice = 4;
54
+ }
55
+
56
+ message CarClassPublicResponse {
57
+ int32 statusCode = 1;
58
+ string message = 2;
59
+ CarClassPublicData data = 3;
60
+ }
61
+
62
+ message CarClassPublicListResponse {
63
+ int32 statusCode = 1;
64
+ string message = 2;
65
+ repeated CarClassPublicData data = 3;
66
+ }
67
+
68
+ // Admin — to'liq data
69
+ message CarClassData {
70
+ string id = 1;
71
+ string name = 2;
72
+ string description = 3;
73
+ float basePrice = 4;
74
+ float pricePerKm = 5;
75
+ bool isActive = 6;
76
+ string createdAt = 7;
77
+ optional string image_url = 8;
78
+ }
79
+
80
+ message CarClassResponse {
81
+ int32 statusCode = 1;
82
+ string message = 2;
83
+ CarClassData data = 3;
84
+ }
85
+
86
+ message CarClassListResponse {
87
+ int32 statusCode = 1;
88
+ string message = 2;
89
+ repeated CarClassData data = 3;
90
+ }
91
+
92
+ // Service-to-service — narx ma'lumotlari
93
+ message CarClassPricingResponse {
94
+ int32 statusCode = 1;
95
+ string message = 2;
96
+ float basePrice = 3;
97
+ float pricePerKm = 4;
98
+ }
@@ -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.28",
4
4
  "description": "Reusable NestJS common library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,8 @@
24
24
  "typescript": "^5.9.3"
25
25
  },
26
26
  "publishConfig": {
27
- "registry": "https://npm.pkg.github.com"
27
+ "access": "public",
28
+ "registry": "https://registry.npmjs.org/"
28
29
  },
29
30
  "dependencies": {
30
31
  "@nestjs/mapped-types": "^2.1.0",