@stashfin/grpc 1.2.216 → 1.2.219

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/ts/growth.js CHANGED
@@ -8,6 +8,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.growthClient = exports.growthService = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const grpc_js_1 = require("@grpc/grpc-js");
11
+ const checkplanstatus_1 = require("./growth/checkplanstatus");
12
+ const getattachplandetails_1 = require("./growth/getattachplandetails");
13
+ const getchrplans_1 = require("./growth/getchrplans");
14
+ const getcredithealthreport_1 = require("./growth/getcredithealthreport");
15
+ const initiatepayment_1 = require("./growth/initiatepayment");
11
16
  const processchrpayment_1 = require("./growth/processchrpayment");
12
17
  exports.protobufPackage = "service";
13
18
  exports.growthService = {
@@ -15,10 +20,55 @@ exports.growthService = {
15
20
  path: "/service.growth/processchrpayment",
16
21
  requestStream: false,
17
22
  responseStream: false,
18
- requestSerialize: (value) => Buffer.from(processchrpayment_1.request.encode(value).finish()),
19
- requestDeserialize: (value) => processchrpayment_1.request.decode(value),
20
- responseSerialize: (value) => Buffer.from(processchrpayment_1.response.encode(value).finish()),
21
- responseDeserialize: (value) => processchrpayment_1.response.decode(value),
23
+ requestSerialize: (value) => Buffer.from(processchrpayment_1.processchrrequest.encode(value).finish()),
24
+ requestDeserialize: (value) => processchrpayment_1.processchrrequest.decode(value),
25
+ responseSerialize: (value) => Buffer.from(processchrpayment_1.processchrresponse.encode(value).finish()),
26
+ responseDeserialize: (value) => processchrpayment_1.processchrresponse.decode(value),
27
+ },
28
+ checkplanstatus: {
29
+ path: "/service.growth/checkplanstatus",
30
+ requestStream: false,
31
+ responseStream: false,
32
+ requestSerialize: (value) => Buffer.from(checkplanstatus_1.chrplansstatusrequest.encode(value).finish()),
33
+ requestDeserialize: (value) => checkplanstatus_1.chrplansstatusrequest.decode(value),
34
+ responseSerialize: (value) => Buffer.from(checkplanstatus_1.chrplanstatusresponse.encode(value).finish()),
35
+ responseDeserialize: (value) => checkplanstatus_1.chrplanstatusresponse.decode(value),
36
+ },
37
+ getattachplandetails: {
38
+ path: "/service.growth/getattachplandetails",
39
+ requestStream: false,
40
+ responseStream: false,
41
+ requestSerialize: (value) => Buffer.from(getattachplandetails_1.chrattachplanrequest.encode(value).finish()),
42
+ requestDeserialize: (value) => getattachplandetails_1.chrattachplanrequest.decode(value),
43
+ responseSerialize: (value) => Buffer.from(getattachplandetails_1.chrattachplanresponse.encode(value).finish()),
44
+ responseDeserialize: (value) => getattachplandetails_1.chrattachplanresponse.decode(value),
45
+ },
46
+ getchrplans: {
47
+ path: "/service.growth/getchrplans",
48
+ requestStream: false,
49
+ responseStream: false,
50
+ requestSerialize: (value) => Buffer.from(getchrplans_1.chrplansrequest.encode(value).finish()),
51
+ requestDeserialize: (value) => getchrplans_1.chrplansrequest.decode(value),
52
+ responseSerialize: (value) => Buffer.from(getchrplans_1.chrplansresponse.encode(value).finish()),
53
+ responseDeserialize: (value) => getchrplans_1.chrplansresponse.decode(value),
54
+ },
55
+ getcredithealthreport: {
56
+ path: "/service.growth/getcredithealthreport",
57
+ requestStream: false,
58
+ responseStream: false,
59
+ requestSerialize: (value) => Buffer.from(getcredithealthreport_1.credithealthreportrequest.encode(value).finish()),
60
+ requestDeserialize: (value) => getcredithealthreport_1.credithealthreportrequest.decode(value),
61
+ responseSerialize: (value) => Buffer.from(getcredithealthreport_1.credithealthreportresponse.encode(value).finish()),
62
+ responseDeserialize: (value) => getcredithealthreport_1.credithealthreportresponse.decode(value),
63
+ },
64
+ initiatepayment: {
65
+ path: "/service.growth/initiatepayment",
66
+ requestStream: false,
67
+ responseStream: false,
68
+ requestSerialize: (value) => Buffer.from(initiatepayment_1.initiatepaymentrequest.encode(value).finish()),
69
+ requestDeserialize: (value) => initiatepayment_1.initiatepaymentrequest.decode(value),
70
+ responseSerialize: (value) => Buffer.from(initiatepayment_1.initiatepaymentresponse.encode(value).finish()),
71
+ responseDeserialize: (value) => initiatepayment_1.initiatepaymentresponse.decode(value),
22
72
  },
23
73
  };
