@fatehan/tsrp 1.4.30 → 1.4.35

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 (47) hide show
  1. package/dist/api.d.ts +4 -0
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/api.js +16 -0
  4. package/dist/fatehan/activities/camera.js +11 -11
  5. package/dist/fatehan/activities/workflow.js +18 -18
  6. package/dist/fatehan/apis/client.d.ts +1 -67
  7. package/dist/fatehan/apis/client.d.ts.map +1 -1
  8. package/dist/fatehan/apis/client.js +24 -1075
  9. package/dist/fatehan/areas/area.js +7 -7
  10. package/dist/fatehan/devices/devices.d.ts +15 -0
  11. package/dist/fatehan/devices/devices.d.ts.map +1 -1
  12. package/dist/fatehan/devices/devices.js +270 -32
  13. package/dist/fatehan/devices/maintenance.js +3 -3
  14. package/dist/fatehan/financial/financial.js +11 -11
  15. package/dist/fatehan/google/error_details.d.ts +421 -0
  16. package/dist/fatehan/google/error_details.d.ts.map +1 -0
  17. package/dist/fatehan/google/error_details.js +1296 -0
  18. package/dist/fatehan/google/protobuf/any.d.ts +146 -0
  19. package/dist/fatehan/google/protobuf/any.d.ts.map +1 -0
  20. package/dist/fatehan/google/protobuf/any.js +108 -0
  21. package/dist/fatehan/google/protobuf/descriptor.js +35 -35
  22. package/dist/fatehan/google/protobuf/duration.js +2 -2
  23. package/dist/fatehan/google/protobuf/field_mask.js +2 -2
  24. package/dist/fatehan/google/protobuf/timestamp.js +2 -2
  25. package/dist/fatehan/google/status.d.ts +53 -0
  26. package/dist/fatehan/google/status.d.ts.map +1 -0
  27. package/dist/fatehan/google/status.js +100 -0
  28. package/dist/fatehan/identities/authentication.js +10 -10
  29. package/dist/fatehan/identities/identities.d.ts +6 -0
  30. package/dist/fatehan/identities/identities.d.ts.map +1 -1
  31. package/dist/fatehan/identities/identities.js +44 -13
  32. package/dist/fatehan/models/fusion.js +9 -9
  33. package/dist/fatehan/models/models.js +14 -14
  34. package/dist/fatehan/notifies/notify.js +33 -33
  35. package/dist/fatehan/packets/dataModel.js +55 -55
  36. package/dist/fatehan/packets/dataModule.js +6 -6
  37. package/dist/fatehan/packets/messages.js +9 -9
  38. package/dist/fatehan/reports/report.d.ts +3 -0
  39. package/dist/fatehan/reports/report.d.ts.map +1 -1
  40. package/dist/fatehan/reports/report.js +203 -155
  41. package/dist/fatehan/services/api.d.ts +41 -1
  42. package/dist/fatehan/services/api.d.ts.map +1 -1
  43. package/dist/fatehan/services/api.js +613 -48
  44. package/dist/fatehan/services/repositories.js +9 -9
  45. package/dist/fatehan/trips/trip.js +19 -19
  46. package/dist/fatehan/utils/buf/validate/validate.js +33 -33
  47. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.7.5
4
+ // protoc-gen-ts_proto v2.7.0
5
5
  // protoc v6.31.1
6
6
  // source: apis/client.proto
7
7
  var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  return (mod && mod.__esModule) ? mod : { "default": mod };
9
9
  };
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.ServicePagination = exports.MaintenancePagination = exports.LiveLocationPagination = exports.CommandPagination = exports.Session = exports.TrackerPagination = exports.SessionPagination = exports.NotificationPagination = exports.NotificationFull_RawData = exports.NotificationFull = exports.TopRepeatedNotification = exports.Statistics = exports.Channel = exports.OrderProduct = exports.Order = exports.OrderPagination = exports.Partner = exports.Transaction = exports.TransactionPagination = exports.ConfigList = exports.Config = exports.DevicePagination = exports.Me = exports.VersionCheck = exports.UserPagination = exports.MessageOnly = exports.protobufPackage = void 0;
11
+ exports.ServicePagination = exports.MaintenancePagination = exports.LiveLocationPagination = exports.CommandPagination = exports.Session = exports.TrackerPagination = exports.SessionPagination = exports.NotificationPagination = exports.NotificationFull_RawData = exports.NotificationFull = exports.TopRepeatedNotification = exports.Statistics = exports.Channel = exports.Transaction = exports.TransactionPagination = exports.ConfigList = exports.Config = exports.DevicePagination = exports.Me = exports.VersionCheck = exports.UserPagination = exports.MessageOnly = exports.protobufPackage = void 0;
12
12
  /* eslint-disable */
13
13
  const wire_1 = require("@bufbuild/protobuf/wire");
14
14
  const long_1 = __importDefault(require("long"));
@@ -33,7 +33,7 @@ exports.MessageOnly = {
33
33
  },
