@fatehan/tsrp 1.6.20 → 1.6.21

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 (88) hide show
  1. package/dist/fatehan/activities/workflow.d.ts +219 -0
  2. package/dist/fatehan/activities/workflow.d.ts.map +1 -0
  3. package/dist/fatehan/activities/workflow.js +1941 -0
  4. package/dist/fatehan/activities/workshift.d.ts +140 -0
  5. package/dist/fatehan/activities/workshift.d.ts.map +1 -0
  6. package/dist/fatehan/activities/workshift.js +1244 -0
  7. package/dist/fatehan/apis/client.d.ts +246 -0
  8. package/dist/fatehan/apis/client.d.ts.map +1 -0
  9. package/dist/fatehan/apis/client.js +2572 -0
  10. package/dist/fatehan/areas/area.d.ts +96 -0
  11. package/dist/fatehan/areas/area.d.ts.map +1 -0
  12. package/dist/fatehan/areas/area.js +761 -0
  13. package/dist/fatehan/devices/devices.d.ts +256 -0
  14. package/dist/fatehan/devices/devices.d.ts.map +1 -0
  15. package/dist/fatehan/devices/devices.js +2730 -0
  16. package/dist/fatehan/devices/maintenance.d.ts +64 -0
  17. package/dist/fatehan/devices/maintenance.d.ts.map +1 -0
  18. package/dist/fatehan/devices/maintenance.js +484 -0
  19. package/dist/fatehan/financial/financial.d.ts +162 -0
  20. package/dist/fatehan/financial/financial.d.ts.map +1 -0
  21. package/dist/fatehan/financial/financial.js +1701 -0
  22. package/dist/fatehan/google/protobuf/descriptor.d.ts +1303 -0
  23. package/dist/fatehan/google/protobuf/descriptor.d.ts.map +1 -0
  24. package/dist/fatehan/google/protobuf/descriptor.js +3467 -0
  25. package/dist/fatehan/google/protobuf/duration.d.ts +99 -0
  26. package/dist/fatehan/google/protobuf/duration.d.ts.map +1 -0
  27. package/dist/fatehan/google/protobuf/duration.js +63 -0
  28. package/dist/fatehan/google/protobuf/field_mask.d.ts +228 -0
  29. package/dist/fatehan/google/protobuf/field_mask.d.ts.map +1 -0
  30. package/dist/fatehan/google/protobuf/field_mask.js +57 -0
  31. package/dist/fatehan/google/protobuf/timestamp.d.ts +129 -0
  32. package/dist/fatehan/google/protobuf/timestamp.d.ts.map +1 -0
  33. package/dist/fatehan/google/protobuf/timestamp.js +63 -0
  34. package/dist/fatehan/identities/authentication.d.ts +164 -0
  35. package/dist/fatehan/identities/authentication.d.ts.map +1 -0
  36. package/dist/fatehan/identities/authentication.js +1291 -0
  37. package/dist/fatehan/identities/identities.d.ts +969 -0
  38. package/dist/fatehan/identities/identities.d.ts.map +1 -0
  39. package/dist/fatehan/identities/identities.js +2993 -0
  40. package/dist/fatehan/models/fusion.d.ts +149 -0
  41. package/dist/fatehan/models/fusion.d.ts.map +1 -0
  42. package/dist/fatehan/models/fusion.js +1531 -0
  43. package/dist/fatehan/models/models.d.ts +162 -0
  44. package/dist/fatehan/models/models.d.ts.map +1 -0
  45. package/dist/fatehan/models/models.js +1486 -0
  46. package/dist/fatehan/notifies/direct.d.ts +85 -0
  47. package/dist/fatehan/notifies/direct.d.ts.map +1 -0
  48. package/dist/fatehan/notifies/direct.js +669 -0
  49. package/dist/fatehan/notifies/notify.d.ts +232 -0
  50. package/dist/fatehan/notifies/notify.d.ts.map +1 -0
  51. package/dist/fatehan/notifies/notify.js +1958 -0
  52. package/dist/fatehan/packets/commands.d.ts +150 -0
  53. package/dist/fatehan/packets/commands.d.ts.map +1 -0
  54. package/dist/fatehan/packets/commands.js +1364 -0
  55. package/dist/fatehan/packets/dataModel.d.ts +1611 -0
  56. package/dist/fatehan/packets/dataModel.d.ts.map +1 -0
  57. package/dist/fatehan/packets/dataModel.js +14961 -0
  58. package/dist/fatehan/packets/dataModule.d.ts +61 -0
  59. package/dist/fatehan/packets/dataModule.d.ts.map +1 -0
  60. package/dist/fatehan/packets/dataModule.js +386 -0
  61. package/dist/fatehan/packets/forge.d.ts +142 -0
  62. package/dist/fatehan/packets/forge.d.ts.map +1 -0
  63. package/dist/fatehan/packets/forge.js +1339 -0
  64. package/dist/fatehan/services/api.d.ts +1221 -0
  65. package/dist/fatehan/services/api.d.ts.map +1 -0
  66. package/dist/fatehan/services/api.js +12678 -0
  67. package/dist/fatehan/services/repositories.d.ts +78 -0
  68. package/dist/fatehan/services/repositories.d.ts.map +1 -0
  69. package/dist/fatehan/services/repositories.js +620 -0
  70. package/dist/fatehan/stream/stream.d.ts +224 -0
  71. package/dist/fatehan/stream/stream.d.ts.map +1 -0
  72. package/dist/fatehan/stream/stream.js +1416 -0
  73. package/dist/fatehan/trips/trip.d.ts +325 -0
  74. package/dist/fatehan/trips/trip.d.ts.map +1 -0
  75. package/dist/fatehan/trips/trip.js +1635 -0
  76. package/dist/fatehan/utils/buf/validate/validate.d.ts +3520 -0
  77. package/dist/fatehan/utils/buf/validate/validate.d.ts.map +1 -0
  78. package/dist/fatehan/utils/buf/validate/validate.js +4248 -0
  79. package/dist/services.d.ts +79 -0
  80. package/dist/services.d.ts.map +1 -0
  81. package/dist/services.js +245 -0
  82. package/dist/store/system.io.d.ts +6 -0
  83. package/dist/store/system.io.d.ts.map +1 -0
  84. package/dist/store/system.io.js +14 -0
  85. package/dist/system.io.d.ts +6 -0
  86. package/dist/system.io.d.ts.map +1 -0
  87. package/dist/system.io.js +208 -0
  88. package/package.json +1 -1