24
74
  exports.growthClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.growthService, "service.growth");
@@ -8,6 +8,8 @@ export interface approveLoanRequest {
8
8
  ip: string;
9
9
  addons: number;
10
10
  addonsData: approveLoanRequest_Field[];
11
+ latitude: number;
12
+ longitude: number;
11
13
  }
12
14
  export interface approveLoanRequest_Field {
13
15
  name: string;
@@ -43,6 +45,7 @@ export interface approveLoanResponse {
43
45
  credit_report_fees: number;
44
46
  credit_report_actual_fees: number;
45
47
  plan_id: number;
48
+ approved_amount: number;
46
49
  }
47
50
  export declare const approveLoanRequest: {
48
51
  encode(message: approveLoanRequest, writer?: _m0.Writer): _m0.Writer;
@@ -13,7 +13,17 @@ exports.approveLoanResponse = exports.approveLoanRequest_Field = exports.approve
13
13
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
14
14
  exports.protobufPackage = "loans.approveloan";
15
15
  function createBaseapproveLoanRequest() {
16
- return { bank_id: 0, amount: 0, tenure: 0, customer_id: 0, ip: "", addons: 0, addonsData: [] };
16
+ return {
17
+ bank_id: 0,
18
+ amount: 0,
19
+ tenure: 0,
20
+ customer_id: 0,
21
+ ip: "",
22
+ addons: 0,
23
+ addonsData: [],
24
+ latitude: 0,
25
+ longitude: 0,
26
+ };
17
27
  }
18
28
  exports.approveLoanRequest = {
19
29
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -38,6 +48,12 @@ exports.approveLoanRequest = {
38
48
  for (const v of message.addonsData) {
39
49
  exports.approveLoanRequest_Field.encode(v, writer.uint32(58).fork()).ldelim();
40
50
  }
51
+ if (message.latitude !== 0) {
52
+ writer.uint32(69).float(message.latitude);
53
+ }
54
+ if (message.longitude !== 0) {
55
+ writer.uint32(77).float(message.longitude);
56
+ }
41
57
  return writer;
42
58
  },
43
59
  decode(input, length) {
@@ -89,6 +105,18 @@ exports.approveLoanRequest = {
89
105
  }
90
106
  message.addonsData.push(exports.approveLoanRequest_Field.decode(reader, reader.uint32()));
91
107
  continue;
108
+ case 8:
109
+ if (tag !== 69) {
110
+ break;
111
+ }
112
+ message.latitude = reader.float();
113
+ continue;
114
+ case 9:
115
+ if (tag !== 77) {
116
+ break;
117
+ }
118
+ message.longitude = reader.float();
119
+ continue;
92
120
  }
93
121
  if ((tag & 7) === 4 || tag === 0) {
94
122
  break;
@@ -108,6 +136,8 @@ exports.approveLoanRequest = {
108
136
  addonsData: globalThis.Array.isArray(object?.addonsData)
109
137
  ? object.addonsData.map((e) => exports.approveLoanRequest_Field.fromJSON(e))
110
138
  : [],
139
+ latitude: isSet(object.latitude) ? globalThis.Number(object.latitude) : 0,
140
+ longitude: isSet(object.longitude) ? globalThis.Number(object.longitude) : 0,
111
141
  };
112
142
  },
113
143
  toJSON(message) {
@@ -133,6 +163,12 @@ exports.approveLoanRequest = {
133
163
  if (message.addonsData?.length) {
134
164
  obj.addonsData = message.addonsData.map((e) => exports.approveLoanRequest_Field.toJSON(e));
135
165
  }
166
+ if (message.latitude !== 0) {
167
+ obj.latitude = message.latitude;
168
+ }
169
+ if (message.longitude !== 0) {
170
+ obj.longitude = message.longitude;
171
+ }
136
172
  return obj;
137
173
  },
138
174
  create(base) {
@@ -147,6 +183,8 @@ exports.approveLoanRequest = {
147
183
  message.ip = object.ip ?? "";
148
184
  message.addons = object.addons ?? 0;
149
185
  message.addonsData = object.addonsData?.map((e) => exports.approveLoanRequest_Field.fromPartial(e)) || [];
186
+ message.latitude = object.latitude ?? 0;
187
+ message.longitude = object.longitude ?? 0;
150
188
  return message;
151
189
  },
152
190
  };
@@ -247,6 +285,7 @@ function createBaseapproveLoanResponse() {
247
285
  credit_report_fees: 0,
248
286
  credit_report_actual_fees: 0,
249
287
  plan_id: 0,
288
+ approved_amount: 0,
250
289
  };
251
290
  }
252
291
  exports.approveLoanResponse = {
@@ -338,6 +377,9 @@ exports.approveLoanResponse = {
338
377
  if (message.plan_id !== 0) {
339
378
  writer.uint32(232).int32(message.plan_id);
340
379
  }
380
+ if (message.approved_amount !== 0) {
381
+ writer.uint32(240).int32(message.approved_amount);
382
+ }
341
383
  return writer;
342
384
  },
343
385
  decode(input, length) {
@@ -521,6 +563,12 @@ exports.approveLoanResponse = {
521
563
  }
522
564
  message.plan_id = reader.int32();
523
565
  continue;
566
+ case 30:
567
+ if (tag !== 240) {
568
+ break;
569
+ }
570
+ message.approved_amount = reader.int32();
571
+ continue;
524
572
  }
525
573
  if ((tag & 7) === 4 || tag === 0) {
526
574
  break;
@@ -568,6 +616,7 @@ exports.approveLoanResponse = {
568
616
  ? globalThis.Number(object.credit_report_actual_fees)
569
617
  : 0,
570
618
  plan_id: isSet(object.plan_id) ? globalThis.Number(object.plan_id) : 0,
619
+ approved_amount: isSet(object.approved_amount) ? globalThis.Number(object.approved_amount) : 0,
571
620
  };
572
621
  },
573
622
  toJSON(message) {
@@ -659,6 +708,9 @@ exports.approveLoanResponse = {
659
708
  if (message.plan_id !== 0) {
660
709
  obj.plan_id = Math.round(message.plan_id);
661
710
  }
711
+ if (message.approved_amount !== 0) {
712
+ obj.approved_amount = Math.round(message.approved_amount);
713
+ }
662
714
  return obj;
663
715
  },
664
716
  create(base) {
@@ -695,6 +747,7 @@ exports.approveLoanResponse = {
695
747
  message.credit_report_fees = object.credit_report_fees ?? 0;
696
748
  message.credit_report_actual_fees = object.credit_report_actual_fees ?? 0;
697
749
  message.plan_id = object.plan_id ?? 0;
750
+ message.approved_amount = object.approved_amount ?? 0;
698
751
  return message;
699
752
  },
700
753
  };
@@ -36,6 +36,7 @@ export interface loanSummaryResponse {
36
36
  credit_report_fees: number;
37
37
  credit_report_actual_fees: number;
38
38
  plan_id: number;
39
+ approved_amount: number;
39
40
  }
40
41
  export declare const loanSummaryRequest: {
41
42
  encode(message: loanSummaryRequest, writer?: _m0.Writer): _m0.Writer;
@@ -137,6 +137,7 @@ function createBaseloanSummaryResponse() {
137
137
  credit_report_fees: 0,
138
138
  credit_report_actual_fees: 0,
139
139
  plan_id: 0,
140
+ approved_amount: 0,
140
141
  };
141
142
  }
142
143
  exports.loanSummaryResponse = {
@@ -228,6 +229,9 @@ exports.loanSummaryResponse = {
228
229
  if (message.plan_id !== 0) {
229
230
  writer.uint32(232).int32(message.plan_id);
230
231
  }
232
+ if (message.approved_amount !== 0) {
233
+ writer.uint32(240).int32(message.approved_amount);
234
+ }
231
235
  return writer;
232
236
  },
233
237
  decode(input, length) {
@@ -411,6 +415,12 @@ exports.loanSummaryResponse = {
411
415
  }
412
416
  message.plan_id = reader.int32();
413
417
  continue;
418
+ case 30:
419
+ if (tag !== 240) {
420
+ break;
421
+ }
422
+ message.approved_amount = reader.int32();
423
+ continue;
414
424
  }
415
425
  if ((tag & 7) === 4 || tag === 0) {
416
426
  break;
@@ -458,6 +468,7 @@ exports.loanSummaryResponse = {
458
468
  ? globalThis.Number(object.credit_report_actual_fees)
459
469
  : 0,
460
470
  plan_id: isSet(object.plan_id) ? globalThis.Number(object.plan_id) : 0,
471
+ approved_amount: isSet(object.approved_amount) ? globalThis.Number(object.approved_amount) : 0,
461
472
  };
462
473
  },
463
474
  toJSON(message) {
@@ -549,6 +560,9 @@ exports.loanSummaryResponse = {
549
560
  if (message.plan_id !== 0) {
550
561
  obj.plan_id = Math.round(message.plan_id);
551
562
  }
563
+ if (message.approved_amount !== 0) {
564
+ obj.approved_amount = Math.round(message.approved_amount);
565
+ }
552
566
  return obj;
553
567
  },
554
568
  create(base) {
@@ -585,6 +599,7 @@ exports.loanSummaryResponse = {
585
599
  message.credit_report_fees = object.credit_report_fees ?? 0;
586
600
  message.credit_report_actual_fees = object.credit_report_actual_fees ?? 0;
587
601
  message.plan_id = object.plan_id ?? 0;
602
+ message.approved_amount = object.approved_amount ?? 0;
588
603
  return message;
589
604
  },
590
605
  };
@@ -0,0 +1,39 @@
1
+ import _m0 from "protobufjs/minimal";
2
+ export declare const protobufPackage = "loans.refund";
3
+ export interface refundRequest {
4
+ amount: number;
5
+ customerid: number;
6
+ loan_id: number;
7
+ payment_id: number;
8
+ mode: string;
9
+ }
10
+ export interface refundResponse {
11
+ message: string;
12
+ }
13
+ export declare const refundRequest: {
14
+ encode(message: refundRequest, writer?: _m0.Writer): _m0.Writer;
15
+ decode(input: _m0.Reader | Uint8Array, length?: number): refundRequest;
16
+ fromJSON(object: any): refundRequest;
17
+ toJSON(message: refundRequest): unknown;
18
+ create<I extends Exact<DeepPartial<refundRequest>, I>>(base?: I): refundRequest;
19
+ fromPartial<I extends Exact<DeepPartial<refundRequest>, I>>(object: I): refundRequest;
20
+ };
21
+ export declare const refundResponse: {
22
+ encode(message: refundResponse, writer?: _m0.Writer): _m0.Writer;
23
+ decode(input: _m0.Reader | Uint8Array, length?: number): refundResponse;
24
+ fromJSON(object: any): refundResponse;
25
+ toJSON(message: refundResponse): unknown;
26
+ create<I extends Exact<DeepPartial<refundResponse>, I>>(base?: I): refundResponse;
27
+ fromPartial<I extends Exact<DeepPartial<refundResponse>, I>>(object: I): refundResponse;
28
+ };
29
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
30
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
31
+ [K in keyof T]?: DeepPartial<T[K]>;
32
+ } : Partial<T>;
33
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
34
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
35
+ [K in keyof P]: Exact<P[K], I[K]>;
36
+ } & {
37
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
38
+ };
39
+ export {};
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.0
5
+ // protoc v5.28.0
6
+ // source: loans/refund.proto
7
+ var __importDefault = (this && this.__importDefault) || function (mod) {
8
+ return (mod && mod.__esModule) ? mod : { "default": mod };
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.refundResponse = exports.refundRequest = exports.protobufPackage = void 0;
12
+ /* eslint-disable */
13
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
14
+ exports.protobufPackage = "loans.refund";
15
+ function createBaserefundRequest() {
16
+ return { amount: 0, customerid: 0, loan_id: 0, payment_id: 0, mode: "" };
17
+ }
18
+ exports.refundRequest = {
19
+ encode(message, writer = minimal_1.default.Writer.create()) {
20
+ if (message.amount !== 0) {
21
+ writer.uint32(8).int32(message.amount);
22
+ }
23
+ if (message.customerid !== 0) {
24
+ writer.uint32(16).int32(message.customerid);
25
+ }
26
+ if (message.loan_id !== 0) {
27
+ writer.uint32(24).int32(message.loan_id);
28
+ }
29
+ if (message.payment_id !== 0) {
30
+ writer.uint32(32).int32(message.payment_id);
31
+ }
32
+ if (message.mode !== "") {
33
+ writer.uint32(42).string(message.mode);
34
+ }
35
+ return writer;
36
+ },
37
+ decode(input, length) {
38
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
39
+ let end = length === undefined ? reader.len : reader.pos + length;
40
+ const message = createBaserefundRequest();
41
+ while (reader.pos < end) {
42
+ const tag = reader.uint32();
43
+ switch (tag >>> 3) {
44
+ case 1:
45
+ if (tag !== 8) {
46
+ break;
47
+ }
48
+ message.amount = reader.int32();
49
+ continue;
50
+ case 2:
51
+ if (tag !== 16) {
52
+ break;
53
+ }
54
+ message.customerid = reader.int32();
55
+ continue;
56
+ case 3:
57
+ if (tag !== 24) {
58
+ break;
59
+ }
60
+ message.loan_id = reader.int32();
61
+ continue;
62
+ case 4:
63
+ if (tag !== 32) {
64
+ break;
65
+ }
66
+ message.payment_id = reader.int32();
67
+ continue;
68
+ case 5:
69
+ if (tag !== 42) {
70
+ break;
71
+ }
72
+ message.mode = reader.string();
73
+ continue;
74
+ }
75
+ if ((tag & 7) === 4 || tag === 0) {
76
+ break;
77
+ }
78
+ reader.skipType(tag & 7);
79
+ }
80
+ return message;
81
+ },
82
+ fromJSON(object) {
83
+ return {
84
+ amount: isSet(object.amount) ? globalThis.Number(object.amount) : 0,
85
+ customerid: isSet(object.customerid) ? globalThis.Number(object.customerid) : 0,
86
+ loan_id: isSet(object.loan_id) ? globalThis.Number(object.loan_id) : 0,
87
+ payment_id: isSet(object.payment_id) ? globalThis.Number(object.payment_id) : 0,
88
+ mode: isSet(object.mode) ? globalThis.String(object.mode) : "",
89
+ };
90
+ },
91
+ toJSON(message) {
92
+ const obj = {};
93
+ if (message.amount !== 0) {
94
+ obj.amount = Math.round(message.amount);
95
+ }
96
+ if (message.customerid !== 0) {
97
+ obj.customerid = Math.round(message.customerid);
98
+ }
99
+ if (message.loan_id !== 0) {
100
+ obj.loan_id = Math.round(message.loan_id);
101
+ }
102
+ if (message.payment_id !== 0) {
103
+ obj.payment_id = Math.round(message.payment_id);
104
+ }
105
+ if (message.mode !== "") {
106
+ obj.mode = message.mode;
107
+ }
108
+ return obj;
109
+ },
110
+ create(base) {
111
+ return exports.refundRequest.fromPartial(base ?? {});
112
+ },
113
+ fromPartial(object) {
114
+ const message = createBaserefundRequest();
115
+ message.amount = object.amount ?? 0;
116
+ message.customerid = object.customerid ?? 0;
117
+ message.loan_id = object.loan_id ?? 0;
118
+ message.payment_id = object.payment_id ?? 0;
119
+ message.mode = object.mode ?? "";
120
+ return message;
121
+ },
122
+ };
123
+ function createBaserefundResponse() {
124
+ return { message: "" };
125
+ }
126
+ exports.refundResponse = {
127
+ encode(message, writer = minimal_1.default.Writer.create()) {
128
+ if (message.message !== "") {
129
+ writer.uint32(10).string(message.message);
130
+ }
131
+ return writer;
132
+ },
133
+ decode(input, length) {
134
+ const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
135
+ let end = length === undefined ? reader.len : reader.pos + length;
136
+ const message = createBaserefundResponse();
137
+ while (reader.pos < end) {
138
+ const tag = reader.uint32();
139
+ switch (tag >>> 3) {
140
+ case 1:
141
+ if (tag !== 10) {
142
+ break;
143
+ }
144
+ message.message = reader.string();
145
+ continue;
146
+ }
147
+ if ((tag & 7) === 4 || tag === 0) {
148
+ break;
149
+ }
150
+ reader.skipType(tag & 7);
151
+ }
152
+ return message;
153
+ },
154
+ fromJSON(object) {
155
+ return { message: isSet(object.message) ? globalThis.String(object.message) : "" };
156
+ },
157
+ toJSON(message) {
158
+ const obj = {};
159
+ if (message.message !== "") {
160
+ obj.message = message.message;
161
+ }
162
+ return obj;
163
+ },
164
+ create(base) {
165
+ return exports.refundResponse.fromPartial(base ?? {});
166
+ },
167
+ fromPartial(object) {
168
+ const message = createBaserefundResponse();
169
+ message.message = object.message ?? "";
170
+ return message;
171
+ },
172
+ };
173
+ function isSet(value) {
174
+ return value !== null && value !== undefined;
175
+ }
@@ -1,7 +1,7 @@
1
1
  import _m0 from "protobufjs/minimal";
2
2
  export declare const protobufPackage = "loans.restructureloan";
3
3
  export interface restructureLoanRequest {
4
- loan_id: number;
4
+ loan_id: number[];
5
5
  tenure: number;
6
6
  }
7
7
  export interface restructureLoanResponse {
@@ -13,13 +13,15 @@ exports.restructureLoanResponse = exports.restructureLoanRequest = exports.proto
13
13
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
14
14
  exports.protobufPackage = "loans.restructureloan";
15
15
  function createBaserestructureLoanRequest() {
16
- return { loan_id: 0, tenure: 0 };
16
+ return { loan_id: [], tenure: 0 };
17
17
  }
18
18
  exports.restructureLoanRequest = {
19
19
  encode(message, writer = minimal_1.default.Writer.create()) {
20
- if (message.loan_id !== 0) {
21
- writer.uint32(8).int32(message.loan_id);
20
+ writer.uint32(10).fork();
21
+ for (const v of message.loan_id) {
22
+ writer.int32(v);
22
23
  }
24
+ writer.ldelim();
23
25
  if (message.tenure !== 0) {
24
26
  writer.uint32(16).int32(message.tenure);
25
27
  }
@@ -33,11 +35,18 @@ exports.restructureLoanRequest = {
33
35
  const tag = reader.uint32();
34
36
  switch (tag >>> 3) {
35
37
  case 1:
36
- if (tag !== 8) {
37
- break;
38
+ if (tag === 8) {
39
+ message.loan_id.push(reader.int32());
40
+ continue;
38
41
  }
39
- message.loan_id = reader.int32();
40
- continue;
42
+ if (tag === 10) {
43
+ const end2 = reader.uint32() + reader.pos;
44
+ while (reader.pos < end2) {
45
+ message.loan_id.push(reader.int32());
46
+ }
47
+ continue;
48
+ }
49
+ break;
41
50
  case 2:
42
51
  if (tag !== 16) {
43
52
  break;
@@ -54,14 +63,14 @@ exports.restructureLoanRequest = {
54
63
  },
55
64
  fromJSON(object) {
56
65
  return {
57
- loan_id: isSet(object.loan_id) ? globalThis.Number(object.loan_id) : 0,
66
+ loan_id: globalThis.Array.isArray(object?.loan_id) ? object.loan_id.map((e) => globalThis.Number(e)) : [],
58
67
  tenure: isSet(object.tenure) ? globalThis.Number(object.tenure) : 0,
59
68
  };
60
69
  },
61
70
  toJSON(message) {
62
71
  const obj = {};
63
- if (message.loan_id !== 0) {
64
- obj.loan_id = Math.round(message.loan_id);
72
+ if (message.loan_id?.length) {
73
+ obj.loan_id = message.loan_id.map((e) => Math.round(e));
65
74
  }
66
75
  if (message.tenure !== 0) {
67
76
  obj.tenure = Math.round(message.tenure);
@@ -73,7 +82,7 @@ exports.restructureLoanRequest = {
73
82
  },
74
83
  fromPartial(object) {
75
84
  const message = createBaserestructureLoanRequest();
76
- message.loan_id = object.loan_id ?? 0;
85
+ message.loan_id = object.loan_id?.map((e) => e) || [];
77
86
  message.tenure = object.tenure ?? 0;
78
87
  return message;
79
88
  },
@@ -0,0 +1,39 @@
1
+ import _m0 from "protobufjs/minimal";
2
+ export declare const protobufPackage = "loans.rollback";
3
+ export interface rollbackRequest {
4
+ amount: number;
5
+ customerid: number;
6
+ loan_id: number;
7
+ payment_id: number;
8
+ mode: string;
9
+ }
10
+ export interface rollbackResponse {
11
+ message: string;
12
+ }
13
+ export declare const rollbackRequest: {
14
+ encode(message: rollbackRequest, writer?: _m0.Writer): _m0.Writer;
15
+ decode(input: _m0.Reader | Uint8Array, length?: number): rollbackRequest;
16
+ fromJSON(object: any): rollbackRequest;
17
+ toJSON(message: rollbackRequest): unknown;
18
+ create<I extends Exact<DeepPartial<rollbackRequest>, I>>(base?: I): rollbackRequest;
19
+ fromPartial<I extends Exact<DeepPartial<rollbackRequest>, I>>(object: I): rollbackRequest;
20
+ };
21
+ export declare const rollbackResponse: {
22
+ encode(message: rollbackResponse, writer?: _m0.Writer): _m0.Writer;
23
+ decode(input: _m0.Reader | Uint8Array, length?: number): rollbackResponse;
24
+ fromJSON(object: any): rollbackResponse;
25
+ toJSON(message: rollbackResponse): unknown;
26
+ create<I extends Exact<DeepPartial<rollbackResponse>, I>>(base?: I): rollbackResponse;
27
+ fromPartial<I extends Exact<DeepPartial<rollbackResponse>, I>>(object: I): rollbackResponse;
28
+ };
29
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
30
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
31
+ [K in keyof T]?: DeepPartial<T[K]>;
32
+ } : Partial<T>;
33
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
34
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
35
+ [K in keyof P]: Exact<P[K], I[K]>;
36
+ } & {
37
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
38
+ };
39
+ export {};