34
34
  decode(input, length) {
35
35
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
36
- const end = length === undefined ? reader.len : reader.pos + length;
36
+ let end = length === undefined ? reader.len : reader.pos + length;
37
37
  const message = createBaseMessageOnly();
38
38
  while (reader.pos < end) {
39
39
  const tag = reader.uint32();
@@ -127,7 +127,7 @@ exports.UserPagination = {
127
127
  },
128
128
  decode(input, length) {
129
129
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
130
- const end = length === undefined ? reader.len : reader.pos + length;
130
+ let end = length === undefined ? reader.len : reader.pos + length;
131
131
  const message = createBaseUserPagination();
132
132
  while (reader.pos < end) {
133
133
  const tag = reader.uint32();
@@ -317,7 +317,7 @@ exports.VersionCheck = {
317
317
  },
318
318
  decode(input, length) {
319
319
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
320
- const end = length === undefined ? reader.len : reader.pos + length;
320
+ let end = length === undefined ? reader.len : reader.pos + length;
321
321
  const message = createBaseVersionCheck();
322
322
  while (reader.pos < end) {
323
323
  const tag = reader.uint32();
@@ -446,7 +446,7 @@ exports.Me = {
446
446
  },
447
447
  decode(input, length) {
448
448
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
449
- const end = length === undefined ? reader.len : reader.pos + length;
449
+ let end = length === undefined ? reader.len : reader.pos + length;
450
450
  const message = createBaseMe();
451
451
  while (reader.pos < end) {
452
452
  const tag = reader.uint32();
@@ -609,7 +609,7 @@ exports.DevicePagination = {
609
609
  },
610
610
  decode(input, length) {
611
611
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
612
- const end = length === undefined ? reader.len : reader.pos + length;
612
+ let end = length === undefined ? reader.len : reader.pos + length;
613
613
  const message = createBaseDevicePagination();
614
614
  while (reader.pos < end) {
615
615
  const tag = reader.uint32();
@@ -814,7 +814,7 @@ exports.Config = {
814
814
  },
815
815
  decode(input, length) {
816
816
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
817
- const end = length === undefined ? reader.len : reader.pos + length;
817
+ let end = length === undefined ? reader.len : reader.pos + length;
818
818
  const message = createBaseConfig();
819
819
  while (reader.pos < end) {
820
820
  const tag = reader.uint32();
@@ -958,7 +958,7 @@ exports.ConfigList = {
958
958
  },
959
959
  decode(input, length) {
960
960
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
961
- const end = length === undefined ? reader.len : reader.pos + length;
961
+ let end = length === undefined ? reader.len : reader.pos + length;
962
962
  const message = createBaseConfigList();
963
963
  while (reader.pos < end) {
964
964
  const tag = reader.uint32();
@@ -1055,7 +1055,7 @@ exports.TransactionPagination = {
1055
1055
  },
1056
1056
  decode(input, length) {
1057
1057
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1058
- const end = length === undefined ? reader.len : reader.pos + length;
1058
+ let end = length === undefined ? reader.len : reader.pos + length;
1059
1059
  const message = createBaseTransactionPagination();
1060
1060
  while (reader.pos < end) {
1061
1061
  const tag = reader.uint32();
@@ -1292,7 +1292,7 @@ exports.Transaction = {
1292
1292
  },
1293
1293
  decode(input, length) {
1294
1294
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1295
- const end = length === undefined ? reader.len : reader.pos + length;
1295
+ let end = length === undefined ? reader.len : reader.pos + length;
1296
1296
  const message = createBaseTransaction();
1297
1297
  while (reader.pos < end) {
1298
1298
  const tag = reader.uint32();
@@ -1530,1057 +1530,6 @@ exports.Transaction = {
1530
1530
  return message;
1531
1531
  },
1532
1532
  };
1533
- function createBasePartner() {
1534
- return { id: long_1.default.UZERO, name: undefined, domains: [] };
1535
- }
1536
- exports.Partner = {
1537
- encode(message, writer = new wire_1.BinaryWriter()) {
1538
- if (!message.id.equals(long_1.default.UZERO)) {
1539
- writer.uint32(8).uint64(message.id.toString());
1540
- }
1541
- if (message.name !== undefined) {
1542
- writer.uint32(26).string(message.name);
1543
- }
1544
- for (const v of message.domains) {
1545
- writer.uint32(18).string(v);
1546
- }
1547
- return writer;
1548
- },
1549
- decode(input, length) {
1550
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1551
- const end = length === undefined ? reader.len : reader.pos + length;
1552
- const message = createBasePartner();
1553
- while (reader.pos < end) {
1554
- const tag = reader.uint32();
1555
- switch (tag >>> 3) {
1556
- case 1: {
1557
- if (tag !== 8) {
1558
- break;
1559
- }
1560
- message.id = long_1.default.fromString(reader.uint64().toString(), true);
1561
- continue;
1562
- }
1563
- case 3: {
1564
- if (tag !== 26) {
1565
- break;
1566
- }
1567
- message.name = reader.string();
1568
- continue;
1569
- }
1570
- case 2: {
1571
- if (tag !== 18) {
1572
- break;
1573
- }
1574
- message.domains.push(reader.string());
1575
- continue;
1576
- }
1577
- }
1578
- if ((tag & 7) === 4 || tag === 0) {
1579
- break;
1580
- }
1581
- reader.skip(tag & 7);
1582
- }
1583
- return message;
1584
- },
1585
- fromJSON(object) {
1586
- return {
1587
- id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
1588
- name: isSet(object.name) ? globalThis.String(object.name) : undefined,
1589
- domains: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.domains) ? object.domains.map((e) => globalThis.String(e)) : [],
1590
- };
1591
- },
1592
- toJSON(message) {
1593
- var _a;
1594
- const obj = {};
1595
- if (!message.id.equals(long_1.default.UZERO)) {
1596
- obj.id = (message.id || long_1.default.UZERO).toString();
1597
- }
1598
- if (message.name !== undefined) {
1599
- obj.name = message.name;
1600
- }
1601
- if ((_a = message.domains) === null || _a === void 0 ? void 0 : _a.length) {
1602
- obj.domains = message.domains;
1603
- }
1604
- return obj;
1605
- },
1606
- create(base) {
1607
- return exports.Partner.fromPartial(base !== null && base !== void 0 ? base : {});
1608
- },
1609
- fromPartial(object) {
1610
- var _a, _b;
1611
- const message = createBasePartner();
1612
- message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
1613
- message.name = (_a = object.name) !== null && _a !== void 0 ? _a : undefined;
1614
- message.domains = ((_b = object.domains) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
1615
- return message;
1616
- },
1617
- };
1618
- function createBaseOrderPagination() {
1619
- return {
1620
- currentPage: 0,
1621
- firstPageUrl: "",
1622
- lastPageUrl: "",
1623
- nextPageUrl: "",
1624
- prevPageUrl: "",
1625
- path: "",
1626
- from: 0,
1627
- lastPage: 0,
1628
- perPage: 0,
1629
- to: 0,
1630
- data: [],
1631
- };
1632
- }
1633
- exports.OrderPagination = {
1634
- encode(message, writer = new wire_1.BinaryWriter()) {
1635
- if (message.currentPage !== 0) {
1636
- writer.uint32(8).uint32(message.currentPage);
1637
- }
1638
- if (message.firstPageUrl !== "") {
1639
- writer.uint32(18).string(message.firstPageUrl);
1640
- }
1641
- if (message.lastPageUrl !== "") {
1642
- writer.uint32(26).string(message.lastPageUrl);
1643
- }
1644
- if (message.nextPageUrl !== "") {
1645
- writer.uint32(34).string(message.nextPageUrl);
1646
- }
1647
- if (message.prevPageUrl !== "") {
1648
- writer.uint32(42).string(message.prevPageUrl);
1649
- }
1650
- if (message.path !== "") {
1651
- writer.uint32(50).string(message.path);
1652
- }
1653
- if (message.from !== 0) {
1654
- writer.uint32(56).uint32(message.from);
1655
- }
1656
- if (message.lastPage !== 0) {
1657
- writer.uint32(64).uint32(message.lastPage);
1658
- }
1659
- if (message.perPage !== 0) {
1660
- writer.uint32(72).uint32(message.perPage);
1661
- }
1662
- if (message.to !== 0) {
1663
- writer.uint32(80).uint32(message.to);
1664
- }
1665
- for (const v of message.data) {
1666
- exports.Order.encode(v, writer.uint32(90).fork()).join();
1667
- }
1668
- return writer;
1669
- },
1670
- decode(input, length) {
1671
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1672
- const end = length === undefined ? reader.len : reader.pos + length;
1673
- const message = createBaseOrderPagination();
1674
- while (reader.pos < end) {
1675
- const tag = reader.uint32();
1676
- switch (tag >>> 3) {
1677
- case 1: {
1678
- if (tag !== 8) {
1679
- break;
1680
- }
1681
- message.currentPage = reader.uint32();
1682
- continue;
1683
- }
1684
- case 2: {
1685
- if (tag !== 18) {
1686
- break;
1687
- }
1688
- message.firstPageUrl = reader.string();
1689
- continue;
1690
- }
1691
- case 3: {
1692
- if (tag !== 26) {
1693
- break;
1694
- }
1695
- message.lastPageUrl = reader.string();
1696
- continue;
1697
- }
1698
- case 4: {
1699
- if (tag !== 34) {
1700
- break;
1701
- }
1702
- message.nextPageUrl = reader.string();
1703
- continue;
1704
- }
1705
- case 5: {
1706
- if (tag !== 42) {
1707
- break;
1708
- }
1709
- message.prevPageUrl = reader.string();
1710
- continue;
1711
- }
1712
- case 6: {
1713
- if (tag !== 50) {
1714
- break;
1715
- }
1716
- message.path = reader.string();
1717
- continue;
1718
- }
1719
- case 7: {
1720
- if (tag !== 56) {
1721
- break;
1722
- }
1723
- message.from = reader.uint32();
1724
- continue;
1725
- }
1726
- case 8: {
1727
- if (tag !== 64) {
1728
- break;
1729
- }
1730
- message.lastPage = reader.uint32();
1731
- continue;
1732
- }
1733
- case 9: {
1734
- if (tag !== 72) {
1735
- break;
1736
- }
1737
- message.perPage = reader.uint32();
1738
- continue;
1739
- }
1740
- case 10: {
1741
- if (tag !== 80) {
1742
- break;
1743
- }
1744
- message.to = reader.uint32();
1745
- continue;
1746
- }
1747
- case 11: {
1748
- if (tag !== 90) {
1749
- break;
1750
- }
1751
- message.data.push(exports.Order.decode(reader, reader.uint32()));
1752
- continue;
1753
- }
1754
- }
1755
- if ((tag & 7) === 4 || tag === 0) {
1756
- break;
1757
- }
1758
- reader.skip(tag & 7);
1759
- }
1760
- return message;
1761
- },
1762
- fromJSON(object) {
1763
- return {
1764
- currentPage: isSet(object.current_page) ? globalThis.Number(object.current_page) : 0,
1765
- firstPageUrl: isSet(object.first_page_url) ? globalThis.String(object.first_page_url) : "",
1766
- lastPageUrl: isSet(object.last_page_url) ? globalThis.String(object.last_page_url) : "",
1767
- nextPageUrl: isSet(object.next_page_url) ? globalThis.String(object.next_page_url) : "",
1768
- prevPageUrl: isSet(object.prev_page_url) ? globalThis.String(object.prev_page_url) : "",
1769
- path: isSet(object.path) ? globalThis.String(object.path) : "",
1770
- from: isSet(object.from) ? globalThis.Number(object.from) : 0,
1771
- lastPage: isSet(object.last_page) ? globalThis.Number(object.last_page) : 0,
1772
- perPage: isSet(object.per_page) ? globalThis.Number(object.per_page) : 0,
1773
- to: isSet(object.to) ? globalThis.Number(object.to) : 0,
1774
- data: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.data) ? object.data.map((e) => exports.Order.fromJSON(e)) : [],
1775
- };
1776
- },
1777
- toJSON(message) {
1778
- var _a;
1779
- const obj = {};
1780
- if (message.currentPage !== 0) {
1781
- obj.current_page = Math.round(message.currentPage);
1782
- }
1783
- if (message.firstPageUrl !== "") {
1784
- obj.first_page_url = message.firstPageUrl;
1785
- }
1786
- if (message.lastPageUrl !== "") {
1787
- obj.last_page_url = message.lastPageUrl;
1788
- }
1789
- if (message.nextPageUrl !== "") {
1790
- obj.next_page_url = message.nextPageUrl;
1791
- }
1792
- if (message.prevPageUrl !== "") {
1793
- obj.prev_page_url = message.prevPageUrl;
1794
- }
1795
- if (message.path !== "") {
1796
- obj.path = message.path;
1797
- }
1798
- if (message.from !== 0) {
1799
- obj.from = Math.round(message.from);
1800
- }
1801
- if (message.lastPage !== 0) {
1802
- obj.last_page = Math.round(message.lastPage);
1803
- }
1804
- if (message.perPage !== 0) {
1805
- obj.per_page = Math.round(message.perPage);
1806
- }
1807
- if (message.to !== 0) {
1808
- obj.to = Math.round(message.to);
1809
- }
1810
- if ((_a = message.data) === null || _a === void 0 ? void 0 : _a.length) {
1811
- obj.data = message.data.map((e) => exports.Order.toJSON(e));
1812
- }
1813
- return obj;
1814
- },
1815
- create(base) {
1816
- return exports.OrderPagination.fromPartial(base !== null && base !== void 0 ? base : {});
1817
- },
1818
- fromPartial(object) {
1819
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1820
- const message = createBaseOrderPagination();
1821
- message.currentPage = (_a = object.currentPage) !== null && _a !== void 0 ? _a : 0;
1822
- message.firstPageUrl = (_b = object.firstPageUrl) !== null && _b !== void 0 ? _b : "";
1823
- message.lastPageUrl = (_c = object.lastPageUrl) !== null && _c !== void 0 ? _c : "";
1824
- message.nextPageUrl = (_d = object.nextPageUrl) !== null && _d !== void 0 ? _d : "";
1825
- message.prevPageUrl = (_e = object.prevPageUrl) !== null && _e !== void 0 ? _e : "";
1826
- message.path = (_f = object.path) !== null && _f !== void 0 ? _f : "";
1827
- message.from = (_g = object.from) !== null && _g !== void 0 ? _g : 0;
1828
- message.lastPage = (_h = object.lastPage) !== null && _h !== void 0 ? _h : 0;
1829
- message.perPage = (_j = object.perPage) !== null && _j !== void 0 ? _j : 0;
1830
- message.to = (_k = object.to) !== null && _k !== void 0 ? _k : 0;
1831
- message.data = ((_l = object.data) === null || _l === void 0 ? void 0 : _l.map((e) => exports.Order.fromPartial(e))) || [];
1832
- return message;
1833
- },
1834
- };
1835
- function createBaseOrder() {
1836
- return {
1837
- id: long_1.default.UZERO,
1838
- uuid: "",
1839
- organizationId: long_1.default.UZERO,
1840
- createdBy: undefined,
1841
- paymentGatewayId: undefined,
1842
- currencyId: undefined,
1843
- partnerId: undefined,
1844
- totalPrice: 0,
1845
- tax: 0,
1846
- taxPercent: 0,
1847
- discount: 0,
1848
- subtotal: 0,
1849
- paymentUrl: undefined,
1850
- transactionId: undefined,
1851
- refId: undefined,
1852
- paidAt: undefined,
1853
- months: undefined,
1854
- status: "",
1855
- createdAt: undefined,
1856
- updatedAt: undefined,
1857
- products: [],
1858
- partner: undefined,
1859
- paymentGateway: undefined,
1860
- currency: undefined,
1861
- person: undefined,
1862
- };
1863
- }
1864
- exports.Order = {
1865
- encode(message, writer = new wire_1.BinaryWriter()) {
1866
- if (!message.id.equals(long_1.default.UZERO)) {
1867
- writer.uint32(8).uint64(message.id.toString());
1868
- }
1869
- if (message.uuid !== "") {
1870
- writer.uint32(18).string(message.uuid);
1871
- }
1872
- if (!message.organizationId.equals(long_1.default.UZERO)) {
1873
- writer.uint32(24).uint64(message.organizationId.toString());
1874
- }
1875
- if (message.createdBy !== undefined) {
1876
- writer.uint32(32).uint64(message.createdBy.toString());
1877
- }
1878
- if (message.paymentGatewayId !== undefined) {
1879
- writer.uint32(40).uint64(message.paymentGatewayId.toString());
1880
- }
1881
- if (message.currencyId !== undefined) {
1882
- writer.uint32(48).uint64(message.currencyId.toString());
1883
- }
1884
- if (message.partnerId !== undefined) {
1885
- writer.uint32(56).uint64(message.partnerId.toString());
1886
- }
1887
- if (message.totalPrice !== 0) {
1888
- writer.uint32(65).double(message.totalPrice);
1889
- }
1890
- if (message.tax !== 0) {
1891
- writer.uint32(73).double(message.tax);
1892
- }
1893
- if (message.taxPercent !== 0) {
1894
- writer.uint32(80).uint32(message.taxPercent);
1895
- }
1896
- if (message.discount !== 0) {
1897
- writer.uint32(89).double(message.discount);
1898
- }
1899
- if (message.subtotal !== 0) {
1900
- writer.uint32(97).double(message.subtotal);
1901
- }
1902
- if (message.paymentUrl !== undefined) {
1903
- writer.uint32(106).string(message.paymentUrl);
1904
- }
1905
- if (message.transactionId !== undefined) {
1906
- writer.uint32(114).string(message.transactionId);
1907
- }
1908
- if (message.refId !== undefined) {
1909
- writer.uint32(122).string(message.refId);
1910
- }
1911
- if (message.paidAt !== undefined) {
1912
- timestamp_1.Timestamp.encode(toTimestamp(message.paidAt), writer.uint32(130).fork()).join();
1913
- }
1914
- if (message.months !== undefined) {
1915
- writer.uint32(136).uint32(message.months);
1916
- }
1917
- if (message.status !== "") {
1918
- writer.uint32(146).string(message.status);
1919
- }
1920
- if (message.createdAt !== undefined) {
1921
- timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(154).fork()).join();
1922
- }
1923
- if (message.updatedAt !== undefined) {
1924
- timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(162).fork()).join();
1925
- }
1926
- for (const v of message.products) {
1927
- exports.OrderProduct.encode(v, writer.uint32(170).fork()).join();
1928
- }
1929
- if (message.partner !== undefined) {
1930
- exports.Partner.encode(message.partner, writer.uint32(178).fork()).join();
1931
- }
1932
- if (message.paymentGateway !== undefined) {
1933
- financial_1.PaymentGateway.encode(message.paymentGateway, writer.uint32(186).fork()).join();
1934
- }
1935
- if (message.currency !== undefined) {
1936
- financial_1.Currency.encode(message.currency, writer.uint32(194).fork()).join();
1937
- }
1938
- if (message.person !== undefined) {
1939
- identities_1.Person.encode(message.person, writer.uint32(202).fork()).join();
1940
- }
1941
- return writer;
1942
- },
1943
- decode(input, length) {
1944
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1945
- const end = length === undefined ? reader.len : reader.pos + length;
1946
- const message = createBaseOrder();
1947
- while (reader.pos < end) {
1948
- const tag = reader.uint32();
1949
- switch (tag >>> 3) {
1950
- case 1: {
1951
- if (tag !== 8) {
1952
- break;
1953
- }
1954
- message.id = long_1.default.fromString(reader.uint64().toString(), true);
1955
- continue;
1956
- }
1957
- case 2: {
1958
- if (tag !== 18) {
1959
- break;
1960
- }
1961
- message.uuid = reader.string();
1962
- continue;
1963
- }
1964
- case 3: {
1965
- if (tag !== 24) {
1966
- break;
1967
- }
1968
- message.organizationId = long_1.default.fromString(reader.uint64().toString(), true);
1969
- continue;
1970
- }
1971
- case 4: {
1972
- if (tag !== 32) {
1973
- break;
1974
- }
1975
- message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
1976
- continue;
1977
- }
1978
- case 5: {
1979
- if (tag !== 40) {
1980
- break;
1981
- }
1982
- message.paymentGatewayId = long_1.default.fromString(reader.uint64().toString(), true);
1983
- continue;
1984
- }
1985
- case 6: {
1986
- if (tag !== 48) {
1987
- break;
1988
- }
1989
- message.currencyId = long_1.default.fromString(reader.uint64().toString(), true);
1990
- continue;
1991
- }
1992
- case 7: {
1993
- if (tag !== 56) {
1994
- break;
1995
- }
1996
- message.partnerId = long_1.default.fromString(reader.uint64().toString(), true);
1997
- continue;
1998
- }
1999
- case 8: {
2000
- if (tag !== 65) {
2001
- break;
2002
- }
2003
- message.totalPrice = reader.double();
2004
- continue;
2005
- }
2006
- case 9: {
2007
- if (tag !== 73) {
2008
- break;
2009
- }
2010
- message.tax = reader.double();
2011
- continue;
2012
- }
2013
- case 10: {
2014
- if (tag !== 80) {
2015
- break;
2016
- }
2017
- message.taxPercent = reader.uint32();
2018
- continue;
2019
- }
2020
- case 11: {
2021
- if (tag !== 89) {
2022
- break;
2023
- }
2024
- message.discount = reader.double();
2025
- continue;
2026
- }
2027
- case 12: {
2028
- if (tag !== 97) {
2029
- break;
2030
- }
2031
- message.subtotal = reader.double();
2032
- continue;
2033
- }
2034
- case 13: {
2035
- if (tag !== 106) {
2036
- break;
2037
- }
2038
- message.paymentUrl = reader.string();
2039
- continue;
2040
- }
2041
- case 14: {
2042
- if (tag !== 114) {
2043
- break;
2044
- }
2045
- message.transactionId = reader.string();
2046
- continue;
2047
- }
2048
- case 15: {
2049
- if (tag !== 122) {
2050
- break;
2051
- }
2052
- message.refId = reader.string();
2053
- continue;
2054
- }
2055
- case 16: {
2056
- if (tag !== 130) {
2057
- break;
2058
- }
2059
- message.paidAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2060
- continue;
2061
- }
2062
- case 17: {
2063
- if (tag !== 136) {
2064
- break;
2065
- }
2066
- message.months = reader.uint32();
2067
- continue;
2068
- }
2069
- case 18: {
2070
- if (tag !== 146) {
2071
- break;
2072
- }
2073
- message.status = reader.string();
2074
- continue;
2075
- }
2076
- case 19: {
2077
- if (tag !== 154) {
2078
- break;
2079
- }
2080
- message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2081
- continue;
2082
- }
2083
- case 20: {
2084
- if (tag !== 162) {
2085
- break;
2086
- }
2087
- message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2088
- continue;
2089
- }
2090
- case 21: {
2091
- if (tag !== 170) {
2092
- break;
2093
- }
2094
- message.products.push(exports.OrderProduct.decode(reader, reader.uint32()));
2095
- continue;
2096
- }
2097
- case 22: {
2098
- if (tag !== 178) {
2099
- break;
2100
- }
2101
- message.partner = exports.Partner.decode(reader, reader.uint32());
2102
- continue;
2103
- }
2104
- case 23: {
2105
- if (tag !== 186) {
2106
- break;
2107
- }
2108
- message.paymentGateway = financial_1.PaymentGateway.decode(reader, reader.uint32());
2109
- continue;
2110
- }
2111
- case 24: {
2112
- if (tag !== 194) {
2113
- break;
2114
- }
2115
- message.currency = financial_1.Currency.decode(reader, reader.uint32());
2116
- continue;
2117
- }
2118
- case 25: {
2119
- if (tag !== 202) {
2120
- break;
2121
- }
2122
- message.person = identities_1.Person.decode(reader, reader.uint32());
2123
- continue;
2124
- }
2125
- }
2126
- if ((tag & 7) === 4 || tag === 0) {
2127
- break;
2128
- }
2129
- reader.skip(tag & 7);
2130
- }
2131
- return message;
2132
- },
2133
- fromJSON(object) {
2134
- return {
2135
- id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
2136
- uuid: isSet(object.uuid) ? globalThis.String(object.uuid) : "",
2137
- organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
2138
- createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
2139
- paymentGatewayId: isSet(object.payment_gateway_id) ? long_1.default.fromValue(object.payment_gateway_id) : undefined,
2140
- currencyId: isSet(object.currency_id) ? long_1.default.fromValue(object.currency_id) : undefined,
2141
- partnerId: isSet(object.partner_id) ? long_1.default.fromValue(object.partner_id) : undefined,
2142
- totalPrice: isSet(object.total_price) ? globalThis.Number(object.total_price) : 0,
2143
- tax: isSet(object.tax) ? globalThis.Number(object.tax) : 0,
2144
- taxPercent: isSet(object.tax_percent) ? globalThis.Number(object.tax_percent) : 0,
2145
- discount: isSet(object.discount) ? globalThis.Number(object.discount) : 0,
2146
- subtotal: isSet(object.subtotal) ? globalThis.Number(object.subtotal) : 0,
2147
- paymentUrl: isSet(object.payment_url) ? globalThis.String(object.payment_url) : undefined,
2148
- transactionId: isSet(object.transaction_id) ? globalThis.String(object.transaction_id) : undefined,
2149
- refId: isSet(object.ref_id) ? globalThis.String(object.ref_id) : undefined,
2150
- paidAt: isSet(object.paid_at) ? fromJsonTimestamp(object.paid_at) : undefined,
2151
- months: isSet(object.months) ? globalThis.Number(object.months) : undefined,
2152
- status: isSet(object.status) ? globalThis.String(object.status) : "",
2153
- createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
2154
- updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
2155
- products: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.products)
2156
- ? object.products.map((e) => exports.OrderProduct.fromJSON(e))
2157
- : [],
2158
- partner: isSet(object.partner) ? exports.Partner.fromJSON(object.partner) : undefined,
2159
- paymentGateway: isSet(object.payment_gateway) ? financial_1.PaymentGateway.fromJSON(object.payment_gateway) : undefined,
2160
- currency: isSet(object.currency) ? financial_1.Currency.fromJSON(object.currency) : undefined,
2161
- person: isSet(object.person) ? identities_1.Person.fromJSON(object.person) : undefined,
2162
- };
2163
- },
2164
- toJSON(message) {
2165
- var _a;
2166
- const obj = {};
2167
- if (!message.id.equals(long_1.default.UZERO)) {
2168
- obj.id = (message.id || long_1.default.UZERO).toString();
2169
- }
2170
- if (message.uuid !== "") {
2171
- obj.uuid = message.uuid;
2172
- }
2173
- if (!message.organizationId.equals(long_1.default.UZERO)) {
2174
- obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
2175
- }
2176
- if (message.createdBy !== undefined) {
2177
- obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
2178
- }
2179
- if (message.paymentGatewayId !== undefined) {
2180
- obj.payment_gateway_id = (message.paymentGatewayId || long_1.default.UZERO).toString();
2181
- }
2182
- if (message.currencyId !== undefined) {
2183
- obj.currency_id = (message.currencyId || long_1.default.UZERO).toString();
2184
- }
2185
- if (message.partnerId !== undefined) {
2186
- obj.partner_id = (message.partnerId || long_1.default.UZERO).toString();
2187
- }
2188
- if (message.totalPrice !== 0) {
2189
- obj.total_price = message.totalPrice;
2190
- }
2191
- if (message.tax !== 0) {
2192
- obj.tax = message.tax;
2193
- }
2194
- if (message.taxPercent !== 0) {
2195
- obj.tax_percent = Math.round(message.taxPercent);
2196
- }
2197
- if (message.discount !== 0) {
2198
- obj.discount = message.discount;
2199
- }
2200
- if (message.subtotal !== 0) {
2201
- obj.subtotal = message.subtotal;
2202
- }
2203
- if (message.paymentUrl !== undefined) {
2204
- obj.payment_url = message.paymentUrl;
2205
- }
2206
- if (message.transactionId !== undefined) {
2207
- obj.transaction_id = message.transactionId;
2208
- }
2209
- if (message.refId !== undefined) {
2210
- obj.ref_id = message.refId;
2211
- }
2212
- if (message.paidAt !== undefined) {
2213
- obj.paid_at = message.paidAt.toISOString();
2214
- }
2215
- if (message.months !== undefined) {
2216
- obj.months = Math.round(message.months);
2217
- }
2218
- if (message.status !== "") {
2219
- obj.status = message.status;
2220
- }
2221
- if (message.createdAt !== undefined) {
2222
- obj.created_at = message.createdAt.toISOString();
2223
- }
2224
- if (message.updatedAt !== undefined) {
2225
- obj.updated_at = message.updatedAt.toISOString();
2226
- }
2227
- if ((_a = message.products) === null || _a === void 0 ? void 0 : _a.length) {
2228
- obj.products = message.products.map((e) => exports.OrderProduct.toJSON(e));
2229
- }
2230
- if (message.partner !== undefined) {
2231
- obj.partner = exports.Partner.toJSON(message.partner);
2232
- }
2233
- if (message.paymentGateway !== undefined) {
2234
- obj.payment_gateway = financial_1.PaymentGateway.toJSON(message.paymentGateway);
2235
- }
2236
- if (message.currency !== undefined) {
2237
- obj.currency = financial_1.Currency.toJSON(message.currency);
2238
- }
2239
- if (message.person !== undefined) {
2240
- obj.person = identities_1.Person.toJSON(message.person);
2241
- }
2242
- return obj;
2243
- },
2244
- create(base) {
2245
- return exports.Order.fromPartial(base !== null && base !== void 0 ? base : {});
2246
- },
2247
- fromPartial(object) {
2248
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
2249
- const message = createBaseOrder();
2250
- message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
2251
- message.uuid = (_a = object.uuid) !== null && _a !== void 0 ? _a : "";
2252
- message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
2253
- ? long_1.default.fromValue(object.organizationId)
2254
- : long_1.default.UZERO;
2255
- message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
2256
- ? long_1.default.fromValue(object.createdBy)
2257
- : undefined;
2258
- message.paymentGatewayId = (object.paymentGatewayId !== undefined && object.paymentGatewayId !== null)
2259
- ? long_1.default.fromValue(object.paymentGatewayId)
2260
- : undefined;
2261
- message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
2262
- ? long_1.default.fromValue(object.currencyId)
2263
- : undefined;
2264
- message.partnerId = (object.partnerId !== undefined && object.partnerId !== null)
2265
- ? long_1.default.fromValue(object.partnerId)
2266
- : undefined;
2267
- message.totalPrice = (_b = object.totalPrice) !== null && _b !== void 0 ? _b : 0;
2268
- message.tax = (_c = object.tax) !== null && _c !== void 0 ? _c : 0;
2269
- message.taxPercent = (_d = object.taxPercent) !== null && _d !== void 0 ? _d : 0;
2270
- message.discount = (_e = object.discount) !== null && _e !== void 0 ? _e : 0;
2271
- message.subtotal = (_f = object.subtotal) !== null && _f !== void 0 ? _f : 0;
2272
- message.paymentUrl = (_g = object.paymentUrl) !== null && _g !== void 0 ? _g : undefined;
2273
- message.transactionId = (_h = object.transactionId) !== null && _h !== void 0 ? _h : undefined;
2274
- message.refId = (_j = object.refId) !== null && _j !== void 0 ? _j : undefined;
2275
- message.paidAt = (_k = object.paidAt) !== null && _k !== void 0 ? _k : undefined;
2276
- message.months = (_l = object.months) !== null && _l !== void 0 ? _l : undefined;
2277
- message.status = (_m = object.status) !== null && _m !== void 0 ? _m : "";
2278
- message.createdAt = (_o = object.createdAt) !== null && _o !== void 0 ? _o : undefined;
2279
- message.updatedAt = (_p = object.updatedAt) !== null && _p !== void 0 ? _p : undefined;
2280
- message.products = ((_q = object.products) === null || _q === void 0 ? void 0 : _q.map((e) => exports.OrderProduct.fromPartial(e))) || [];
2281
- message.partner = (object.partner !== undefined && object.partner !== null)
2282
- ? exports.Partner.fromPartial(object.partner)
2283
- : undefined;
2284
- message.paymentGateway = (object.paymentGateway !== undefined && object.paymentGateway !== null)
2285
- ? financial_1.PaymentGateway.fromPartial(object.paymentGateway)
2286
- : undefined;
2287
- message.currency = (object.currency !== undefined && object.currency !== null)
2288
- ? financial_1.Currency.fromPartial(object.currency)
2289
- : undefined;
2290
- message.person = (object.person !== undefined && object.person !== null)
2291
- ? identities_1.Person.fromPartial(object.person)
2292
- : undefined;
2293
- return message;
2294
- },
2295
- };
2296
- function createBaseOrderProduct() {
2297
- return {
2298
- id: long_1.default.UZERO,
2299
- orderId: undefined,
2300
- productId: undefined,
2301
- productType: "",
2302
- productName: "",
2303
- productDetail: "",
2304
- currencyId: undefined,
2305
- discountPercent: undefined,
2306
- taxPrice: 0,
2307
- discount: 0,
2308
- price: 0,
2309
- months: undefined,
2310
- createdAt: undefined,
2311
- updatedAt: undefined,
2312
- product: undefined,
2313
- };
2314
- }
2315
- exports.OrderProduct = {
2316
- encode(message, writer = new wire_1.BinaryWriter()) {
2317
- if (!message.id.equals(long_1.default.UZERO)) {
2318
- writer.uint32(8).uint64(message.id.toString());
2319
- }
2320
- if (message.orderId !== undefined) {
2321
- writer.uint32(16).uint64(message.orderId.toString());
2322
- }
2323
- if (message.productId !== undefined) {
2324
- writer.uint32(24).uint64(message.productId.toString());
2325
- }
2326
- if (message.productType !== "") {
2327
- writer.uint32(34).string(message.productType);
2328
- }
2329
- if (message.productName !== "") {
2330
- writer.uint32(42).string(message.productName);
2331
- }
2332
- if (message.productDetail !== "") {
2333
- writer.uint32(50).string(message.productDetail);
2334
- }
2335
- if (message.currencyId !== undefined) {
2336
- writer.uint32(56).uint64(message.currencyId.toString());
2337
- }
2338
- if (message.discountPercent !== undefined) {
2339
- writer.uint32(64).uint32(message.discountPercent);
2340
- }
2341
- if (message.taxPrice !== 0) {
2342
- writer.uint32(73).double(message.taxPrice);
2343
- }
2344
- if (message.discount !== 0) {
2345
- writer.uint32(81).double(message.discount);
2346
- }
2347
- if (message.price !== 0) {
2348
- writer.uint32(89).double(message.price);
2349
- }
2350
- if (message.months !== undefined) {
2351
- writer.uint32(96).uint32(message.months);
2352
- }
2353
- if (message.createdAt !== undefined) {
2354
- timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(106).fork()).join();
2355
- }
2356
- if (message.updatedAt !== undefined) {
2357
- timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(114).fork()).join();
2358
- }
2359
- if (message.product !== undefined) {
2360
- financial_1.Product.encode(message.product, writer.uint32(122).fork()).join();
2361
- }
2362
- return writer;
2363
- },
2364
- decode(input, length) {
2365
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2366
- const end = length === undefined ? reader.len : reader.pos + length;
2367
- const message = createBaseOrderProduct();
2368
- while (reader.pos < end) {
2369
- const tag = reader.uint32();
2370
- switch (tag >>> 3) {
2371
- case 1: {
2372
- if (tag !== 8) {
2373
- break;
2374
- }
2375
- message.id = long_1.default.fromString(reader.uint64().toString(), true);
2376
- continue;
2377
- }
2378
- case 2: {
2379
- if (tag !== 16) {
2380
- break;
2381
- }
2382
- message.orderId = long_1.default.fromString(reader.uint64().toString(), true);
2383
- continue;
2384
- }
2385
- case 3: {
2386
- if (tag !== 24) {
2387
- break;
2388
- }
2389
- message.productId = long_1.default.fromString(reader.uint64().toString(), true);
2390
- continue;
2391
- }
2392
- case 4: {
2393
- if (tag !== 34) {
2394
- break;
2395
- }
2396
- message.productType = reader.string();
2397
- continue;
2398
- }
2399
- case 5: {
2400
- if (tag !== 42) {
2401
- break;
2402
- }
2403
- message.productName = reader.string();
2404
- continue;
2405
- }
2406
- case 6: {
2407
- if (tag !== 50) {
2408
- break;
2409
- }
2410
- message.productDetail = reader.string();
2411
- continue;
2412
- }
2413
- case 7: {
2414
- if (tag !== 56) {
2415
- break;
2416
- }
2417
- message.currencyId = long_1.default.fromString(reader.uint64().toString(), true);
2418
- continue;
2419
- }
2420
- case 8: {
2421
- if (tag !== 64) {
2422
- break;
2423
- }
2424
- message.discountPercent = reader.uint32();
2425
- continue;
2426
- }
2427
- case 9: {
2428
- if (tag !== 73) {
2429
- break;
2430
- }
2431
- message.taxPrice = reader.double();
2432
- continue;
2433
- }
2434
- case 10: {
2435
- if (tag !== 81) {
2436
- break;
2437
- }
2438
- message.discount = reader.double();
2439
- continue;
2440
- }
2441
- case 11: {
2442
- if (tag !== 89) {
2443
- break;
2444
- }
2445
- message.price = reader.double();
2446
- continue;
2447
- }
2448
- case 12: {
2449
- if (tag !== 96) {
2450
- break;
2451
- }
2452
- message.months = reader.uint32();
2453
- continue;
2454
- }
2455
- case 13: {
2456
- if (tag !== 106) {
2457
- break;
2458
- }
2459
- message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2460
- continue;
2461
- }
2462
- case 14: {
2463
- if (tag !== 114) {
2464
- break;
2465
- }
2466
- message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
2467
- continue;
2468
- }
2469
- case 15: {
2470
- if (tag !== 122) {
2471
- break;
2472
- }
2473
- message.product = financial_1.Product.decode(reader, reader.uint32());
2474
- continue;
2475
- }
2476
- }
2477
- if ((tag & 7) === 4 || tag === 0) {
2478
- break;
2479
- }
2480
- reader.skip(tag & 7);
2481
- }
2482
- return message;
2483
- },
2484
- fromJSON(object) {
2485
- return {
2486
- id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
2487
- orderId: isSet(object.order_id) ? long_1.default.fromValue(object.order_id) : undefined,
2488
- productId: isSet(object.product_id) ? long_1.default.fromValue(object.product_id) : undefined,
2489
- productType: isSet(object.product_type) ? globalThis.String(object.product_type) : "",
2490
- productName: isSet(object.product_name) ? globalThis.String(object.product_name) : "",
2491
- productDetail: isSet(object.product_detail) ? globalThis.String(object.product_detail) : "",
2492
- currencyId: isSet(object.currency_id) ? long_1.default.fromValue(object.currency_id) : undefined,
2493
- discountPercent: isSet(object.discount_percent) ? globalThis.Number(object.discount_percent) : undefined,
2494
- taxPrice: isSet(object.tax_price) ? globalThis.Number(object.tax_price) : 0,
2495
- discount: isSet(object.discount) ? globalThis.Number(object.discount) : 0,
2496
- price: isSet(object.price) ? globalThis.Number(object.price) : 0,
2497
- months: isSet(object.months) ? globalThis.Number(object.months) : undefined,
2498
- createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
2499
- updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
2500
- product: isSet(object.product) ? financial_1.Product.fromJSON(object.product) : undefined,
2501
- };
2502
- },
2503
- toJSON(message) {
2504
- const obj = {};
2505
- if (!message.id.equals(long_1.default.UZERO)) {
2506
- obj.id = (message.id || long_1.default.UZERO).toString();
2507
- }
2508
- if (message.orderId !== undefined) {
2509
- obj.order_id = (message.orderId || long_1.default.UZERO).toString();
2510
- }
2511
- if (message.productId !== undefined) {
2512
- obj.product_id = (message.productId || long_1.default.UZERO).toString();
2513
- }
2514
- if (message.productType !== "") {
2515
- obj.product_type = message.productType;
2516
- }
2517
- if (message.productName !== "") {
2518
- obj.product_name = message.productName;
2519
- }
2520
- if (message.productDetail !== "") {
2521
- obj.product_detail = message.productDetail;
2522
- }
2523
- if (message.currencyId !== undefined) {
2524
- obj.currency_id = (message.currencyId || long_1.default.UZERO).toString();
2525
- }
2526
- if (message.discountPercent !== undefined) {
2527
- obj.discount_percent = Math.round(message.discountPercent);
2528
- }
2529
- if (message.taxPrice !== 0) {
2530
- obj.tax_price = message.taxPrice;
2531
- }
2532
- if (message.discount !== 0) {
2533
- obj.discount = message.discount;
2534
- }
2535
- if (message.price !== 0) {
2536
- obj.price = message.price;
2537
- }
2538
- if (message.months !== undefined) {
2539
- obj.months = Math.round(message.months);
2540
- }
2541
- if (message.createdAt !== undefined) {
2542
- obj.created_at = message.createdAt.toISOString();
2543
- }
2544
- if (message.updatedAt !== undefined) {
2545
- obj.updated_at = message.updatedAt.toISOString();
2546
- }
2547
- if (message.product !== undefined) {
2548
- obj.product = financial_1.Product.toJSON(message.product);
2549
- }
2550
- return obj;
2551
- },
2552
- create(base) {
2553
- return exports.OrderProduct.fromPartial(base !== null && base !== void 0 ? base : {});
2554
- },
2555
- fromPartial(object) {
2556
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2557
- const message = createBaseOrderProduct();
2558
- message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
2559
- message.orderId = (object.orderId !== undefined && object.orderId !== null)
2560
- ? long_1.default.fromValue(object.orderId)
2561
- : undefined;
2562
- message.productId = (object.productId !== undefined && object.productId !== null)
2563
- ? long_1.default.fromValue(object.productId)
2564
- : undefined;
2565
- message.productType = (_a = object.productType) !== null && _a !== void 0 ? _a : "";
2566
- message.productName = (_b = object.productName) !== null && _b !== void 0 ? _b : "";
2567
- message.productDetail = (_c = object.productDetail) !== null && _c !== void 0 ? _c : "";
2568
- message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
2569
- ? long_1.default.fromValue(object.currencyId)
2570
- : undefined;
2571
- message.discountPercent = (_d = object.discountPercent) !== null && _d !== void 0 ? _d : undefined;
2572
- message.taxPrice = (_e = object.taxPrice) !== null && _e !== void 0 ? _e : 0;
2573
- message.discount = (_f = object.discount) !== null && _f !== void 0 ? _f : 0;
2574
- message.price = (_g = object.price) !== null && _g !== void 0 ? _g : 0;
2575
- message.months = (_h = object.months) !== null && _h !== void 0 ? _h : undefined;
2576
- message.createdAt = (_j = object.createdAt) !== null && _j !== void 0 ? _j : undefined;
2577
- message.updatedAt = (_k = object.updatedAt) !== null && _k !== void 0 ? _k : undefined;
2578
- message.product = (object.product !== undefined && object.product !== null)
2579
- ? financial_1.Product.fromPartial(object.product)
2580
- : undefined;
2581
- return message;
2582
- },
2583
- };
2584
1533
  function createBaseChannel() {
2585
1534
  return { name: "", count: long_1.default.UZERO };
2586
1535
  }
@@ -2596,7 +1545,7 @@ exports.Channel = {
2596
1545
  },
2597
1546
  decode(input, length) {
2598
1547
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2599
- const end = length === undefined ? reader.len : reader.pos + length;
1548
+ let end = length === undefined ? reader.len : reader.pos + length;
2600
1549
  const message = createBaseChannel();
2601
1550
  while (reader.pos < end) {
2602
1551
  const tag = reader.uint32();
@@ -2671,7 +1620,7 @@ exports.Statistics = {
2671
1620
  },
2672
1621
  decode(input, length) {
2673
1622
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2674
- const end = length === undefined ? reader.len : reader.pos + length;
1623
+ let end = length === undefined ? reader.len : reader.pos + length;
2675
1624
  const message = createBaseStatistics();
2676
1625
  while (reader.pos < end) {
2677
1626
  const tag = reader.uint32();
@@ -2769,7 +1718,7 @@ exports.TopRepeatedNotification = {
2769
1718
  },
2770
1719
  decode(input, length) {
2771
1720
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2772
- const end = length === undefined ? reader.len : reader.pos + length;
1721
+ let end = length === undefined ? reader.len : reader.pos + length;
2773
1722
  const message = createBaseTopRepeatedNotification();
2774
1723
  while (reader.pos < end) {
2775
1724
  const tag = reader.uint32();
@@ -2911,7 +1860,7 @@ exports.NotificationFull = {
2911
1860
  },
2912
1861
  decode(input, length) {
2913
1862
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2914
- const end = length === undefined ? reader.len : reader.pos + length;
1863
+ let end = length === undefined ? reader.len : reader.pos + length;
2915
1864
  const message = createBaseNotificationFull();
2916
1865
  while (reader.pos < end) {
2917
1866
  const tag = reader.uint32();
@@ -3229,7 +2178,7 @@ exports.NotificationFull_RawData = {
3229
2178
  },
3230
2179
  decode(input, length) {
3231
2180
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3232
- const end = length === undefined ? reader.len : reader.pos + length;
2181
+ let end = length === undefined ? reader.len : reader.pos + length;
3233
2182
  const message = createBaseNotificationFull_RawData();
3234
2183
  while (reader.pos < end) {
3235
2184
  const tag = reader.uint32();
@@ -3403,7 +2352,7 @@ exports.NotificationPagination = {
3403
2352
  },
3404
2353
  decode(input, length) {
3405
2354
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3406
- const end = length === undefined ? reader.len : reader.pos + length;
2355
+ let end = length === undefined ? reader.len : reader.pos + length;
3407
2356
  const message = createBaseNotificationPagination();
3408
2357
  while (reader.pos < end) {
3409
2358
  const tag = reader.uint32();
@@ -3620,7 +2569,7 @@ exports.SessionPagination = {
3620
2569
  },
3621
2570
  decode(input, length) {
3622
2571
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3623
- const end = length === undefined ? reader.len : reader.pos + length;
2572
+ let end = length === undefined ? reader.len : reader.pos + length;
3624
2573
  const message = createBaseSessionPagination();
3625
2574
  while (reader.pos < end) {
3626
2575
  const tag = reader.uint32();
@@ -3837,7 +2786,7 @@ exports.TrackerPagination = {
3837
2786
  },
3838
2787
  decode(input, length) {
3839
2788
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
3840
- const end = length === undefined ? reader.len : reader.pos + length;
2789
+ let end = length === undefined ? reader.len : reader.pos + length;
3841
2790
  const message = createBaseTrackerPagination();
3842
2791
  while (reader.pos < end) {
3843
2792
  const tag = reader.uint32();
@@ -4078,7 +3027,7 @@ exports.Session = {
4078
3027
  },
4079
3028
  decode(input, length) {
4080
3029
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
4081
- const end = length === undefined ? reader.len : reader.pos + length;
3030
+ let end = length === undefined ? reader.len : reader.pos + length;
4082
3031
  const message = createBaseSession();
4083
3032
  while (reader.pos < end) {
4084
3033
  const tag = reader.uint32();
@@ -4373,7 +3322,7 @@ exports.CommandPagination = {
4373
3322
  },
4374
3323
  decode(input, length) {
4375
3324
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
4376
- const end = length === undefined ? reader.len : reader.pos + length;
3325
+ let end = length === undefined ? reader.len : reader.pos + length;
4377
3326
  const message = createBaseCommandPagination();
4378
3327
  while (reader.pos < end) {
4379
3328
  const tag = reader.uint32();
@@ -4590,7 +3539,7 @@ exports.LiveLocationPagination = {
4590
3539
  },
4591
3540
  decode(input, length) {
4592
3541
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
4593
- const end = length === undefined ? reader.len : reader.pos + length;
3542
+ let end = length === undefined ? reader.len : reader.pos + length;
4594
3543
  const message = createBaseLiveLocationPagination();
4595
3544
  while (reader.pos < end) {
4596
3545
  const tag = reader.uint32();
@@ -4807,7 +3756,7 @@ exports.MaintenancePagination = {
4807
3756
  },
4808
3757
  decode(input, length) {
4809
3758
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
4810
- const end = length === undefined ? reader.len : reader.pos + length;
3759
+ let end = length === undefined ? reader.len : reader.pos + length;
4811
3760
  const message = createBaseMaintenancePagination();
4812
3761
  while (reader.pos < end) {
4813
3762
  const tag = reader.uint32();
@@ -5024,7 +3973,7 @@ exports.ServicePagination = {
5024
3973
  },
5025
3974
  decode(input, length) {
5026
3975
  const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
5027
- const end = length === undefined ? reader.len : reader.pos + length;
3976
+ let end = length === undefined ? reader.len : reader.pos + length;
5028
3977
  const message = createBaseServicePagination();
5029
3978
  while (reader.pos < end) {
5030
3979
  const tag = reader.uint32();