@@ -0,0 +1,1701 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v7.34.1
5
+ // source: financial/financial.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import Long from "long";
9
+ import { Timestamp } from "../google/protobuf/timestamp";
10
+ import { Person } from "../identities/identities";
11
+ export const protobufPackage = "com.fatehan.financial";
12
+ function createBaseWallet() {
13
+ return {
14
+ id: Long.UZERO,
15
+ userId: undefined,
16
+ organizationId: undefined,
17
+ currencyId: Long.UZERO,
18
+ remaining: 0,
19
+ createdAt: undefined,
20
+ updatedAt: undefined,
21
+ };
22
+ }
23
+ export const Wallet = {
24
+ encode(message, writer = new BinaryWriter()) {
25
+ if (!message.id.equals(Long.UZERO)) {
26
+ writer.uint32(8).uint64(message.id.toString());
27
+ }
28
+ if (message.userId !== undefined) {
29
+ writer.uint32(16).uint64(message.userId.toString());
30
+ }
31
+ if (message.organizationId !== undefined) {
32
+ writer.uint32(24).uint64(message.organizationId.toString());
33
+ }
34
+ if (!message.currencyId.equals(Long.UZERO)) {
35
+ writer.uint32(32).uint64(message.currencyId.toString());
36
+ }
37
+ if (message.remaining !== 0) {
38
+ writer.uint32(41).double(message.remaining);
39
+ }
40
+ if (message.createdAt !== undefined) {
41
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).join();
42
+ }
43
+ if (message.updatedAt !== undefined) {
44
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(58).fork()).join();
45
+ }
46
+ return writer;
47
+ },
48
+ decode(input, length) {
49
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
50
+ const end = length === undefined ? reader.len : reader.pos + length;
51
+ const message = createBaseWallet();
52
+ while (reader.pos < end) {
53
+ const tag = reader.uint32();
54
+ switch (tag >>> 3) {
55
+ case 1: {
56
+ if (tag !== 8) {
57
+ break;
58
+ }
59
+ message.id = Long.fromString(reader.uint64().toString(), true);
60
+ continue;
61
+ }
62
+ case 2: {
63
+ if (tag !== 16) {
64
+ break;
65
+ }
66
+ message.userId = Long.fromString(reader.uint64().toString(), true);
67
+ continue;
68
+ }
69
+ case 3: {
70
+ if (tag !== 24) {
71
+ break;
72
+ }
73
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
74
+ continue;
75
+ }
76
+ case 4: {
77
+ if (tag !== 32) {
78
+ break;
79
+ }
80
+ message.currencyId = Long.fromString(reader.uint64().toString(), true);
81
+ continue;
82
+ }
83
+ case 5: {
84
+ if (tag !== 41) {
85
+ break;
86
+ }
87
+ message.remaining = reader.double();
88
+ continue;
89
+ }
90
+ case 6: {
91
+ if (tag !== 50) {
92
+ break;
93
+ }
94
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
95
+ continue;
96
+ }
97
+ case 7: {
98
+ if (tag !== 58) {
99
+ break;
100
+ }
101
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
102
+ continue;
103
+ }
104
+ }
105
+ if ((tag & 7) === 4 || tag === 0) {
106
+ break;
107
+ }
108
+ reader.skip(tag & 7);
109
+ }
110
+ return message;
111
+ },
112
+ create(base) {
113
+ return Wallet.fromPartial(base ?? {});
114
+ },
115
+ fromPartial(object) {
116
+ const message = createBaseWallet();
117
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
118
+ message.userId = (object.userId !== undefined && object.userId !== null)
119
+ ? Long.fromValue(object.userId)
120
+ : undefined;
121
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
122
+ ? Long.fromValue(object.organizationId)
123
+ : undefined;
124
+ message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
125
+ ? Long.fromValue(object.currencyId)
126
+ : Long.UZERO;
127
+ message.remaining = object.remaining ?? 0;
128
+ message.createdAt = object.createdAt ?? undefined;
129
+ message.updatedAt = object.updatedAt ?? undefined;
130
+ return message;
131
+ },
132
+ };
133
+ function createBaseCurrency() {
134
+ return {
135
+ id: Long.UZERO,
136
+ name: "",
137
+ code: undefined,
138
+ leftSign: undefined,
139
+ rightSign: undefined,
140
+ default: 0,
141
+ ratioToDefault: 0,
142
+ createdAt: undefined,
143
+ updatedAt: undefined,
144
+ };
145
+ }
146
+ export const Currency = {
147
+ encode(message, writer = new BinaryWriter()) {
148
+ if (!message.id.equals(Long.UZERO)) {
149
+ writer.uint32(8).uint64(message.id.toString());
150
+ }
151
+ if (message.name !== "") {
152
+ writer.uint32(18).string(message.name);
153
+ }
154
+ if (message.code !== undefined) {
155
+ writer.uint32(26).string(message.code);
156
+ }
157
+ if (message.leftSign !== undefined) {
158
+ writer.uint32(34).string(message.leftSign);
159
+ }
160
+ if (message.rightSign !== undefined) {
161
+ writer.uint32(42).string(message.rightSign);
162
+ }
163
+ if (message.default !== 0) {
164
+ writer.uint32(48).sint32(message.default);
165
+ }
166
+ if (message.ratioToDefault !== 0) {
167
+ writer.uint32(56).sint32(message.ratioToDefault);
168
+ }
169
+ if (message.createdAt !== undefined) {
170
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(66).fork()).join();
171
+ }
172
+ if (message.updatedAt !== undefined) {
173
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(74).fork()).join();
174
+ }
175
+ return writer;
176
+ },
177
+ decode(input, length) {
178
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
179
+ const end = length === undefined ? reader.len : reader.pos + length;
180
+ const message = createBaseCurrency();
181
+ while (reader.pos < end) {
182
+ const tag = reader.uint32();
183
+ switch (tag >>> 3) {
184
+ case 1: {
185
+ if (tag !== 8) {
186
+ break;
187
+ }
188
+ message.id = Long.fromString(reader.uint64().toString(), true);
189
+ continue;
190
+ }
191
+ case 2: {
192
+ if (tag !== 18) {
193
+ break;
194
+ }
195
+ message.name = reader.string();
196
+ continue;
197
+ }
198
+ case 3: {
199
+ if (tag !== 26) {
200
+ break;
201
+ }
202
+ message.code = reader.string();
203
+ continue;
204
+ }
205
+ case 4: {
206
+ if (tag !== 34) {
207
+ break;
208
+ }
209
+ message.leftSign = reader.string();
210
+ continue;
211
+ }
212
+ case 5: {
213
+ if (tag !== 42) {
214
+ break;
215
+ }
216
+ message.rightSign = reader.string();
217
+ continue;
218
+ }
219
+ case 6: {
220
+ if (tag !== 48) {
221
+ break;
222
+ }
223
+ message.default = reader.sint32();
224
+ continue;
225
+ }
226
+ case 7: {
227
+ if (tag !== 56) {
228
+ break;
229
+ }
230
+ message.ratioToDefault = reader.sint32();
231
+ continue;
232
+ }
233
+ case 8: {
234
+ if (tag !== 66) {
235
+ break;
236
+ }
237
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
238
+ continue;
239
+ }
240
+ case 9: {
241
+ if (tag !== 74) {
242
+ break;
243
+ }
244
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
245
+ continue;
246
+ }
247
+ }
248
+ if ((tag & 7) === 4 || tag === 0) {
249
+ break;
250
+ }
251
+ reader.skip(tag & 7);
252
+ }
253
+ return message;
254
+ },
255
+ create(base) {
256
+ return Currency.fromPartial(base ?? {});
257
+ },
258
+ fromPartial(object) {
259
+ const message = createBaseCurrency();
260
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
261
+ message.name = object.name ?? "";
262
+ message.code = object.code ?? undefined;
263
+ message.leftSign = object.leftSign ?? undefined;
264
+ message.rightSign = object.rightSign ?? undefined;
265
+ message.default = object.default ?? 0;
266
+ message.ratioToDefault = object.ratioToDefault ?? 0;
267
+ message.createdAt = object.createdAt ?? undefined;
268
+ message.updatedAt = object.updatedAt ?? undefined;
269
+ return message;
270
+ },
271
+ };
272
+ function createBasePartner() {
273
+ return { id: Long.UZERO, name: undefined, domains: [] };
274
+ }
275
+ export const Partner = {
276
+ encode(message, writer = new BinaryWriter()) {
277
+ if (!message.id.equals(Long.UZERO)) {
278
+ writer.uint32(8).uint64(message.id.toString());
279
+ }
280
+ if (message.name !== undefined) {
281
+ writer.uint32(26).string(message.name);
282
+ }
283
+ for (const v of message.domains) {
284
+ writer.uint32(18).string(v);
285
+ }
286
+ return writer;
287
+ },
288
+ decode(input, length) {
289
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
290
+ const end = length === undefined ? reader.len : reader.pos + length;
291
+ const message = createBasePartner();
292
+ while (reader.pos < end) {
293
+ const tag = reader.uint32();
294
+ switch (tag >>> 3) {
295
+ case 1: {
296
+ if (tag !== 8) {
297
+ break;
298
+ }
299
+ message.id = Long.fromString(reader.uint64().toString(), true);
300
+ continue;
301
+ }
302
+ case 3: {
303
+ if (tag !== 26) {
304
+ break;
305
+ }
306
+ message.name = reader.string();
307
+ continue;
308
+ }
309
+ case 2: {
310
+ if (tag !== 18) {
311
+ break;
312
+ }
313
+ message.domains.push(reader.string());
314
+ continue;
315
+ }
316
+ }
317
+ if ((tag & 7) === 4 || tag === 0) {
318
+ break;
319
+ }
320
+ reader.skip(tag & 7);
321
+ }
322
+ return message;
323
+ },
324
+ create(base) {
325
+ return Partner.fromPartial(base ?? {});
326
+ },
327
+ fromPartial(object) {
328
+ const message = createBasePartner();
329
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
330
+ message.name = object.name ?? undefined;
331
+ message.domains = object.domains?.map((e) => e) || [];
332
+ return message;
333
+ },
334
+ };
335
+ function createBaseProductType() {
336
+ return {
337
+ id: Long.UZERO,
338
+ name: undefined,
339
+ description: undefined,
340
+ months: undefined,
341
+ keyType: "",
342
+ picture: undefined,
343
+ createdBy: undefined,
344
+ updatedBy: undefined,
345
+ createdAt: undefined,
346
+ updatedAt: undefined,
347
+ };
348
+ }
349
+ export const ProductType = {
350
+ encode(message, writer = new BinaryWriter()) {
351
+ if (!message.id.equals(Long.UZERO)) {
352
+ writer.uint32(8).uint64(message.id.toString());
353
+ }
354
+ if (message.name !== undefined) {
355
+ writer.uint32(18).string(message.name);
356
+ }
357
+ if (message.description !== undefined) {
358
+ writer.uint32(26).string(message.description);
359
+ }
360
+ if (message.months !== undefined) {
361
+ writer.uint32(32).uint32(message.months);
362
+ }
363
+ if (message.keyType !== "") {
364
+ writer.uint32(42).string(message.keyType);
365
+ }
366
+ if (message.picture !== undefined) {
367
+ writer.uint32(50).string(message.picture);
368
+ }
369
+ if (message.createdBy !== undefined) {
370
+ writer.uint32(56).uint64(message.createdBy.toString());
371
+ }
372
+ if (message.updatedBy !== undefined) {
373
+ writer.uint32(64).uint64(message.updatedBy.toString());
374
+ }
375
+ if (message.createdAt !== undefined) {
376
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(74).fork()).join();
377
+ }
378
+ if (message.updatedAt !== undefined) {
379
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(82).fork()).join();
380
+ }
381
+ return writer;
382
+ },
383
+ decode(input, length) {
384
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
385
+ const end = length === undefined ? reader.len : reader.pos + length;
386
+ const message = createBaseProductType();
387
+ while (reader.pos < end) {
388
+ const tag = reader.uint32();
389
+ switch (tag >>> 3) {
390
+ case 1: {
391
+ if (tag !== 8) {
392
+ break;
393
+ }
394
+ message.id = Long.fromString(reader.uint64().toString(), true);
395
+ continue;
396
+ }
397
+ case 2: {
398
+ if (tag !== 18) {
399
+ break;
400
+ }
401
+ message.name = reader.string();
402
+ continue;
403
+ }
404
+ case 3: {
405
+ if (tag !== 26) {
406
+ break;
407
+ }
408
+ message.description = reader.string();
409
+ continue;
410
+ }
411
+ case 4: {
412
+ if (tag !== 32) {
413
+ break;
414
+ }
415
+ message.months = reader.uint32();
416
+ continue;
417
+ }
418
+ case 5: {
419
+ if (tag !== 42) {
420
+ break;
421
+ }
422
+ message.keyType = reader.string();
423
+ continue;
424
+ }
425
+ case 6: {
426
+ if (tag !== 50) {
427
+ break;
428
+ }
429
+ message.picture = reader.string();
430
+ continue;
431
+ }
432
+ case 7: {
433
+ if (tag !== 56) {
434
+ break;
435
+ }
436
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
437
+ continue;
438
+ }
439
+ case 8: {
440
+ if (tag !== 64) {
441
+ break;
442
+ }
443
+ message.updatedBy = Long.fromString(reader.uint64().toString(), true);
444
+ continue;
445
+ }
446
+ case 9: {
447
+ if (tag !== 74) {
448
+ break;
449
+ }
450
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
451
+ continue;
452
+ }
453
+ case 10: {
454
+ if (tag !== 82) {
455
+ break;
456
+ }
457
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
458
+ continue;
459
+ }
460
+ }
461
+ if ((tag & 7) === 4 || tag === 0) {
462
+ break;
463
+ }
464
+ reader.skip(tag & 7);
465
+ }
466
+ return message;
467
+ },
468
+ create(base) {
469
+ return ProductType.fromPartial(base ?? {});
470
+ },
471
+ fromPartial(object) {
472
+ const message = createBaseProductType();
473
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
474
+ message.name = object.name ?? undefined;
475
+ message.description = object.description ?? undefined;
476
+ message.months = object.months ?? undefined;
477
+ message.keyType = object.keyType ?? "";
478
+ message.picture = object.picture ?? undefined;
479
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
480
+ ? Long.fromValue(object.createdBy)
481
+ : undefined;
482
+ message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
483
+ ? Long.fromValue(object.updatedBy)
484
+ : undefined;
485
+ message.createdAt = object.createdAt ?? undefined;
486
+ message.updatedAt = object.updatedAt ?? undefined;
487
+ return message;
488
+ },
489
+ };
490
+ function createBaseProduct() {
491
+ return {
492
+ id: Long.UZERO,
493
+ organizationId: undefined,
494
+ productTypeId: undefined,
495
+ createdBy: undefined,
496
+ updatedBy: undefined,
497
+ name: "",
498
+ displayName: undefined,
499
+ description: undefined,
500
+ picture: undefined,
501
+ slug: undefined,
502
+ uuid: undefined,
503
+ objectType: undefined,
504
+ objectId: undefined,
505
+ currencyId: Long.UZERO,
506
+ price: 0,
507
+ createdAt: undefined,
508
+ updatedAt: undefined,
509
+ };
510
+ }
511
+ export const Product = {
512
+ encode(message, writer = new BinaryWriter()) {
513
+ if (!message.id.equals(Long.UZERO)) {
514
+ writer.uint32(8).uint64(message.id.toString());
515
+ }
516
+ if (message.organizationId !== undefined) {
517
+ writer.uint32(16).uint64(message.organizationId.toString());
518
+ }
519
+ if (message.productTypeId !== undefined) {
520
+ writer.uint32(24).uint64(message.productTypeId.toString());
521
+ }
522
+ if (message.createdBy !== undefined) {
523
+ writer.uint32(32).uint64(message.createdBy.toString());
524
+ }
525
+ if (message.updatedBy !== undefined) {
526
+ writer.uint32(40).uint64(message.updatedBy.toString());
527
+ }
528
+ if (message.name !== "") {
529
+ writer.uint32(50).string(message.name);
530
+ }
531
+ if (message.displayName !== undefined) {
532
+ writer.uint32(58).string(message.displayName);
533
+ }
534
+ if (message.description !== undefined) {
535
+ writer.uint32(66).string(message.description);
536
+ }
537
+ if (message.picture !== undefined) {
538
+ writer.uint32(74).string(message.picture);
539
+ }
540
+ if (message.slug !== undefined) {
541
+ writer.uint32(82).string(message.slug);
542
+ }
543
+ if (message.uuid !== undefined) {
544
+ writer.uint32(90).string(message.uuid);
545
+ }
546
+ if (message.objectType !== undefined) {
547
+ writer.uint32(98).string(message.objectType);
548
+ }
549
+ if (message.objectId !== undefined) {
550
+ writer.uint32(104).uint64(message.objectId.toString());
551
+ }
552
+ if (!message.currencyId.equals(Long.UZERO)) {
553
+ writer.uint32(112).uint64(message.currencyId.toString());
554
+ }
555
+ if (message.price !== 0) {
556
+ writer.uint32(121).double(message.price);
557
+ }
558
+ if (message.createdAt !== undefined) {
559
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(130).fork()).join();
560
+ }
561
+ if (message.updatedAt !== undefined) {
562
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(138).fork()).join();
563
+ }
564
+ return writer;
565
+ },
566
+ decode(input, length) {
567
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
568
+ const end = length === undefined ? reader.len : reader.pos + length;
569
+ const message = createBaseProduct();
570
+ while (reader.pos < end) {
571
+ const tag = reader.uint32();
572
+ switch (tag >>> 3) {
573
+ case 1: {
574
+ if (tag !== 8) {
575
+ break;
576
+ }
577
+ message.id = Long.fromString(reader.uint64().toString(), true);
578
+ continue;
579
+ }
580
+ case 2: {
581
+ if (tag !== 16) {
582
+ break;
583
+ }
584
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
585
+ continue;
586
+ }
587
+ case 3: {
588
+ if (tag !== 24) {
589
+ break;
590
+ }
591
+ message.productTypeId = Long.fromString(reader.uint64().toString(), true);
592
+ continue;
593
+ }
594
+ case 4: {
595
+ if (tag !== 32) {
596
+ break;
597
+ }
598
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
599
+ continue;
600
+ }
601
+ case 5: {
602
+ if (tag !== 40) {
603
+ break;
604
+ }
605
+ message.updatedBy = Long.fromString(reader.uint64().toString(), true);
606
+ continue;
607
+ }
608
+ case 6: {
609
+ if (tag !== 50) {
610
+ break;
611
+ }
612
+ message.name = reader.string();
613
+ continue;
614
+ }
615
+ case 7: {
616
+ if (tag !== 58) {
617
+ break;
618
+ }
619
+ message.displayName = reader.string();
620
+ continue;
621
+ }
622
+ case 8: {
623
+ if (tag !== 66) {
624
+ break;
625
+ }
626
+ message.description = reader.string();
627
+ continue;
628
+ }
629
+ case 9: {
630
+ if (tag !== 74) {
631
+ break;
632
+ }
633
+ message.picture = reader.string();
634
+ continue;
635
+ }
636
+ case 10: {
637
+ if (tag !== 82) {
638
+ break;
639
+ }
640
+ message.slug = reader.string();
641
+ continue;
642
+ }
643
+ case 11: {
644
+ if (tag !== 90) {
645
+ break;
646
+ }
647
+ message.uuid = reader.string();
648
+ continue;
649
+ }
650
+ case 12: {
651
+ if (tag !== 98) {
652
+ break;
653
+ }
654
+ message.objectType = reader.string();
655
+ continue;
656
+ }
657
+ case 13: {
658
+ if (tag !== 104) {
659
+ break;
660
+ }
661
+ message.objectId = Long.fromString(reader.uint64().toString(), true);
662
+ continue;
663
+ }
664
+ case 14: {
665
+ if (tag !== 112) {
666
+ break;
667
+ }
668
+ message.currencyId = Long.fromString(reader.uint64().toString(), true);
669
+ continue;
670
+ }
671
+ case 15: {
672
+ if (tag !== 121) {
673
+ break;
674
+ }
675
+ message.price = reader.double();
676
+ continue;
677
+ }
678
+ case 16: {
679
+ if (tag !== 130) {
680
+ break;
681
+ }
682
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
683
+ continue;
684
+ }
685
+ case 17: {
686
+ if (tag !== 138) {
687
+ break;
688
+ }
689
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
690
+ continue;
691
+ }
692
+ }
693
+ if ((tag & 7) === 4 || tag === 0) {
694
+ break;
695
+ }
696
+ reader.skip(tag & 7);
697
+ }
698
+ return message;
699
+ },
700
+ create(base) {
701
+ return Product.fromPartial(base ?? {});
702
+ },
703
+ fromPartial(object) {
704
+ const message = createBaseProduct();
705
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
706
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
707
+ ? Long.fromValue(object.organizationId)
708
+ : undefined;
709
+ message.productTypeId = (object.productTypeId !== undefined && object.productTypeId !== null)
710
+ ? Long.fromValue(object.productTypeId)
711
+ : undefined;
712
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
713
+ ? Long.fromValue(object.createdBy)
714
+ : undefined;
715
+ message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
716
+ ? Long.fromValue(object.updatedBy)
717
+ : undefined;
718
+ message.name = object.name ?? "";
719
+ message.displayName = object.displayName ?? undefined;
720
+ message.description = object.description ?? undefined;
721
+ message.picture = object.picture ?? undefined;
722
+ message.slug = object.slug ?? undefined;
723
+ message.uuid = object.uuid ?? undefined;
724
+ message.objectType = object.objectType ?? undefined;
725
+ message.objectId = (object.objectId !== undefined && object.objectId !== null)
726
+ ? Long.fromValue(object.objectId)
727
+ : undefined;
728
+ message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
729
+ ? Long.fromValue(object.currencyId)
730
+ : Long.UZERO;
731
+ message.price = object.price ?? 0;
732
+ message.createdAt = object.createdAt ?? undefined;
733
+ message.updatedAt = object.updatedAt ?? undefined;
734
+ return message;
735
+ },
736
+ };
737
+ function createBasePaymentGateway() {
738
+ return {
739
+ id: Long.UZERO,
740
+ organizationId: Long.UZERO,
741
+ createdBy: undefined,
742
+ updatedBy: undefined,
743
+ gateway: "",
744
+ name: "",
745
+ default: false,
746
+ status: false,
747
+ config: [],
748
+ createdAt: undefined,
749
+ updatedAt: undefined,
750
+ };
751
+ }
752
+ export const PaymentGateway = {
753
+ encode(message, writer = new BinaryWriter()) {
754
+ if (!message.id.equals(Long.UZERO)) {
755
+ writer.uint32(8).uint64(message.id.toString());
756
+ }
757
+ if (!message.organizationId.equals(Long.UZERO)) {
758
+ writer.uint32(16).uint64(message.organizationId.toString());
759
+ }
760
+ if (message.createdBy !== undefined) {
761
+ writer.uint32(24).uint64(message.createdBy.toString());
762
+ }
763
+ if (message.updatedBy !== undefined) {
764
+ writer.uint32(32).uint64(message.updatedBy.toString());
765
+ }
766
+ if (message.gateway !== "") {
767
+ writer.uint32(42).string(message.gateway);
768
+ }
769
+ if (message.name !== "") {
770
+ writer.uint32(50).string(message.name);
771
+ }
772
+ if (message.default !== false) {
773
+ writer.uint32(56).bool(message.default);
774
+ }
775
+ if (message.status !== false) {
776
+ writer.uint32(64).bool(message.status);
777
+ }
778
+ for (const v of message.config) {
779
+ PaymentGateway_Config.encode(v, writer.uint32(74).fork()).join();
780
+ }
781
+ if (message.createdAt !== undefined) {
782
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
783
+ }
784
+ if (message.updatedAt !== undefined) {
785
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
786
+ }
787
+ return writer;
788
+ },
789
+ decode(input, length) {
790
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
791
+ const end = length === undefined ? reader.len : reader.pos + length;
792
+ const message = createBasePaymentGateway();
793
+ while (reader.pos < end) {
794
+ const tag = reader.uint32();
795
+ switch (tag >>> 3) {
796
+ case 1: {
797
+ if (tag !== 8) {
798
+ break;
799
+ }
800
+ message.id = Long.fromString(reader.uint64().toString(), true);
801
+ continue;
802
+ }
803
+ case 2: {
804
+ if (tag !== 16) {
805
+ break;
806
+ }
807
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
808
+ continue;
809
+ }
810
+ case 3: {
811
+ if (tag !== 24) {
812
+ break;
813
+ }
814
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
815
+ continue;
816
+ }
817
+ case 4: {
818
+ if (tag !== 32) {
819
+ break;
820
+ }
821
+ message.updatedBy = Long.fromString(reader.uint64().toString(), true);
822
+ continue;
823
+ }
824
+ case 5: {
825
+ if (tag !== 42) {
826
+ break;
827
+ }
828
+ message.gateway = reader.string();
829
+ continue;
830
+ }
831
+ case 6: {
832
+ if (tag !== 50) {
833
+ break;
834
+ }
835
+ message.name = reader.string();
836
+ continue;
837
+ }
838
+ case 7: {
839
+ if (tag !== 56) {
840
+ break;
841
+ }
842
+ message.default = reader.bool();
843
+ continue;
844
+ }
845
+ case 8: {
846
+ if (tag !== 64) {
847
+ break;
848
+ }
849
+ message.status = reader.bool();
850
+ continue;
851
+ }
852
+ case 9: {
853
+ if (tag !== 74) {
854
+ break;
855
+ }
856
+ message.config.push(PaymentGateway_Config.decode(reader, reader.uint32()));
857
+ continue;
858
+ }
859
+ case 10: {
860
+ if (tag !== 82) {
861
+ break;
862
+ }
863
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
864
+ continue;
865
+ }
866
+ case 11: {
867
+ if (tag !== 90) {
868
+ break;
869
+ }
870
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
871
+ continue;
872
+ }
873
+ }
874
+ if ((tag & 7) === 4 || tag === 0) {
875
+ break;
876
+ }
877
+ reader.skip(tag & 7);
878
+ }
879
+ return message;
880
+ },
881
+ create(base) {
882
+ return PaymentGateway.fromPartial(base ?? {});
883
+ },
884
+ fromPartial(object) {
885
+ const message = createBasePaymentGateway();
886
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
887
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
888
+ ? Long.fromValue(object.organizationId)
889
+ : Long.UZERO;
890
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
891
+ ? Long.fromValue(object.createdBy)
892
+ : undefined;
893
+ message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
894
+ ? Long.fromValue(object.updatedBy)
895
+ : undefined;
896
+ message.gateway = object.gateway ?? "";
897
+ message.name = object.name ?? "";
898
+ message.default = object.default ?? false;
899
+ message.status = object.status ?? false;
900
+ message.config = object.config?.map((e) => PaymentGateway_Config.fromPartial(e)) || [];
901
+ message.createdAt = object.createdAt ?? undefined;
902
+ message.updatedAt = object.updatedAt ?? undefined;
903
+ return message;
904
+ },
905
+ };
906
+ function createBasePaymentGateway_Config() {
907
+ return { key: "", value: "" };
908
+ }
909
+ export const PaymentGateway_Config = {
910
+ encode(message, writer = new BinaryWriter()) {
911
+ if (message.key !== "") {
912
+ writer.uint32(10).string(message.key);
913
+ }
914
+ if (message.value !== "") {
915
+ writer.uint32(18).string(message.value);
916
+ }
917
+ return writer;
918
+ },
919
+ decode(input, length) {
920
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
921
+ const end = length === undefined ? reader.len : reader.pos + length;
922
+ const message = createBasePaymentGateway_Config();
923
+ while (reader.pos < end) {
924
+ const tag = reader.uint32();
925
+ switch (tag >>> 3) {
926
+ case 1: {
927
+ if (tag !== 10) {
928
+ break;
929
+ }
930
+ message.key = reader.string();
931
+ continue;
932
+ }
933
+ case 2: {
934
+ if (tag !== 18) {
935
+ break;
936
+ }
937
+ message.value = reader.string();
938
+ continue;
939
+ }
940
+ }
941
+ if ((tag & 7) === 4 || tag === 0) {
942
+ break;
943
+ }
944
+ reader.skip(tag & 7);
945
+ }
946
+ return message;
947
+ },
948
+ create(base) {
949
+ return PaymentGateway_Config.fromPartial(base ?? {});
950
+ },
951
+ fromPartial(object) {
952
+ const message = createBasePaymentGateway_Config();
953
+ message.key = object.key ?? "";
954
+ message.value = object.value ?? "";
955
+ return message;
956
+ },
957
+ };
958
+ function createBaseOrderPagination() {
959
+ return {
960
+ currentPage: 0,
961
+ firstPageUrl: "",
962
+ lastPageUrl: "",
963
+ nextPageUrl: "",
964
+ prevPageUrl: "",
965
+ path: "",
966
+ from: 0,
967
+ lastPage: 0,
968
+ perPage: 0,
969
+ to: 0,
970
+ data: [],
971
+ };
972
+ }
973
+ export const OrderPagination = {
974
+ encode(message, writer = new BinaryWriter()) {
975
+ if (message.currentPage !== 0) {
976
+ writer.uint32(8).uint32(message.currentPage);
977
+ }
978
+ if (message.firstPageUrl !== "") {
979
+ writer.uint32(18).string(message.firstPageUrl);
980
+ }
981
+ if (message.lastPageUrl !== "") {
982
+ writer.uint32(26).string(message.lastPageUrl);
983
+ }
984
+ if (message.nextPageUrl !== "") {
985
+ writer.uint32(34).string(message.nextPageUrl);
986
+ }
987
+ if (message.prevPageUrl !== "") {
988
+ writer.uint32(42).string(message.prevPageUrl);
989
+ }
990
+ if (message.path !== "") {
991
+ writer.uint32(50).string(message.path);
992
+ }
993
+ if (message.from !== 0) {
994
+ writer.uint32(56).uint32(message.from);
995
+ }
996
+ if (message.lastPage !== 0) {
997
+ writer.uint32(64).uint32(message.lastPage);
998
+ }
999
+ if (message.perPage !== 0) {
1000
+ writer.uint32(72).uint32(message.perPage);
1001
+ }
1002
+ if (message.to !== 0) {
1003
+ writer.uint32(80).uint32(message.to);
1004
+ }
1005
+ for (const v of message.data) {
1006
+ Order.encode(v, writer.uint32(90).fork()).join();
1007
+ }
1008
+ return writer;
1009
+ },
1010
+ decode(input, length) {
1011
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1012
+ const end = length === undefined ? reader.len : reader.pos + length;
1013
+ const message = createBaseOrderPagination();
1014
+ while (reader.pos < end) {
1015
+ const tag = reader.uint32();
1016
+ switch (tag >>> 3) {
1017
+ case 1: {
1018
+ if (tag !== 8) {
1019
+ break;
1020
+ }
1021
+ message.currentPage = reader.uint32();
1022
+ continue;
1023
+ }
1024
+ case 2: {
1025
+ if (tag !== 18) {
1026
+ break;
1027
+ }
1028
+ message.firstPageUrl = reader.string();
1029
+ continue;
1030
+ }
1031
+ case 3: {
1032
+ if (tag !== 26) {
1033
+ break;
1034
+ }
1035
+ message.lastPageUrl = reader.string();
1036
+ continue;
1037
+ }
1038
+ case 4: {
1039
+ if (tag !== 34) {
1040
+ break;
1041
+ }
1042
+ message.nextPageUrl = reader.string();
1043
+ continue;
1044
+ }
1045
+ case 5: {
1046
+ if (tag !== 42) {
1047
+ break;
1048
+ }
1049
+ message.prevPageUrl = reader.string();
1050
+ continue;
1051
+ }
1052
+ case 6: {
1053
+ if (tag !== 50) {
1054
+ break;
1055
+ }
1056
+ message.path = reader.string();
1057
+ continue;
1058
+ }
1059
+ case 7: {
1060
+ if (tag !== 56) {
1061
+ break;
1062
+ }
1063
+ message.from = reader.uint32();
1064
+ continue;
1065
+ }
1066
+ case 8: {
1067
+ if (tag !== 64) {
1068
+ break;
1069
+ }
1070
+ message.lastPage = reader.uint32();
1071
+ continue;
1072
+ }
1073
+ case 9: {
1074
+ if (tag !== 72) {
1075
+ break;
1076
+ }
1077
+ message.perPage = reader.uint32();
1078
+ continue;
1079
+ }
1080
+ case 10: {
1081
+ if (tag !== 80) {
1082
+ break;
1083
+ }
1084
+ message.to = reader.uint32();
1085
+ continue;
1086
+ }
1087
+ case 11: {
1088
+ if (tag !== 90) {
1089
+ break;
1090
+ }
1091
+ message.data.push(Order.decode(reader, reader.uint32()));
1092
+ continue;
1093
+ }
1094
+ }
1095
+ if ((tag & 7) === 4 || tag === 0) {
1096
+ break;
1097
+ }
1098
+ reader.skip(tag & 7);
1099
+ }
1100
+ return message;
1101
+ },
1102
+ create(base) {
1103
+ return OrderPagination.fromPartial(base ?? {});
1104
+ },
1105
+ fromPartial(object) {
1106
+ const message = createBaseOrderPagination();
1107
+ message.currentPage = object.currentPage ?? 0;
1108
+ message.firstPageUrl = object.firstPageUrl ?? "";
1109
+ message.lastPageUrl = object.lastPageUrl ?? "";
1110
+ message.nextPageUrl = object.nextPageUrl ?? "";
1111
+ message.prevPageUrl = object.prevPageUrl ?? "";
1112
+ message.path = object.path ?? "";
1113
+ message.from = object.from ?? 0;
1114
+ message.lastPage = object.lastPage ?? 0;
1115
+ message.perPage = object.perPage ?? 0;
1116
+ message.to = object.to ?? 0;
1117
+ message.data = object.data?.map((e) => Order.fromPartial(e)) || [];
1118
+ return message;
1119
+ },
1120
+ };
1121
+ function createBaseOrder() {
1122
+ return {
1123
+ id: Long.UZERO,
1124
+ uuid: "",
1125
+ organizationId: Long.UZERO,
1126
+ createdBy: undefined,
1127
+ paymentGatewayId: undefined,
1128
+ currencyId: undefined,
1129
+ partnerId: undefined,
1130
+ totalPrice: 0,
1131
+ tax: 0,
1132
+ taxPercent: 0,
1133
+ discount: 0,
1134
+ subtotal: 0,
1135
+ paymentUrl: undefined,
1136
+ transactionId: undefined,
1137
+ refId: undefined,
1138
+ paidAt: undefined,
1139
+ months: undefined,
1140
+ status: "",
1141
+ createdAt: undefined,
1142
+ updatedAt: undefined,
1143
+ products: [],
1144
+ partner: undefined,
1145
+ paymentGateway: undefined,
1146
+ currency: undefined,
1147
+ person: undefined,
1148
+ };
1149
+ }
1150
+ export const Order = {
1151
+ encode(message, writer = new BinaryWriter()) {
1152
+ if (!message.id.equals(Long.UZERO)) {
1153
+ writer.uint32(8).uint64(message.id.toString());
1154
+ }
1155
+ if (message.uuid !== "") {
1156
+ writer.uint32(18).string(message.uuid);
1157
+ }
1158
+ if (!message.organizationId.equals(Long.UZERO)) {
1159
+ writer.uint32(24).uint64(message.organizationId.toString());
1160
+ }
1161
+ if (message.createdBy !== undefined) {
1162
+ writer.uint32(32).uint64(message.createdBy.toString());
1163
+ }
1164
+ if (message.paymentGatewayId !== undefined) {
1165
+ writer.uint32(40).uint64(message.paymentGatewayId.toString());
1166
+ }
1167
+ if (message.currencyId !== undefined) {
1168
+ writer.uint32(48).uint64(message.currencyId.toString());
1169
+ }
1170
+ if (message.partnerId !== undefined) {
1171
+ writer.uint32(56).uint64(message.partnerId.toString());
1172
+ }
1173
+ if (message.totalPrice !== 0) {
1174
+ writer.uint32(65).double(message.totalPrice);
1175
+ }
1176
+ if (message.tax !== 0) {
1177
+ writer.uint32(73).double(message.tax);
1178
+ }
1179
+ if (message.taxPercent !== 0) {
1180
+ writer.uint32(80).uint32(message.taxPercent);
1181
+ }
1182
+ if (message.discount !== 0) {
1183
+ writer.uint32(89).double(message.discount);
1184
+ }
1185
+ if (message.subtotal !== 0) {
1186
+ writer.uint32(97).double(message.subtotal);
1187
+ }
1188
+ if (message.paymentUrl !== undefined) {
1189
+ writer.uint32(106).string(message.paymentUrl);
1190
+ }
1191
+ if (message.transactionId !== undefined) {
1192
+ writer.uint32(114).string(message.transactionId);
1193
+ }
1194
+ if (message.refId !== undefined) {
1195
+ writer.uint32(122).string(message.refId);
1196
+ }
1197
+ if (message.paidAt !== undefined) {
1198
+ Timestamp.encode(toTimestamp(message.paidAt), writer.uint32(130).fork()).join();
1199
+ }
1200
+ if (message.months !== undefined) {
1201
+ writer.uint32(136).uint32(message.months);
1202
+ }
1203
+ if (message.status !== "") {
1204
+ writer.uint32(146).string(message.status);
1205
+ }
1206
+ if (message.createdAt !== undefined) {
1207
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(154).fork()).join();
1208
+ }
1209
+ if (message.updatedAt !== undefined) {
1210
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(162).fork()).join();
1211
+ }
1212
+ for (const v of message.products) {
1213
+ OrderProduct.encode(v, writer.uint32(170).fork()).join();
1214
+ }
1215
+ if (message.partner !== undefined) {
1216
+ Partner.encode(message.partner, writer.uint32(178).fork()).join();
1217
+ }
1218
+ if (message.paymentGateway !== undefined) {
1219
+ PaymentGateway.encode(message.paymentGateway, writer.uint32(186).fork()).join();
1220
+ }
1221
+ if (message.currency !== undefined) {
1222
+ Currency.encode(message.currency, writer.uint32(194).fork()).join();
1223
+ }
1224
+ if (message.person !== undefined) {
1225
+ Person.encode(message.person, writer.uint32(202).fork()).join();
1226
+ }
1227
+ return writer;
1228
+ },
1229
+ decode(input, length) {
1230
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1231
+ const end = length === undefined ? reader.len : reader.pos + length;
1232
+ const message = createBaseOrder();
1233
+ while (reader.pos < end) {
1234
+ const tag = reader.uint32();
1235
+ switch (tag >>> 3) {
1236
+ case 1: {
1237
+ if (tag !== 8) {
1238
+ break;
1239
+ }
1240
+ message.id = Long.fromString(reader.uint64().toString(), true);
1241
+ continue;
1242
+ }
1243
+ case 2: {
1244
+ if (tag !== 18) {
1245
+ break;
1246
+ }
1247
+ message.uuid = reader.string();
1248
+ continue;
1249
+ }
1250
+ case 3: {
1251
+ if (tag !== 24) {
1252
+ break;
1253
+ }
1254
+ message.organizationId = Long.fromString(reader.uint64().toString(), true);
1255
+ continue;
1256
+ }
1257
+ case 4: {
1258
+ if (tag !== 32) {
1259
+ break;
1260
+ }
1261
+ message.createdBy = Long.fromString(reader.uint64().toString(), true);
1262
+ continue;
1263
+ }
1264
+ case 5: {
1265
+ if (tag !== 40) {
1266
+ break;
1267
+ }
1268
+ message.paymentGatewayId = Long.fromString(reader.uint64().toString(), true);
1269
+ continue;
1270
+ }
1271
+ case 6: {
1272
+ if (tag !== 48) {
1273
+ break;
1274
+ }
1275
+ message.currencyId = Long.fromString(reader.uint64().toString(), true);
1276
+ continue;
1277
+ }
1278
+ case 7: {
1279
+ if (tag !== 56) {
1280
+ break;
1281
+ }
1282
+ message.partnerId = Long.fromString(reader.uint64().toString(), true);
1283
+ continue;
1284
+ }
1285
+ case 8: {
1286
+ if (tag !== 65) {
1287
+ break;
1288
+ }
1289
+ message.totalPrice = reader.double();
1290
+ continue;
1291
+ }
1292
+ case 9: {
1293
+ if (tag !== 73) {
1294
+ break;
1295
+ }
1296
+ message.tax = reader.double();
1297
+ continue;
1298
+ }
1299
+ case 10: {
1300
+ if (tag !== 80) {
1301
+ break;
1302
+ }
1303
+ message.taxPercent = reader.uint32();
1304
+ continue;
1305
+ }
1306
+ case 11: {
1307
+ if (tag !== 89) {
1308
+ break;
1309
+ }
1310
+ message.discount = reader.double();
1311
+ continue;
1312
+ }
1313
+ case 12: {
1314
+ if (tag !== 97) {
1315
+ break;
1316
+ }
1317
+ message.subtotal = reader.double();
1318
+ continue;
1319
+ }
1320
+ case 13: {
1321
+ if (tag !== 106) {
1322
+ break;
1323
+ }
1324
+ message.paymentUrl = reader.string();
1325
+ continue;
1326
+ }
1327
+ case 14: {
1328
+ if (tag !== 114) {
1329
+ break;
1330
+ }
1331
+ message.transactionId = reader.string();
1332
+ continue;
1333
+ }
1334
+ case 15: {
1335
+ if (tag !== 122) {
1336
+ break;
1337
+ }
1338
+ message.refId = reader.string();
1339
+ continue;
1340
+ }
1341
+ case 16: {
1342
+ if (tag !== 130) {
1343
+ break;
1344
+ }
1345
+ message.paidAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1346
+ continue;
1347
+ }
1348
+ case 17: {
1349
+ if (tag !== 136) {
1350
+ break;
1351
+ }
1352
+ message.months = reader.uint32();
1353
+ continue;
1354
+ }
1355
+ case 18: {
1356
+ if (tag !== 146) {
1357
+ break;
1358
+ }
1359
+ message.status = reader.string();
1360
+ continue;
1361
+ }
1362
+ case 19: {
1363
+ if (tag !== 154) {
1364
+ break;
1365
+ }
1366
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1367
+ continue;
1368
+ }
1369
+ case 20: {
1370
+ if (tag !== 162) {
1371
+ break;
1372
+ }
1373
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1374
+ continue;
1375
+ }
1376
+ case 21: {
1377
+ if (tag !== 170) {
1378
+ break;
1379
+ }
1380
+ message.products.push(OrderProduct.decode(reader, reader.uint32()));
1381
+ continue;
1382
+ }
1383
+ case 22: {
1384
+ if (tag !== 178) {
1385
+ break;
1386
+ }
1387
+ message.partner = Partner.decode(reader, reader.uint32());
1388
+ continue;
1389
+ }
1390
+ case 23: {
1391
+ if (tag !== 186) {
1392
+ break;
1393
+ }
1394
+ message.paymentGateway = PaymentGateway.decode(reader, reader.uint32());
1395
+ continue;
1396
+ }
1397
+ case 24: {
1398
+ if (tag !== 194) {
1399
+ break;
1400
+ }
1401
+ message.currency = Currency.decode(reader, reader.uint32());
1402
+ continue;
1403
+ }
1404
+ case 25: {
1405
+ if (tag !== 202) {
1406
+ break;
1407
+ }
1408
+ message.person = Person.decode(reader, reader.uint32());
1409
+ continue;
1410
+ }
1411
+ }
1412
+ if ((tag & 7) === 4 || tag === 0) {
1413
+ break;
1414
+ }
1415
+ reader.skip(tag & 7);
1416
+ }
1417
+ return message;
1418
+ },
1419
+ create(base) {
1420
+ return Order.fromPartial(base ?? {});
1421
+ },
1422
+ fromPartial(object) {
1423
+ const message = createBaseOrder();
1424
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1425
+ message.uuid = object.uuid ?? "";
1426
+ message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1427
+ ? Long.fromValue(object.organizationId)
1428
+ : Long.UZERO;
1429
+ message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
1430
+ ? Long.fromValue(object.createdBy)
1431
+ : undefined;
1432
+ message.paymentGatewayId = (object.paymentGatewayId !== undefined && object.paymentGatewayId !== null)
1433
+ ? Long.fromValue(object.paymentGatewayId)
1434
+ : undefined;
1435
+ message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
1436
+ ? Long.fromValue(object.currencyId)
1437
+ : undefined;
1438
+ message.partnerId = (object.partnerId !== undefined && object.partnerId !== null)
1439
+ ? Long.fromValue(object.partnerId)
1440
+ : undefined;
1441
+ message.totalPrice = object.totalPrice ?? 0;
1442
+ message.tax = object.tax ?? 0;
1443
+ message.taxPercent = object.taxPercent ?? 0;
1444
+ message.discount = object.discount ?? 0;
1445
+ message.subtotal = object.subtotal ?? 0;
1446
+ message.paymentUrl = object.paymentUrl ?? undefined;
1447
+ message.transactionId = object.transactionId ?? undefined;
1448
+ message.refId = object.refId ?? undefined;
1449
+ message.paidAt = object.paidAt ?? undefined;
1450
+ message.months = object.months ?? undefined;
1451
+ message.status = object.status ?? "";
1452
+ message.createdAt = object.createdAt ?? undefined;
1453
+ message.updatedAt = object.updatedAt ?? undefined;
1454
+ message.products = object.products?.map((e) => OrderProduct.fromPartial(e)) || [];
1455
+ message.partner = (object.partner !== undefined && object.partner !== null)
1456
+ ? Partner.fromPartial(object.partner)
1457
+ : undefined;
1458
+ message.paymentGateway = (object.paymentGateway !== undefined && object.paymentGateway !== null)
1459
+ ? PaymentGateway.fromPartial(object.paymentGateway)
1460
+ : undefined;
1461
+ message.currency = (object.currency !== undefined && object.currency !== null)
1462
+ ? Currency.fromPartial(object.currency)
1463
+ : undefined;
1464
+ message.person = (object.person !== undefined && object.person !== null)
1465
+ ? Person.fromPartial(object.person)
1466
+ : undefined;
1467
+ return message;
1468
+ },
1469
+ };
1470
+ function createBaseOrderProduct() {
1471
+ return {
1472
+ id: Long.UZERO,
1473
+ orderId: undefined,
1474
+ productId: undefined,
1475
+ productType: "",
1476
+ productName: "",
1477
+ productDetail: "",
1478
+ currencyId: undefined,
1479
+ discountPercent: undefined,
1480
+ taxPrice: 0,
1481
+ discount: 0,
1482
+ price: 0,
1483
+ months: undefined,
1484
+ createdAt: undefined,
1485
+ updatedAt: undefined,
1486
+ product: undefined,
1487
+ };
1488
+ }
1489
+ export const OrderProduct = {
1490
+ encode(message, writer = new BinaryWriter()) {
1491
+ if (!message.id.equals(Long.UZERO)) {
1492
+ writer.uint32(8).uint64(message.id.toString());
1493
+ }
1494
+ if (message.orderId !== undefined) {
1495
+ writer.uint32(16).uint64(message.orderId.toString());
1496
+ }
1497
+ if (message.productId !== undefined) {
1498
+ writer.uint32(24).uint64(message.productId.toString());
1499
+ }
1500
+ if (message.productType !== "") {
1501
+ writer.uint32(34).string(message.productType);
1502
+ }
1503
+ if (message.productName !== "") {
1504
+ writer.uint32(42).string(message.productName);
1505
+ }
1506
+ if (message.productDetail !== "") {
1507
+ writer.uint32(50).string(message.productDetail);
1508
+ }
1509
+ if (message.currencyId !== undefined) {
1510
+ writer.uint32(56).uint64(message.currencyId.toString());
1511
+ }
1512
+ if (message.discountPercent !== undefined) {
1513
+ writer.uint32(64).uint32(message.discountPercent);
1514
+ }
1515
+ if (message.taxPrice !== 0) {
1516
+ writer.uint32(73).double(message.taxPrice);
1517
+ }
1518
+ if (message.discount !== 0) {
1519
+ writer.uint32(81).double(message.discount);
1520
+ }
1521
+ if (message.price !== 0) {
1522
+ writer.uint32(89).double(message.price);
1523
+ }
1524
+ if (message.months !== undefined) {
1525
+ writer.uint32(96).uint32(message.months);
1526
+ }
1527
+ if (message.createdAt !== undefined) {
1528
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(106).fork()).join();
1529
+ }
1530
+ if (message.updatedAt !== undefined) {
1531
+ Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(114).fork()).join();
1532
+ }
1533
+ if (message.product !== undefined) {
1534
+ Product.encode(message.product, writer.uint32(122).fork()).join();
1535
+ }
1536
+ return writer;
1537
+ },
1538
+ decode(input, length) {
1539
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1540
+ const end = length === undefined ? reader.len : reader.pos + length;
1541
+ const message = createBaseOrderProduct();
1542
+ while (reader.pos < end) {
1543
+ const tag = reader.uint32();
1544
+ switch (tag >>> 3) {
1545
+ case 1: {
1546
+ if (tag !== 8) {
1547
+ break;
1548
+ }
1549
+ message.id = Long.fromString(reader.uint64().toString(), true);
1550
+ continue;
1551
+ }
1552
+ case 2: {
1553
+ if (tag !== 16) {
1554
+ break;
1555
+ }
1556
+ message.orderId = Long.fromString(reader.uint64().toString(), true);
1557
+ continue;
1558
+ }
1559
+ case 3: {
1560
+ if (tag !== 24) {
1561
+ break;
1562
+ }
1563
+ message.productId = Long.fromString(reader.uint64().toString(), true);
1564
+ continue;
1565
+ }
1566
+ case 4: {
1567
+ if (tag !== 34) {
1568
+ break;
1569
+ }
1570
+ message.productType = reader.string();
1571
+ continue;
1572
+ }
1573
+ case 5: {
1574
+ if (tag !== 42) {
1575
+ break;
1576
+ }
1577
+ message.productName = reader.string();
1578
+ continue;
1579
+ }
1580
+ case 6: {
1581
+ if (tag !== 50) {
1582
+ break;
1583
+ }
1584
+ message.productDetail = reader.string();
1585
+ continue;
1586
+ }
1587
+ case 7: {
1588
+ if (tag !== 56) {
1589
+ break;
1590
+ }
1591
+ message.currencyId = Long.fromString(reader.uint64().toString(), true);
1592
+ continue;
1593
+ }
1594
+ case 8: {
1595
+ if (tag !== 64) {
1596
+ break;
1597
+ }
1598
+ message.discountPercent = reader.uint32();
1599
+ continue;
1600
+ }
1601
+ case 9: {
1602
+ if (tag !== 73) {
1603
+ break;
1604
+ }
1605
+ message.taxPrice = reader.double();
1606
+ continue;
1607
+ }
1608
+ case 10: {
1609
+ if (tag !== 81) {
1610
+ break;
1611
+ }
1612
+ message.discount = reader.double();
1613
+ continue;
1614
+ }
1615
+ case 11: {
1616
+ if (tag !== 89) {
1617
+ break;
1618
+ }
1619
+ message.price = reader.double();
1620
+ continue;
1621
+ }
1622
+ case 12: {
1623
+ if (tag !== 96) {
1624
+ break;
1625
+ }
1626
+ message.months = reader.uint32();
1627
+ continue;
1628
+ }
1629
+ case 13: {
1630
+ if (tag !== 106) {
1631
+ break;
1632
+ }
1633
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1634
+ continue;
1635
+ }
1636
+ case 14: {
1637
+ if (tag !== 114) {
1638
+ break;
1639
+ }
1640
+ message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1641
+ continue;
1642
+ }
1643
+ case 15: {
1644
+ if (tag !== 122) {
1645
+ break;
1646
+ }
1647
+ message.product = Product.decode(reader, reader.uint32());
1648
+ continue;
1649
+ }
1650
+ }
1651
+ if ((tag & 7) === 4 || tag === 0) {
1652
+ break;
1653
+ }
1654
+ reader.skip(tag & 7);
1655
+ }
1656
+ return message;
1657
+ },
1658
+ create(base) {
1659
+ return OrderProduct.fromPartial(base ?? {});
1660
+ },
1661
+ fromPartial(object) {
1662
+ const message = createBaseOrderProduct();
1663
+ message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1664
+ message.orderId = (object.orderId !== undefined && object.orderId !== null)
1665
+ ? Long.fromValue(object.orderId)
1666
+ : undefined;
1667
+ message.productId = (object.productId !== undefined && object.productId !== null)
1668
+ ? Long.fromValue(object.productId)
1669
+ : undefined;
1670
+ message.productType = object.productType ?? "";
1671
+ message.productName = object.productName ?? "";
1672
+ message.productDetail = object.productDetail ?? "";
1673
+ message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
1674
+ ? Long.fromValue(object.currencyId)
1675
+ : undefined;
1676
+ message.discountPercent = object.discountPercent ?? undefined;
1677
+ message.taxPrice = object.taxPrice ?? 0;
1678
+ message.discount = object.discount ?? 0;
1679
+ message.price = object.price ?? 0;
1680
+ message.months = object.months ?? undefined;
1681
+ message.createdAt = object.createdAt ?? undefined;
1682
+ message.updatedAt = object.updatedAt ?? undefined;
1683
+ message.product = (object.product !== undefined && object.product !== null)
1684
+ ? Product.fromPartial(object.product)
1685
+ : undefined;
1686
+ return message;
1687
+ },
1688
+ };
1689
+ function toTimestamp(date) {
1690
+ const seconds = numberToLong(Math.trunc(date.getTime() / 1_000));
1691
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
1692
+ return { seconds, nanos };
1693
+ }
1694
+ function fromTimestamp(t) {
1695
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
1696
+ millis += (t.nanos || 0) / 1_000_000;
1697
+ return new globalThis.Date(millis);
1698
+ }
1699
+ function numberToLong(number) {
1700
+ return Long.fromNumber(number);
1701
+ }