quiver-protobuf-typescript 1.0.1695837708 → 1.0.1695840157

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.
Files changed (2) hide show
  1. package/billing/bill.ts +118 -12
  2. package/package.json +1 -1
package/billing/bill.ts CHANGED
@@ -88,6 +88,7 @@ export interface Bill {
88
88
  description: string;
89
89
  breakdown: BillBreakdown | undefined;
90
90
  metadata: TaskBillMetadata | undefined;
91
+ calculation: TaskBillCalculation | undefined;
91
92
  charge?: Charge | undefined;
92
93
  conversion?: BillConversion | undefined;
93
94
  }
@@ -122,6 +123,11 @@ export interface MFCBillMetadata {
122
123
  }
123
124
 
124
125
  export interface TaskBillCalculation {
126
+ deliveryCharge?: number | undefined;
127
+ productCharge?: number | undefined;
128
+ orderValuePercentage?: number | undefined;
129
+ orderCharge?: number | undefined;
130
+ surcharge?: number | undefined;
125
131
  }
126
132
 
127
133
  export interface MFCBillCalculation {
@@ -132,7 +138,7 @@ export interface QueryBillsRequest {
132
138
  orderBy?: string | undefined;
133
139
  pageToken?: string | undefined;
134
140
  pageSize?: number | undefined;
135
- merchantId: number;
141
+ merchantId?: number | undefined;
136
142
  }
137
143
 
138
144
  export interface QueryBillsResponse {
@@ -151,6 +157,7 @@ function createBaseBill(): Bill {
151
157
  description: "",
152
158
  breakdown: undefined,
153
159
  metadata: undefined,
160
+ calculation: undefined,
154
161
  charge: undefined,
155
162
  conversion: undefined,
156
163
  };
@@ -188,6 +195,9 @@ export const Bill = {
188
195
  if (message.metadata !== undefined) {
189
196
  TaskBillMetadata.encode(message.metadata, writer.uint32(82).fork()).ldelim();
190
197
  }
198
+ if (message.calculation !== undefined) {
199
+ TaskBillCalculation.encode(message.calculation, writer.uint32(90).fork()).ldelim();
200
+ }
191
201
  if (message.charge !== undefined) {
192
202
  Charge.encode(message.charge, writer.uint32(114).fork()).ldelim();
193
203
  }
@@ -274,6 +284,13 @@ export const Bill = {
274
284
 
275
285
  message.metadata = TaskBillMetadata.decode(reader, reader.uint32());
276
286
  continue;
287
+ case 11:
288
+ if (tag !== 90) {
289
+ break;
290
+ }
291
+
292
+ message.calculation = TaskBillCalculation.decode(reader, reader.uint32());
293
+ continue;
277
294
  case 14:
278
295
  if (tag !== 114) {
279
296
  break;
@@ -309,6 +326,7 @@ export const Bill = {
309
326
  description: isSet(object.description) ? String(object.description) : "",
310
327
  breakdown: isSet(object.breakdown) ? BillBreakdown.fromJSON(object.breakdown) : undefined,
311
328
  metadata: isSet(object.metadata) ? TaskBillMetadata.fromJSON(object.metadata) : undefined,
329
+ calculation: isSet(object.calculation) ? TaskBillCalculation.fromJSON(object.calculation) : undefined,
312
330
  charge: isSet(object.charge) ? Charge.fromJSON(object.charge) : undefined,
313
331
  conversion: isSet(object.conversion) ? BillConversion.fromJSON(object.conversion) : undefined,
314
332
  };
@@ -346,6 +364,9 @@ export const Bill = {
346
364
  if (message.metadata !== undefined) {
347
365
  obj.metadata = TaskBillMetadata.toJSON(message.metadata);
348
366
  }
367
+ if (message.calculation !== undefined) {
368
+ obj.calculation = TaskBillCalculation.toJSON(message.calculation);
369
+ }
349
370
  if (message.charge !== undefined) {
350
371
  obj.charge = Charge.toJSON(message.charge);
351
372
  }
@@ -374,6 +395,9 @@ export const Bill = {
374
395
  message.metadata = (object.metadata !== undefined && object.metadata !== null)
375
396
  ? TaskBillMetadata.fromPartial(object.metadata)
376
397
  : undefined;
398
+ message.calculation = (object.calculation !== undefined && object.calculation !== null)
399
+ ? TaskBillCalculation.fromPartial(object.calculation)
400
+ : undefined;
377
401
  message.charge = (object.charge !== undefined && object.charge !== null)
378
402
  ? Charge.fromPartial(object.charge)
379
403
  : undefined;
@@ -852,11 +876,32 @@ export const MFCBillMetadata = {
852
876
  };
853
877
 
854
878
  function createBaseTaskBillCalculation(): TaskBillCalculation {
855
- return {};
879
+ return {
880
+ deliveryCharge: undefined,
881
+ productCharge: undefined,
882
+ orderValuePercentage: undefined,
883
+ orderCharge: undefined,
884
+ surcharge: undefined,
885
+ };
856
886
  }
857
887
 
858
888
  export const TaskBillCalculation = {
859
- encode(_: TaskBillCalculation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
889
+ encode(message: TaskBillCalculation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
890
+ if (message.deliveryCharge !== undefined) {
891
+ writer.uint32(8).int32(message.deliveryCharge);
892
+ }
893
+ if (message.productCharge !== undefined) {
894
+ writer.uint32(16).int32(message.productCharge);
895
+ }
896
+ if (message.orderValuePercentage !== undefined) {
897
+ writer.uint32(25).double(message.orderValuePercentage);
898
+ }
899
+ if (message.orderCharge !== undefined) {
900
+ writer.uint32(32).int32(message.orderCharge);
901
+ }
902
+ if (message.surcharge !== undefined) {
903
+ writer.uint32(40).int32(message.surcharge);
904
+ }
860
905
  return writer;
861
906
  },
862
907
 
@@ -867,6 +912,41 @@ export const TaskBillCalculation = {
867
912
  while (reader.pos < end) {
868
913
  const tag = reader.uint32();
869
914
  switch (tag >>> 3) {
915
+ case 1:
916
+ if (tag !== 8) {
917
+ break;
918
+ }
919
+
920
+ message.deliveryCharge = reader.int32();
921
+ continue;
922
+ case 2:
923
+ if (tag !== 16) {
924
+ break;
925
+ }
926
+
927
+ message.productCharge = reader.int32();
928
+ continue;
929
+ case 3:
930
+ if (tag !== 25) {
931
+ break;
932
+ }
933
+
934
+ message.orderValuePercentage = reader.double();
935
+ continue;
936
+ case 4:
937
+ if (tag !== 32) {
938
+ break;
939
+ }
940
+
941
+ message.orderCharge = reader.int32();
942
+ continue;
943
+ case 5:
944
+ if (tag !== 40) {
945
+ break;
946
+ }
947
+
948
+ message.surcharge = reader.int32();
949
+ continue;
870
950
  }
871
951
  if ((tag & 7) === 4 || tag === 0) {
872
952
  break;
@@ -876,20 +956,46 @@ export const TaskBillCalculation = {
876
956
  return message;
877
957
  },
878
958
 
879
- fromJSON(_: any): TaskBillCalculation {
880
- return {};
959
+ fromJSON(object: any): TaskBillCalculation {
960
+ return {
961
+ deliveryCharge: isSet(object.deliveryCharge) ? Number(object.deliveryCharge) : undefined,
962
+ productCharge: isSet(object.productCharge) ? Number(object.productCharge) : undefined,
963
+ orderValuePercentage: isSet(object.orderValuePercentage) ? Number(object.orderValuePercentage) : undefined,
964
+ orderCharge: isSet(object.orderCharge) ? Number(object.orderCharge) : undefined,
965
+ surcharge: isSet(object.surcharge) ? Number(object.surcharge) : undefined,
966
+ };
881
967
  },
882
968
 
883
- toJSON(_: TaskBillCalculation): unknown {
969
+ toJSON(message: TaskBillCalculation): unknown {
884
970
  const obj: any = {};
971
+ if (message.deliveryCharge !== undefined) {
972
+ obj.deliveryCharge = Math.round(message.deliveryCharge);
973
+ }
974
+ if (message.productCharge !== undefined) {
975
+ obj.productCharge = Math.round(message.productCharge);
976
+ }
977
+ if (message.orderValuePercentage !== undefined) {
978
+ obj.orderValuePercentage = message.orderValuePercentage;
979
+ }
980
+ if (message.orderCharge !== undefined) {
981
+ obj.orderCharge = Math.round(message.orderCharge);
982
+ }
983
+ if (message.surcharge !== undefined) {
984
+ obj.surcharge = Math.round(message.surcharge);
985
+ }
885
986
  return obj;
886
987
  },
887
988
 
888
989
  create<I extends Exact<DeepPartial<TaskBillCalculation>, I>>(base?: I): TaskBillCalculation {
889
990
  return TaskBillCalculation.fromPartial(base ?? ({} as any));
890
991
  },
891
- fromPartial<I extends Exact<DeepPartial<TaskBillCalculation>, I>>(_: I): TaskBillCalculation {
992
+ fromPartial<I extends Exact<DeepPartial<TaskBillCalculation>, I>>(object: I): TaskBillCalculation {
892
993
  const message = createBaseTaskBillCalculation();
994
+ message.deliveryCharge = object.deliveryCharge ?? undefined;
995
+ message.productCharge = object.productCharge ?? undefined;
996
+ message.orderValuePercentage = object.orderValuePercentage ?? undefined;
997
+ message.orderCharge = object.orderCharge ?? undefined;
998
+ message.surcharge = object.surcharge ?? undefined;
893
999
  return message;
894
1000
  },
895
1001
  };
@@ -938,7 +1044,7 @@ export const MFCBillCalculation = {
938
1044
  };
939
1045
 
940
1046
  function createBaseQueryBillsRequest(): QueryBillsRequest {
941
- return { filter: undefined, orderBy: undefined, pageToken: undefined, pageSize: undefined, merchantId: 0 };
1047
+ return { filter: undefined, orderBy: undefined, pageToken: undefined, pageSize: undefined, merchantId: undefined };
942
1048
  }
943
1049
 
944
1050
  export const QueryBillsRequest = {
@@ -955,7 +1061,7 @@ export const QueryBillsRequest = {
955
1061
  if (message.pageSize !== undefined) {
956
1062
  writer.uint32(32).int32(message.pageSize);
957
1063
  }
958
- if (message.merchantId !== 0) {
1064
+ if (message.merchantId !== undefined) {
959
1065
  writer.uint32(40).int32(message.merchantId);
960
1066
  }
961
1067
  return writer;
@@ -1018,7 +1124,7 @@ export const QueryBillsRequest = {
1018
1124
  orderBy: isSet(object.orderBy) ? String(object.orderBy) : undefined,
1019
1125
  pageToken: isSet(object.pageToken) ? String(object.pageToken) : undefined,
1020
1126
  pageSize: isSet(object.pageSize) ? Number(object.pageSize) : undefined,
1021
- merchantId: isSet(object.merchantId) ? Number(object.merchantId) : 0,
1127
+ merchantId: isSet(object.merchantId) ? Number(object.merchantId) : undefined,
1022
1128
  };
1023
1129
  },
1024
1130
 
@@ -1036,7 +1142,7 @@ export const QueryBillsRequest = {
1036
1142
  if (message.pageSize !== undefined) {
1037
1143
  obj.pageSize = Math.round(message.pageSize);
1038
1144
  }
1039
- if (message.merchantId !== 0) {
1145
+ if (message.merchantId !== undefined) {
1040
1146
  obj.merchantId = Math.round(message.merchantId);
1041
1147
  }
1042
1148
  return obj;
@@ -1051,7 +1157,7 @@ export const QueryBillsRequest = {
1051
1157
  message.orderBy = object.orderBy ?? undefined;
1052
1158
  message.pageToken = object.pageToken ?? undefined;
1053
1159
  message.pageSize = object.pageSize ?? undefined;
1054
- message.merchantId = object.merchantId ?? 0;
1160
+ message.merchantId = object.merchantId ?? undefined;
1055
1161
  return message;
1056
1162
  },
1057
1163
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quiver-protobuf-typescript",
3
- "version": "1.0.1695837708",
3
+ "version": "1.0.1695840157",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",