@devline-smart-taxi/common 2.3.31 → 2.3.32

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/dist/index.d.ts CHANGED
@@ -32,3 +32,5 @@ 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/wallet-proto-path';
36
+ export * from './proto/bonus-campaign-proto-path';
package/dist/index.js CHANGED
@@ -49,3 +49,5 @@ __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/wallet-proto-path"), exports);
53
+ __exportStar(require("./proto/bonus-campaign-proto-path"), exports);
@@ -0,0 +1 @@
1
+ export declare const bonusCampaignProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bonusCampaignProtoPath = void 0;
4
+ exports.bonusCampaignProtoPath = `${__dirname}/bonus_campaign.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const bonusCampaignProtoPath = `${__dirname}/bonus_campaign.proto`;
@@ -0,0 +1,97 @@
1
+ syntax = "proto3";
2
+
3
+ package bonus_campaign;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+
11
+ service BonusCampaignService {
12
+ rpc CreateCampaign (CreateCampaignRequest) returns (CampaignResponse);
13
+ rpc UpdateCampaign (UpdateCampaignRequest) returns (CampaignResponse);
14
+ rpc GetCampaignById (GetCampaignByIdRequest) returns (CampaignResponse);
15
+ rpc GetAllCampaigns (GetAllCampaignsRequest) returns (CampaignListResponse);
16
+ rpc DeleteCampaign (DeleteCampaignRequest) returns (common.SuccessResponseResult);
17
+ }
18
+
19
+ // ==========================================
20
+ // 2. COMMON MESSAGES
21
+ // ==========================================
22
+
23
+ enum CampaignType {
24
+ CAMPAIGN_TYPE_UNSPECIFIED = 0;
25
+ REFERRAL = 1;
26
+ TRIP_COUNT = 2;
27
+ PROMO_CODE = 3;
28
+ }
29
+
30
+ message CampaignData {
31
+ string id = 1;
32
+ string type = 2; // REFERRAL, TRIP_COUNT, PROMO_CODE
33
+ float amount = 3;
34
+ optional string promoCodeString = 4;
35
+ optional string startDate = 5;
36
+ optional string endDate = 6;
37
+ bool isActive = 7;
38
+ string createdAt = 8;
39
+ optional string updatedAt = 9;
40
+ }
41
+
42
+ // ==========================================
43
+ // 3. REQUESTS
44
+ // ==========================================
45
+
46
+ message CreateCampaignRequest {
47
+ string type = 1;
48
+ float amount = 2;
49
+ optional string promoCodeString = 3;
50
+ optional string startDate = 4;
51
+ optional string endDate = 5;
52
+ bool isActive = 6;
53
+ }
54
+
55
+ message UpdateCampaignRequest {
56
+ string id = 1;
57
+ optional string type = 2;
58
+ optional float amount = 3;
59
+ optional string promoCodeString = 4;
60
+ optional string startDate = 5;
61
+ optional string endDate = 6;
62
+ optional bool isActive = 7;
63
+ }
64
+
65
+ message GetCampaignByIdRequest {
66
+ string id = 1;
67
+ }
68
+
69
+ message GetAllCampaignsRequest {
70
+ int32 page = 1;
71
+ int32 limit = 2;
72
+ optional string type = 3;
73
+ optional bool isActive = 4;
74
+ }
75
+
76
+ message DeleteCampaignRequest {
77
+ string id = 1;
78
+ }
79
+
80
+ // ==========================================
81
+ // 4. RESPONSES
82
+ // ==========================================
83
+
84
+ message CampaignResponse {
85
+ int32 statusCode = 1;
86
+ string message = 2;
87
+ CampaignData data = 3;
88
+ }
89
+
90
+ message CampaignListResponse {
91
+ repeated CampaignData data = 1;
92
+ int32 total = 2;
93
+ int32 page = 3;
94
+ int32 limit = 4;
95
+ int32 statusCode = 5;
96
+ string message = 6;
97
+ }
@@ -54,6 +54,7 @@ message CreateTripRequest {
54
54
  optional float destinationLongitude = 6;
55
55
  string paymentMethod = 7;
56
56
  string carClassId = 8;
57
+ optional bool useBonuses = 9;
57
58
  }
58
59
 
59
60
  message TripActionRequest {
@@ -42,6 +42,8 @@ message UserData {
42
42
  bool hasDataConsent = 12;
43
43
  bool isBlocked = 13;
44
44
  optional string profilePhotoUrl = 14;
45
+ optional string referralCode = 15;
46
+ optional string referredById = 16;
45
47
  }
46
48
 
47
49
  message Id{
@@ -0,0 +1 @@
1
+ export declare const walletProtoPath: string;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.walletProtoPath = void 0;
4
+ exports.walletProtoPath = `${__dirname}/wallet.proto`;
@@ -0,0 +1,3 @@
1
+ declare const __dirname: string;
2
+
3
+ export const walletProtoPath = `${__dirname}/wallet.proto`;
@@ -0,0 +1,54 @@
1
+ syntax = "proto3";
2
+
3
+ package wallet;
4
+
5
+ import "common.proto";
6
+
7
+ // ==========================================
8
+ // 1. SERVICES
9
+ // ==========================================
10
+
11
+ service WalletService {
12
+ rpc GetMyWallet (GetMyWalletRequest) returns (WalletResponse);
13
+ rpc ApplyReferralCode (ApplyReferralCodeRequest) returns (common.SuccessResponseResult);
14
+ }
15
+
16
+ // ==========================================
17
+ // 2. COMMON MESSAGES
18
+ // ==========================================
19
+
20
+ message WalletTransactionData {
21
+ string id = 1;
22
+ float amount = 2;
23
+ string type = 3; // e.g. REFERRAL_BONUS, TRIP_PAYMENT, 5_TRIPS_BONUS
24
+ string description = 4;
25
+ string createdAt = 5;
26
+ }
27
+
28
+ message WalletData {
29
+ float balance = 1;
30
+ repeated WalletTransactionData transactions = 2;
31
+ }
32
+
33
+ // ==========================================
34
+ // 3. REQUESTS
35
+ // ==========================================
36
+
37
+ message GetMyWalletRequest {
38
+ string clientId = 1;
39
+ }
40
+
41
+ message ApplyReferralCodeRequest {
42
+ string clientId = 1;
43
+ string referralCode = 2;
44
+ }
45
+
46
+ // ==========================================
47
+ // 4. RESPONSES
48
+ // ==========================================
49
+
50
+ message WalletResponse {
51
+ int32 statusCode = 1;
52
+ string message = 2;
53
+ WalletData data = 3;
54
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devline-smart-taxi/common",
3
- "version": "2.3.31",
3
+ "version": "2.3.32",
4
4
  "description": "Reusable NestJS common library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",