@fatehan/tsrp 1.4.10 → 1.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +2 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +10 -0
- package/dist/fatehan/apis/client.d.ts +1 -59
- package/dist/fatehan/apis/client.d.ts.map +1 -1
- package/dist/fatehan/apis/client.js +128 -1056
- package/dist/fatehan/notifies/notify.js +2 -2
- package/dist/fatehan/reports/report.d.ts +3 -0
- package/dist/fatehan/reports/report.d.ts.map +1 -1
- package/dist/fatehan/reports/report.js +49 -1
- package/dist/fatehan/services/api.d.ts +9 -0
- package/dist/fatehan/services/api.d.ts.map +1 -1
- package/dist/fatehan/services/api.js +126 -1
- package/package.json +2 -2
|
@@ -8,7 +8,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.
|
|
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;
|
|
12
12
|
/* eslint-disable */
|
|
13
13
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
14
14
|
const long_1 = __importDefault(require("long"));
|
|
@@ -1530,229 +1530,6 @@ exports.Transaction = {
|
|
|
1530
1530
|
return message;
|
|
1531
1531
|
},
|
|
1532
1532
|
};
|
|
1533
|
-
function createBasePaymentGateway() {
|
|
1534
|
-
return {
|
|
1535
|
-
id: long_1.default.UZERO,
|
|
1536
|
-
organizationId: long_1.default.UZERO,
|
|
1537
|
-
createdBy: undefined,
|
|
1538
|
-
updatedBy: undefined,
|
|
1539
|
-
gateway: "",
|
|
1540
|
-
name: "",
|
|
1541
|
-
default: false,
|
|
1542
|
-
status: false,
|
|
1543
|
-
config: [],
|
|
1544
|
-
createdAt: undefined,
|
|
1545
|
-
updatedAt: undefined,
|
|
1546
|
-
};
|
|
1547
|
-
}
|
|
1548
|
-
exports.PaymentGateway = {
|
|
1549
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1550
|
-
if (!message.id.equals(long_1.default.UZERO)) {
|
|
1551
|
-
writer.uint32(8).uint64(message.id.toString());
|
|
1552
|
-
}
|
|
1553
|
-
if (!message.organizationId.equals(long_1.default.UZERO)) {
|
|
1554
|
-
writer.uint32(16).uint64(message.organizationId.toString());
|
|
1555
|
-
}
|
|
1556
|
-
if (message.createdBy !== undefined) {
|
|
1557
|
-
writer.uint32(24).uint64(message.createdBy.toString());
|
|
1558
|
-
}
|
|
1559
|
-
if (message.updatedBy !== undefined) {
|
|
1560
|
-
writer.uint32(32).uint64(message.updatedBy.toString());
|
|
1561
|
-
}
|
|
1562
|
-
if (message.gateway !== "") {
|
|
1563
|
-
writer.uint32(42).string(message.gateway);
|
|
1564
|
-
}
|
|
1565
|
-
if (message.name !== "") {
|
|
1566
|
-
writer.uint32(50).string(message.name);
|
|
1567
|
-
}
|
|
1568
|
-
if (message.default !== false) {
|
|
1569
|
-
writer.uint32(56).bool(message.default);
|
|
1570
|
-
}
|
|
1571
|
-
if (message.status !== false) {
|
|
1572
|
-
writer.uint32(64).bool(message.status);
|
|
1573
|
-
}
|
|
1574
|
-
for (const v of message.config) {
|
|
1575
|
-
exports.Config.encode(v, writer.uint32(74).fork()).join();
|
|
1576
|
-
}
|
|
1577
|
-
if (message.createdAt !== undefined) {
|
|
1578
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(82).fork()).join();
|
|
1579
|
-
}
|
|
1580
|
-
if (message.updatedAt !== undefined) {
|
|
1581
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(90).fork()).join();
|
|
1582
|
-
}
|
|
1583
|
-
return writer;
|
|
1584
|
-
},
|
|
1585
|
-
decode(input, length) {
|
|
1586
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1587
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1588
|
-
const message = createBasePaymentGateway();
|
|
1589
|
-
while (reader.pos < end) {
|
|
1590
|
-
const tag = reader.uint32();
|
|
1591
|
-
switch (tag >>> 3) {
|
|
1592
|
-
case 1: {
|
|
1593
|
-
if (tag !== 8) {
|
|
1594
|
-
break;
|
|
1595
|
-
}
|
|
1596
|
-
message.id = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1597
|
-
continue;
|
|
1598
|
-
}
|
|
1599
|
-
case 2: {
|
|
1600
|
-
if (tag !== 16) {
|
|
1601
|
-
break;
|
|
1602
|
-
}
|
|
1603
|
-
message.organizationId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1604
|
-
continue;
|
|
1605
|
-
}
|
|
1606
|
-
case 3: {
|
|
1607
|
-
if (tag !== 24) {
|
|
1608
|
-
break;
|
|
1609
|
-
}
|
|
1610
|
-
message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1611
|
-
continue;
|
|
1612
|
-
}
|
|
1613
|
-
case 4: {
|
|
1614
|
-
if (tag !== 32) {
|
|
1615
|
-
break;
|
|
1616
|
-
}
|
|
1617
|
-
message.updatedBy = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1618
|
-
continue;
|
|
1619
|
-
}
|
|
1620
|
-
case 5: {
|
|
1621
|
-
if (tag !== 42) {
|
|
1622
|
-
break;
|
|
1623
|
-
}
|
|
1624
|
-
message.gateway = reader.string();
|
|
1625
|
-
continue;
|
|
1626
|
-
}
|
|
1627
|
-
case 6: {
|
|
1628
|
-
if (tag !== 50) {
|
|
1629
|
-
break;
|
|
1630
|
-
}
|
|
1631
|
-
message.name = reader.string();
|
|
1632
|
-
continue;
|
|
1633
|
-
}
|
|
1634
|
-
case 7: {
|
|
1635
|
-
if (tag !== 56) {
|
|
1636
|
-
break;
|
|
1637
|
-
}
|
|
1638
|
-
message.default = reader.bool();
|
|
1639
|
-
continue;
|
|
1640
|
-
}
|
|
1641
|
-
case 8: {
|
|
1642
|
-
if (tag !== 64) {
|
|
1643
|
-
break;
|
|
1644
|
-
}
|
|
1645
|
-
message.status = reader.bool();
|
|
1646
|
-
continue;
|
|
1647
|
-
}
|
|
1648
|
-
case 9: {
|
|
1649
|
-
if (tag !== 74) {
|
|
1650
|
-
break;
|
|
1651
|
-
}
|
|
1652
|
-
message.config.push(exports.Config.decode(reader, reader.uint32()));
|
|
1653
|
-
continue;
|
|
1654
|
-
}
|
|
1655
|
-
case 10: {
|
|
1656
|
-
if (tag !== 82) {
|
|
1657
|
-
break;
|
|
1658
|
-
}
|
|
1659
|
-
message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1660
|
-
continue;
|
|
1661
|
-
}
|
|
1662
|
-
case 11: {
|
|
1663
|
-
if (tag !== 90) {
|
|
1664
|
-
break;
|
|
1665
|
-
}
|
|
1666
|
-
message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1667
|
-
continue;
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1671
|
-
break;
|
|
1672
|
-
}
|
|
1673
|
-
reader.skip(tag & 7);
|
|
1674
|
-
}
|
|
1675
|
-
return message;
|
|
1676
|
-
},
|
|
1677
|
-
fromJSON(object) {
|
|
1678
|
-
return {
|
|
1679
|
-
id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
|
|
1680
|
-
organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
|
|
1681
|
-
createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
|
|
1682
|
-
updatedBy: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : undefined,
|
|
1683
|
-
gateway: isSet(object.gateway) ? globalThis.String(object.gateway) : "",
|
|
1684
|
-
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
1685
|
-
default: isSet(object.default) ? globalThis.Boolean(object.default) : false,
|
|
1686
|
-
status: isSet(object.status) ? globalThis.Boolean(object.status) : false,
|
|
1687
|
-
config: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.config) ? object.config.map((e) => exports.Config.fromJSON(e)) : [],
|
|
1688
|
-
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
1689
|
-
updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
|
|
1690
|
-
};
|
|
1691
|
-
},
|
|
1692
|
-
toJSON(message) {
|
|
1693
|
-
var _a;
|
|
1694
|
-
const obj = {};
|
|
1695
|
-
if (!message.id.equals(long_1.default.UZERO)) {
|
|
1696
|
-
obj.id = (message.id || long_1.default.UZERO).toString();
|
|
1697
|
-
}
|
|
1698
|
-
if (!message.organizationId.equals(long_1.default.UZERO)) {
|
|
1699
|
-
obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
|
|
1700
|
-
}
|
|
1701
|
-
if (message.createdBy !== undefined) {
|
|
1702
|
-
obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
|
|
1703
|
-
}
|
|
1704
|
-
if (message.updatedBy !== undefined) {
|
|
1705
|
-
obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
|
|
1706
|
-
}
|
|
1707
|
-
if (message.gateway !== "") {
|
|
1708
|
-
obj.gateway = message.gateway;
|
|
1709
|
-
}
|
|
1710
|
-
if (message.name !== "") {
|
|
1711
|
-
obj.name = message.name;
|
|
1712
|
-
}
|
|
1713
|
-
if (message.default !== false) {
|
|
1714
|
-
obj.default = message.default;
|
|
1715
|
-
}
|
|
1716
|
-
if (message.status !== false) {
|
|
1717
|
-
obj.status = message.status;
|
|
1718
|
-
}
|
|
1719
|
-
if ((_a = message.config) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1720
|
-
obj.config = message.config.map((e) => exports.Config.toJSON(e));
|
|
1721
|
-
}
|
|
1722
|
-
if (message.createdAt !== undefined) {
|
|
1723
|
-
obj.created_at = message.createdAt.toISOString();
|
|
1724
|
-
}
|
|
1725
|
-
if (message.updatedAt !== undefined) {
|
|
1726
|
-
obj.updated_at = message.updatedAt.toISOString();
|
|
1727
|
-
}
|
|
1728
|
-
return obj;
|
|
1729
|
-
},
|
|
1730
|
-
create(base) {
|
|
1731
|
-
return exports.PaymentGateway.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1732
|
-
},
|
|
1733
|
-
fromPartial(object) {
|
|
1734
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1735
|
-
const message = createBasePaymentGateway();
|
|
1736
|
-
message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
|
|
1737
|
-
message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
|
|
1738
|
-
? long_1.default.fromValue(object.organizationId)
|
|
1739
|
-
: long_1.default.UZERO;
|
|
1740
|
-
message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
|
|
1741
|
-
? long_1.default.fromValue(object.createdBy)
|
|
1742
|
-
: undefined;
|
|
1743
|
-
message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
|
|
1744
|
-
? long_1.default.fromValue(object.updatedBy)
|
|
1745
|
-
: undefined;
|
|
1746
|
-
message.gateway = (_a = object.gateway) !== null && _a !== void 0 ? _a : "";
|
|
1747
|
-
message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
|
|
1748
|
-
message.default = (_c = object.default) !== null && _c !== void 0 ? _c : false;
|
|
1749
|
-
message.status = (_d = object.status) !== null && _d !== void 0 ? _d : false;
|
|
1750
|
-
message.config = ((_e = object.config) === null || _e === void 0 ? void 0 : _e.map((e) => exports.Config.fromPartial(e))) || [];
|
|
1751
|
-
message.createdAt = (_f = object.createdAt) !== null && _f !== void 0 ? _f : undefined;
|
|
1752
|
-
message.updatedAt = (_g = object.updatedAt) !== null && _g !== void 0 ? _g : undefined;
|
|
1753
|
-
return message;
|
|
1754
|
-
},
|
|
1755
|
-
};
|
|
1756
1533
|
function createBasePartner() {
|
|
1757
1534
|
return { id: long_1.default.UZERO, name: undefined, domains: [] };
|
|
1758
1535
|
}
|
|
@@ -1838,58 +1615,62 @@ exports.Partner = {
|
|
|
1838
1615
|
return message;
|
|
1839
1616
|
},
|
|
1840
1617
|
};
|
|
1841
|
-
function
|
|
1618
|
+
function createBaseOrderPagination() {
|
|
1842
1619
|
return {
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
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: [],
|
|
1853
1631
|
};
|
|
1854
1632
|
}
|
|
1855
|
-
exports.
|
|
1633
|
+
exports.OrderPagination = {
|
|
1856
1634
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1857
|
-
if (
|
|
1858
|
-
writer.uint32(8).
|
|
1635
|
+
if (message.currentPage !== 0) {
|
|
1636
|
+
writer.uint32(8).uint32(message.currentPage);
|
|
1859
1637
|
}
|
|
1860
|
-
if (message.
|
|
1861
|
-
writer.uint32(18).string(message.
|
|
1638
|
+
if (message.firstPageUrl !== "") {
|
|
1639
|
+
writer.uint32(18).string(message.firstPageUrl);
|
|
1862
1640
|
}
|
|
1863
|
-
if (message.
|
|
1864
|
-
writer.uint32(26).string(message.
|
|
1641
|
+
if (message.lastPageUrl !== "") {
|
|
1642
|
+
writer.uint32(26).string(message.lastPageUrl);
|
|
1865
1643
|
}
|
|
1866
|
-
if (message.
|
|
1867
|
-
writer.uint32(
|
|
1644
|
+
if (message.nextPageUrl !== "") {
|
|
1645
|
+
writer.uint32(34).string(message.nextPageUrl);
|
|
1646
|
+
}
|
|
1647
|
+
if (message.prevPageUrl !== "") {
|
|
1648
|
+
writer.uint32(42).string(message.prevPageUrl);
|
|
1868
1649
|
}
|
|
1869
|
-
if (message.
|
|
1870
|
-
writer.uint32(
|
|
1650
|
+
if (message.path !== "") {
|
|
1651
|
+
writer.uint32(50).string(message.path);
|
|
1871
1652
|
}
|
|
1872
|
-
if (message.
|
|
1873
|
-
writer.uint32(
|
|
1653
|
+
if (message.from !== 0) {
|
|
1654
|
+
writer.uint32(56).uint32(message.from);
|
|
1874
1655
|
}
|
|
1875
|
-
if (message.
|
|
1876
|
-
writer.uint32(
|
|
1656
|
+
if (message.lastPage !== 0) {
|
|
1657
|
+
writer.uint32(64).uint32(message.lastPage);
|
|
1877
1658
|
}
|
|
1878
|
-
if (message.
|
|
1879
|
-
writer.uint32(
|
|
1659
|
+
if (message.perPage !== 0) {
|
|
1660
|
+
writer.uint32(72).uint32(message.perPage);
|
|
1880
1661
|
}
|
|
1881
|
-
if (message.
|
|
1882
|
-
|
|
1662
|
+
if (message.to !== 0) {
|
|
1663
|
+
writer.uint32(80).uint32(message.to);
|
|
1883
1664
|
}
|
|
1884
|
-
|
|
1885
|
-
|
|
1665
|
+
for (const v of message.data) {
|
|
1666
|
+
exports.Order.encode(v, writer.uint32(90).fork()).join();
|
|
1886
1667
|
}
|
|
1887
1668
|
return writer;
|
|
1888
1669
|
},
|
|
1889
1670
|
decode(input, length) {
|
|
1890
1671
|
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1891
1672
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1892
|
-
const message =
|
|
1673
|
+
const message = createBaseOrderPagination();
|
|
1893
1674
|
while (reader.pos < end) {
|
|
1894
1675
|
const tag = reader.uint32();
|
|
1895
1676
|
switch (tag >>> 3) {
|
|
@@ -1897,250 +1678,42 @@ exports.ProductType = {
|
|
|
1897
1678
|
if (tag !== 8) {
|
|
1898
1679
|
break;
|
|
1899
1680
|
}
|
|
1900
|
-
message.
|
|
1681
|
+
message.currentPage = reader.uint32();
|
|
1901
1682
|
continue;
|
|
1902
1683
|
}
|
|
1903
1684
|
case 2: {
|
|
1904
1685
|
if (tag !== 18) {
|
|
1905
1686
|
break;
|
|
1906
1687
|
}
|
|
1907
|
-
message.
|
|
1688
|
+
message.firstPageUrl = reader.string();
|
|
1908
1689
|
continue;
|
|
1909
1690
|
}
|
|
1910
1691
|
case 3: {
|
|
1911
1692
|
if (tag !== 26) {
|
|
1912
1693
|
break;
|
|
1913
1694
|
}
|
|
1914
|
-
message.
|
|
1695
|
+
message.lastPageUrl = reader.string();
|
|
1915
1696
|
continue;
|
|
1916
1697
|
}
|
|
1917
1698
|
case 4: {
|
|
1918
|
-
if (tag !==
|
|
1699
|
+
if (tag !== 34) {
|
|
1919
1700
|
break;
|
|
1920
1701
|
}
|
|
1921
|
-
message.
|
|
1702
|
+
message.nextPageUrl = reader.string();
|
|
1922
1703
|
continue;
|
|
1923
1704
|
}
|
|
1924
1705
|
case 5: {
|
|
1925
1706
|
if (tag !== 42) {
|
|
1926
1707
|
break;
|
|
1927
1708
|
}
|
|
1928
|
-
message.
|
|
1709
|
+
message.prevPageUrl = reader.string();
|
|
1929
1710
|
continue;
|
|
1930
1711
|
}
|
|
1931
1712
|
case 6: {
|
|
1932
1713
|
if (tag !== 50) {
|
|
1933
1714
|
break;
|
|
1934
1715
|
}
|
|
1935
|
-
message.
|
|
1936
|
-
continue;
|
|
1937
|
-
}
|
|
1938
|
-
case 7: {
|
|
1939
|
-
if (tag !== 56) {
|
|
1940
|
-
break;
|
|
1941
|
-
}
|
|
1942
|
-
message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1943
|
-
continue;
|
|
1944
|
-
}
|
|
1945
|
-
case 8: {
|
|
1946
|
-
if (tag !== 64) {
|
|
1947
|
-
break;
|
|
1948
|
-
}
|
|
1949
|
-
message.updatedBy = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1950
|
-
continue;
|
|
1951
|
-
}
|
|
1952
|
-
case 9: {
|
|
1953
|
-
if (tag !== 74) {
|
|
1954
|
-
break;
|
|
1955
|
-
}
|
|
1956
|
-
message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1957
|
-
continue;
|
|
1958
|
-
}
|
|
1959
|
-
case 10: {
|
|
1960
|
-
if (tag !== 82) {
|
|
1961
|
-
break;
|
|
1962
|
-
}
|
|
1963
|
-
message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1964
|
-
continue;
|
|
1965
|
-
}
|
|
1966
|
-
}
|
|
1967
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1968
|
-
break;
|
|
1969
|
-
}
|
|
1970
|
-
reader.skip(tag & 7);
|
|
1971
|
-
}
|
|
1972
|
-
return message;
|
|
1973
|
-
},
|
|
1974
|
-
fromJSON(object) {
|
|
1975
|
-
return {
|
|
1976
|
-
id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
|
|
1977
|
-
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
|
|
1978
|
-
description: isSet(object.description) ? globalThis.String(object.description) : undefined,
|
|
1979
|
-
months: isSet(object.months) ? globalThis.Number(object.months) : undefined,
|
|
1980
|
-
keyType: isSet(object.key_type) ? globalThis.String(object.key_type) : "",
|
|
1981
|
-
picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
|
|
1982
|
-
createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
|
|
1983
|
-
updatedBy: isSet(object.updated_by) ? long_1.default.fromValue(object.updated_by) : undefined,
|
|
1984
|
-
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
1985
|
-
updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
|
|
1986
|
-
};
|
|
1987
|
-
},
|
|
1988
|
-
toJSON(message) {
|
|
1989
|
-
const obj = {};
|
|
1990
|
-
if (!message.id.equals(long_1.default.UZERO)) {
|
|
1991
|
-
obj.id = (message.id || long_1.default.UZERO).toString();
|
|
1992
|
-
}
|
|
1993
|
-
if (message.name !== undefined) {
|
|
1994
|
-
obj.name = message.name;
|
|
1995
|
-
}
|
|
1996
|
-
if (message.description !== undefined) {
|
|
1997
|
-
obj.description = message.description;
|
|
1998
|
-
}
|
|
1999
|
-
if (message.months !== undefined) {
|
|
2000
|
-
obj.months = Math.round(message.months);
|
|
2001
|
-
}
|
|
2002
|
-
if (message.keyType !== "") {
|
|
2003
|
-
obj.key_type = message.keyType;
|
|
2004
|
-
}
|
|
2005
|
-
if (message.picture !== undefined) {
|
|
2006
|
-
obj.picture = message.picture;
|
|
2007
|
-
}
|
|
2008
|
-
if (message.createdBy !== undefined) {
|
|
2009
|
-
obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
|
|
2010
|
-
}
|
|
2011
|
-
if (message.updatedBy !== undefined) {
|
|
2012
|
-
obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
|
|
2013
|
-
}
|
|
2014
|
-
if (message.createdAt !== undefined) {
|
|
2015
|
-
obj.created_at = message.createdAt.toISOString();
|
|
2016
|
-
}
|
|
2017
|
-
if (message.updatedAt !== undefined) {
|
|
2018
|
-
obj.updated_at = message.updatedAt.toISOString();
|
|
2019
|
-
}
|
|
2020
|
-
return obj;
|
|
2021
|
-
},
|
|
2022
|
-
create(base) {
|
|
2023
|
-
return exports.ProductType.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2024
|
-
},
|
|
2025
|
-
fromPartial(object) {
|
|
2026
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2027
|
-
const message = createBaseProductType();
|
|
2028
|
-
message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
|
|
2029
|
-
message.name = (_a = object.name) !== null && _a !== void 0 ? _a : undefined;
|
|
2030
|
-
message.description = (_b = object.description) !== null && _b !== void 0 ? _b : undefined;
|
|
2031
|
-
message.months = (_c = object.months) !== null && _c !== void 0 ? _c : undefined;
|
|
2032
|
-
message.keyType = (_d = object.keyType) !== null && _d !== void 0 ? _d : "";
|
|
2033
|
-
message.picture = (_e = object.picture) !== null && _e !== void 0 ? _e : undefined;
|
|
2034
|
-
message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
|
|
2035
|
-
? long_1.default.fromValue(object.createdBy)
|
|
2036
|
-
: undefined;
|
|
2037
|
-
message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
|
|
2038
|
-
? long_1.default.fromValue(object.updatedBy)
|
|
2039
|
-
: undefined;
|
|
2040
|
-
message.createdAt = (_f = object.createdAt) !== null && _f !== void 0 ? _f : undefined;
|
|
2041
|
-
message.updatedAt = (_g = object.updatedAt) !== null && _g !== void 0 ? _g : undefined;
|
|
2042
|
-
return message;
|
|
2043
|
-
},
|
|
2044
|
-
};
|
|
2045
|
-
function createBaseOrderPagination() {
|
|
2046
|
-
return {
|
|
2047
|
-
currentPage: 0,
|
|
2048
|
-
firstPageUrl: "",
|
|
2049
|
-
lastPageUrl: "",
|
|
2050
|
-
nextPageUrl: "",
|
|
2051
|
-
prevPageUrl: "",
|
|
2052
|
-
path: "",
|
|
2053
|
-
from: 0,
|
|
2054
|
-
lastPage: 0,
|
|
2055
|
-
perPage: 0,
|
|
2056
|
-
to: 0,
|
|
2057
|
-
data: [],
|
|
2058
|
-
};
|
|
2059
|
-
}
|
|
2060
|
-
exports.OrderPagination = {
|
|
2061
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
2062
|
-
if (message.currentPage !== 0) {
|
|
2063
|
-
writer.uint32(8).uint32(message.currentPage);
|
|
2064
|
-
}
|
|
2065
|
-
if (message.firstPageUrl !== "") {
|
|
2066
|
-
writer.uint32(18).string(message.firstPageUrl);
|
|
2067
|
-
}
|
|
2068
|
-
if (message.lastPageUrl !== "") {
|
|
2069
|
-
writer.uint32(26).string(message.lastPageUrl);
|
|
2070
|
-
}
|
|
2071
|
-
if (message.nextPageUrl !== "") {
|
|
2072
|
-
writer.uint32(34).string(message.nextPageUrl);
|
|
2073
|
-
}
|
|
2074
|
-
if (message.prevPageUrl !== "") {
|
|
2075
|
-
writer.uint32(42).string(message.prevPageUrl);
|
|
2076
|
-
}
|
|
2077
|
-
if (message.path !== "") {
|
|
2078
|
-
writer.uint32(50).string(message.path);
|
|
2079
|
-
}
|
|
2080
|
-
if (message.from !== 0) {
|
|
2081
|
-
writer.uint32(56).uint32(message.from);
|
|
2082
|
-
}
|
|
2083
|
-
if (message.lastPage !== 0) {
|
|
2084
|
-
writer.uint32(64).uint32(message.lastPage);
|
|
2085
|
-
}
|
|
2086
|
-
if (message.perPage !== 0) {
|
|
2087
|
-
writer.uint32(72).uint32(message.perPage);
|
|
2088
|
-
}
|
|
2089
|
-
if (message.to !== 0) {
|
|
2090
|
-
writer.uint32(80).uint32(message.to);
|
|
2091
|
-
}
|
|
2092
|
-
for (const v of message.data) {
|
|
2093
|
-
exports.Order.encode(v, writer.uint32(90).fork()).join();
|
|
2094
|
-
}
|
|
2095
|
-
return writer;
|
|
2096
|
-
},
|
|
2097
|
-
decode(input, length) {
|
|
2098
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
2099
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2100
|
-
const message = createBaseOrderPagination();
|
|
2101
|
-
while (reader.pos < end) {
|
|
2102
|
-
const tag = reader.uint32();
|
|
2103
|
-
switch (tag >>> 3) {
|
|
2104
|
-
case 1: {
|
|
2105
|
-
if (tag !== 8) {
|
|
2106
|
-
break;
|
|
2107
|
-
}
|
|
2108
|
-
message.currentPage = reader.uint32();
|
|
2109
|
-
continue;
|
|
2110
|
-
}
|
|
2111
|
-
case 2: {
|
|
2112
|
-
if (tag !== 18) {
|
|
2113
|
-
break;
|
|
2114
|
-
}
|
|
2115
|
-
message.firstPageUrl = reader.string();
|
|
2116
|
-
continue;
|
|
2117
|
-
}
|
|
2118
|
-
case 3: {
|
|
2119
|
-
if (tag !== 26) {
|
|
2120
|
-
break;
|
|
2121
|
-
}
|
|
2122
|
-
message.lastPageUrl = reader.string();
|
|
2123
|
-
continue;
|
|
2124
|
-
}
|
|
2125
|
-
case 4: {
|
|
2126
|
-
if (tag !== 34) {
|
|
2127
|
-
break;
|
|
2128
|
-
}
|
|
2129
|
-
message.nextPageUrl = reader.string();
|
|
2130
|
-
continue;
|
|
2131
|
-
}
|
|
2132
|
-
case 5: {
|
|
2133
|
-
if (tag !== 42) {
|
|
2134
|
-
break;
|
|
2135
|
-
}
|
|
2136
|
-
message.prevPageUrl = reader.string();
|
|
2137
|
-
continue;
|
|
2138
|
-
}
|
|
2139
|
-
case 6: {
|
|
2140
|
-
if (tag !== 50) {
|
|
2141
|
-
break;
|
|
2142
|
-
}
|
|
2143
|
-
message.path = reader.string();
|
|
1716
|
+
message.path = reader.string();
|
|
2144
1717
|
continue;
|
|
2145
1718
|
}
|
|
2146
1719
|
case 7: {
|
|
@@ -2357,7 +1930,7 @@ exports.Order = {
|
|
|
2357
1930
|
exports.Partner.encode(message.partner, writer.uint32(178).fork()).join();
|
|
2358
1931
|
}
|
|
2359
1932
|
if (message.paymentGateway !== undefined) {
|
|
2360
|
-
|
|
1933
|
+
financial_1.PaymentGateway.encode(message.paymentGateway, writer.uint32(186).fork()).join();
|
|
2361
1934
|
}
|
|
2362
1935
|
if (message.currency !== undefined) {
|
|
2363
1936
|
financial_1.Currency.encode(message.currency, writer.uint32(194).fork()).join();
|
|
@@ -2532,7 +2105,7 @@ exports.Order = {
|
|
|
2532
2105
|
if (tag !== 186) {
|
|
2533
2106
|
break;
|
|
2534
2107
|
}
|
|
2535
|
-
message.paymentGateway =
|
|
2108
|
+
message.paymentGateway = financial_1.PaymentGateway.decode(reader, reader.uint32());
|
|
2536
2109
|
continue;
|
|
2537
2110
|
}
|
|
2538
2111
|
case 24: {
|
|
@@ -2583,7 +2156,7 @@ exports.Order = {
|
|
|
2583
2156
|
? object.products.map((e) => exports.OrderProduct.fromJSON(e))
|
|
2584
2157
|
: [],
|
|
2585
2158
|
partner: isSet(object.partner) ? exports.Partner.fromJSON(object.partner) : undefined,
|
|
2586
|
-
paymentGateway: isSet(object.payment_gateway) ?
|
|
2159
|
+
paymentGateway: isSet(object.payment_gateway) ? financial_1.PaymentGateway.fromJSON(object.payment_gateway) : undefined,
|
|
2587
2160
|
currency: isSet(object.currency) ? financial_1.Currency.fromJSON(object.currency) : undefined,
|
|
2588
2161
|
person: isSet(object.person) ? identities_1.Person.fromJSON(object.person) : undefined,
|
|
2589
2162
|
};
|
|
@@ -2658,7 +2231,7 @@ exports.Order = {
|
|
|
2658
2231
|
obj.partner = exports.Partner.toJSON(message.partner);
|
|
2659
2232
|
}
|
|
2660
2233
|
if (message.paymentGateway !== undefined) {
|
|
2661
|
-
obj.payment_gateway =
|
|
2234
|
+
obj.payment_gateway = financial_1.PaymentGateway.toJSON(message.paymentGateway);
|
|
2662
2235
|
}
|
|
2663
2236
|
if (message.currency !== undefined) {
|
|
2664
2237
|
obj.currency = financial_1.Currency.toJSON(message.currency);
|
|
@@ -2709,7 +2282,7 @@ exports.Order = {
|
|
|
2709
2282
|
? exports.Partner.fromPartial(object.partner)
|
|
2710
2283
|
: undefined;
|
|
2711
2284
|
message.paymentGateway = (object.paymentGateway !== undefined && object.paymentGateway !== null)
|
|
2712
|
-
?
|
|
2285
|
+
? financial_1.PaymentGateway.fromPartial(object.paymentGateway)
|
|
2713
2286
|
: undefined;
|
|
2714
2287
|
message.currency = (object.currency !== undefined && object.currency !== null)
|
|
2715
2288
|
? financial_1.Currency.fromPartial(object.currency)
|
|
@@ -2784,7 +2357,7 @@ exports.OrderProduct = {
|
|
|
2784
2357
|
timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(114).fork()).join();
|
|
2785
2358
|
}
|
|
2786
2359
|
if (message.product !== undefined) {
|
|
2787
|
-
|
|
2360
|
+
financial_1.Product.encode(message.product, writer.uint32(122).fork()).join();
|
|
2788
2361
|
}
|
|
2789
2362
|
return writer;
|
|
2790
2363
|
},
|
|
@@ -2813,445 +2386,91 @@ exports.OrderProduct = {
|
|
|
2813
2386
|
if (tag !== 24) {
|
|
2814
2387
|
break;
|
|
2815
2388
|
}
|
|
2816
|
-
message.productId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
2817
|
-
continue;
|
|
2818
|
-
}
|
|
2819
|
-
case 4: {
|
|
2820
|
-
if (tag !== 34) {
|
|
2821
|
-
break;
|
|
2822
|
-
}
|
|
2823
|
-
message.productType = reader.string();
|
|
2824
|
-
continue;
|
|
2825
|
-
}
|
|
2826
|
-
case 5: {
|
|
2827
|
-
if (tag !== 42) {
|
|
2828
|
-
break;
|
|
2829
|
-
}
|
|
2830
|
-
message.productName = reader.string();
|
|
2831
|
-
continue;
|
|
2832
|
-
}
|
|
2833
|
-
case 6: {
|
|
2834
|
-
if (tag !== 50) {
|
|
2835
|
-
break;
|
|
2836
|
-
}
|
|
2837
|
-
message.productDetail = reader.string();
|
|
2838
|
-
continue;
|
|
2839
|
-
}
|
|
2840
|
-
case 7: {
|
|
2841
|
-
if (tag !== 56) {
|
|
2842
|
-
break;
|
|
2843
|
-
}
|
|
2844
|
-
message.currencyId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
2845
|
-
continue;
|
|
2846
|
-
}
|
|
2847
|
-
case 8: {
|
|
2848
|
-
if (tag !== 64) {
|
|
2849
|
-
break;
|
|
2850
|
-
}
|
|
2851
|
-
message.discountPercent = reader.uint32();
|
|
2852
|
-
continue;
|
|
2853
|
-
}
|
|
2854
|
-
case 9: {
|
|
2855
|
-
if (tag !== 73) {
|
|
2856
|
-
break;
|
|
2857
|
-
}
|
|
2858
|
-
message.taxPrice = reader.double();
|
|
2859
|
-
continue;
|
|
2860
|
-
}
|
|
2861
|
-
case 10: {
|
|
2862
|
-
if (tag !== 81) {
|
|
2863
|
-
break;
|
|
2864
|
-
}
|
|
2865
|
-
message.discount = reader.double();
|
|
2866
|
-
continue;
|
|
2867
|
-
}
|
|
2868
|
-
case 11: {
|
|
2869
|
-
if (tag !== 89) {
|
|
2870
|
-
break;
|
|
2871
|
-
}
|
|
2872
|
-
message.price = reader.double();
|
|
2873
|
-
continue;
|
|
2874
|
-
}
|
|
2875
|
-
case 12: {
|
|
2876
|
-
if (tag !== 96) {
|
|
2877
|
-
break;
|
|
2878
|
-
}
|
|
2879
|
-
message.months = reader.uint32();
|
|
2880
|
-
continue;
|
|
2881
|
-
}
|
|
2882
|
-
case 13: {
|
|
2883
|
-
if (tag !== 106) {
|
|
2884
|
-
break;
|
|
2885
|
-
}
|
|
2886
|
-
message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
2887
|
-
continue;
|
|
2888
|
-
}
|
|
2889
|
-
case 14: {
|
|
2890
|
-
if (tag !== 114) {
|
|
2891
|
-
break;
|
|
2892
|
-
}
|
|
2893
|
-
message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
2894
|
-
continue;
|
|
2895
|
-
}
|
|
2896
|
-
case 15: {
|
|
2897
|
-
if (tag !== 122) {
|
|
2898
|
-
break;
|
|
2899
|
-
}
|
|
2900
|
-
message.product = exports.Product.decode(reader, reader.uint32());
|
|
2901
|
-
continue;
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2904
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
2905
|
-
break;
|
|
2906
|
-
}
|
|
2907
|
-
reader.skip(tag & 7);
|
|
2908
|
-
}
|
|
2909
|
-
return message;
|
|
2910
|
-
},
|
|
2911
|
-
fromJSON(object) {
|
|
2912
|
-
return {
|
|
2913
|
-
id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
|
|
2914
|
-
orderId: isSet(object.order_id) ? long_1.default.fromValue(object.order_id) : undefined,
|
|
2915
|
-
productId: isSet(object.product_id) ? long_1.default.fromValue(object.product_id) : undefined,
|
|
2916
|
-
productType: isSet(object.product_type) ? globalThis.String(object.product_type) : "",
|
|
2917
|
-
productName: isSet(object.product_name) ? globalThis.String(object.product_name) : "",
|
|
2918
|
-
productDetail: isSet(object.product_detail) ? globalThis.String(object.product_detail) : "",
|
|
2919
|
-
currencyId: isSet(object.currency_id) ? long_1.default.fromValue(object.currency_id) : undefined,
|
|
2920
|
-
discountPercent: isSet(object.discount_percent) ? globalThis.Number(object.discount_percent) : undefined,
|
|
2921
|
-
taxPrice: isSet(object.tax_price) ? globalThis.Number(object.tax_price) : 0,
|
|
2922
|
-
discount: isSet(object.discount) ? globalThis.Number(object.discount) : 0,
|
|
2923
|
-
price: isSet(object.price) ? globalThis.Number(object.price) : 0,
|
|
2924
|
-
months: isSet(object.months) ? globalThis.Number(object.months) : undefined,
|
|
2925
|
-
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
2926
|
-
updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
|
|
2927
|
-
product: isSet(object.product) ? exports.Product.fromJSON(object.product) : undefined,
|
|
2928
|
-
};
|
|
2929
|
-
},
|
|
2930
|
-
toJSON(message) {
|
|
2931
|
-
const obj = {};
|
|
2932
|
-
if (!message.id.equals(long_1.default.UZERO)) {
|
|
2933
|
-
obj.id = (message.id || long_1.default.UZERO).toString();
|
|
2934
|
-
}
|
|
2935
|
-
if (message.orderId !== undefined) {
|
|
2936
|
-
obj.order_id = (message.orderId || long_1.default.UZERO).toString();
|
|
2937
|
-
}
|
|
2938
|
-
if (message.productId !== undefined) {
|
|
2939
|
-
obj.product_id = (message.productId || long_1.default.UZERO).toString();
|
|
2940
|
-
}
|
|
2941
|
-
if (message.productType !== "") {
|
|
2942
|
-
obj.product_type = message.productType;
|
|
2943
|
-
}
|
|
2944
|
-
if (message.productName !== "") {
|
|
2945
|
-
obj.product_name = message.productName;
|
|
2946
|
-
}
|
|
2947
|
-
if (message.productDetail !== "") {
|
|
2948
|
-
obj.product_detail = message.productDetail;
|
|
2949
|
-
}
|
|
2950
|
-
if (message.currencyId !== undefined) {
|
|
2951
|
-
obj.currency_id = (message.currencyId || long_1.default.UZERO).toString();
|
|
2952
|
-
}
|
|
2953
|
-
if (message.discountPercent !== undefined) {
|
|
2954
|
-
obj.discount_percent = Math.round(message.discountPercent);
|
|
2955
|
-
}
|
|
2956
|
-
if (message.taxPrice !== 0) {
|
|
2957
|
-
obj.tax_price = message.taxPrice;
|
|
2958
|
-
}
|
|
2959
|
-
if (message.discount !== 0) {
|
|
2960
|
-
obj.discount = message.discount;
|
|
2961
|
-
}
|
|
2962
|
-
if (message.price !== 0) {
|
|
2963
|
-
obj.price = message.price;
|
|
2964
|
-
}
|
|
2965
|
-
if (message.months !== undefined) {
|
|
2966
|
-
obj.months = Math.round(message.months);
|
|
2967
|
-
}
|
|
2968
|
-
if (message.createdAt !== undefined) {
|
|
2969
|
-
obj.created_at = message.createdAt.toISOString();
|
|
2970
|
-
}
|
|
2971
|
-
if (message.updatedAt !== undefined) {
|
|
2972
|
-
obj.updated_at = message.updatedAt.toISOString();
|
|
2973
|
-
}
|
|
2974
|
-
if (message.product !== undefined) {
|
|
2975
|
-
obj.product = exports.Product.toJSON(message.product);
|
|
2976
|
-
}
|
|
2977
|
-
return obj;
|
|
2978
|
-
},
|
|
2979
|
-
create(base) {
|
|
2980
|
-
return exports.OrderProduct.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2981
|
-
},
|
|
2982
|
-
fromPartial(object) {
|
|
2983
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2984
|
-
const message = createBaseOrderProduct();
|
|
2985
|
-
message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
|
|
2986
|
-
message.orderId = (object.orderId !== undefined && object.orderId !== null)
|
|
2987
|
-
? long_1.default.fromValue(object.orderId)
|
|
2988
|
-
: undefined;
|
|
2989
|
-
message.productId = (object.productId !== undefined && object.productId !== null)
|
|
2990
|
-
? long_1.default.fromValue(object.productId)
|
|
2991
|
-
: undefined;
|
|
2992
|
-
message.productType = (_a = object.productType) !== null && _a !== void 0 ? _a : "";
|
|
2993
|
-
message.productName = (_b = object.productName) !== null && _b !== void 0 ? _b : "";
|
|
2994
|
-
message.productDetail = (_c = object.productDetail) !== null && _c !== void 0 ? _c : "";
|
|
2995
|
-
message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
|
|
2996
|
-
? long_1.default.fromValue(object.currencyId)
|
|
2997
|
-
: undefined;
|
|
2998
|
-
message.discountPercent = (_d = object.discountPercent) !== null && _d !== void 0 ? _d : undefined;
|
|
2999
|
-
message.taxPrice = (_e = object.taxPrice) !== null && _e !== void 0 ? _e : 0;
|
|
3000
|
-
message.discount = (_f = object.discount) !== null && _f !== void 0 ? _f : 0;
|
|
3001
|
-
message.price = (_g = object.price) !== null && _g !== void 0 ? _g : 0;
|
|
3002
|
-
message.months = (_h = object.months) !== null && _h !== void 0 ? _h : undefined;
|
|
3003
|
-
message.createdAt = (_j = object.createdAt) !== null && _j !== void 0 ? _j : undefined;
|
|
3004
|
-
message.updatedAt = (_k = object.updatedAt) !== null && _k !== void 0 ? _k : undefined;
|
|
3005
|
-
message.product = (object.product !== undefined && object.product !== null)
|
|
3006
|
-
? exports.Product.fromPartial(object.product)
|
|
3007
|
-
: undefined;
|
|
3008
|
-
return message;
|
|
3009
|
-
},
|
|
3010
|
-
};
|
|
3011
|
-
function createBaseProduct() {
|
|
3012
|
-
return {
|
|
3013
|
-
id: long_1.default.UZERO,
|
|
3014
|
-
organizationId: undefined,
|
|
3015
|
-
productTypeId: undefined,
|
|
3016
|
-
createdBy: undefined,
|
|
3017
|
-
updatedBy: undefined,
|
|
3018
|
-
name: "",
|
|
3019
|
-
displayName: undefined,
|
|
3020
|
-
description: undefined,
|
|
3021
|
-
properties: undefined,
|
|
3022
|
-
picture: undefined,
|
|
3023
|
-
slug: undefined,
|
|
3024
|
-
uuid: undefined,
|
|
3025
|
-
objectType: undefined,
|
|
3026
|
-
objectId: undefined,
|
|
3027
|
-
currencyId: long_1.default.UZERO,
|
|
3028
|
-
price: long_1.default.UZERO,
|
|
3029
|
-
createdAt: undefined,
|
|
3030
|
-
updatedAt: undefined,
|
|
3031
|
-
components: [],
|
|
3032
|
-
currency: undefined,
|
|
3033
|
-
productType: undefined,
|
|
3034
|
-
};
|
|
3035
|
-
}
|
|
3036
|
-
exports.Product = {
|
|
3037
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
3038
|
-
if (!message.id.equals(long_1.default.UZERO)) {
|
|
3039
|
-
writer.uint32(8).uint64(message.id.toString());
|
|
3040
|
-
}
|
|
3041
|
-
if (message.organizationId !== undefined) {
|
|
3042
|
-
writer.uint32(16).uint64(message.organizationId.toString());
|
|
3043
|
-
}
|
|
3044
|
-
if (message.productTypeId !== undefined) {
|
|
3045
|
-
writer.uint32(24).uint64(message.productTypeId.toString());
|
|
3046
|
-
}
|
|
3047
|
-
if (message.createdBy !== undefined) {
|
|
3048
|
-
writer.uint32(32).uint64(message.createdBy.toString());
|
|
3049
|
-
}
|
|
3050
|
-
if (message.updatedBy !== undefined) {
|
|
3051
|
-
writer.uint32(40).uint64(message.updatedBy.toString());
|
|
3052
|
-
}
|
|
3053
|
-
if (message.name !== "") {
|
|
3054
|
-
writer.uint32(50).string(message.name);
|
|
3055
|
-
}
|
|
3056
|
-
if (message.displayName !== undefined) {
|
|
3057
|
-
writer.uint32(58).string(message.displayName);
|
|
3058
|
-
}
|
|
3059
|
-
if (message.description !== undefined) {
|
|
3060
|
-
writer.uint32(66).string(message.description);
|
|
3061
|
-
}
|
|
3062
|
-
if (message.properties !== undefined) {
|
|
3063
|
-
writer.uint32(74).string(message.properties);
|
|
3064
|
-
}
|
|
3065
|
-
if (message.picture !== undefined) {
|
|
3066
|
-
writer.uint32(82).string(message.picture);
|
|
3067
|
-
}
|
|
3068
|
-
if (message.slug !== undefined) {
|
|
3069
|
-
writer.uint32(90).string(message.slug);
|
|
3070
|
-
}
|
|
3071
|
-
if (message.uuid !== undefined) {
|
|
3072
|
-
writer.uint32(98).string(message.uuid);
|
|
3073
|
-
}
|
|
3074
|
-
if (message.objectType !== undefined) {
|
|
3075
|
-
writer.uint32(106).string(message.objectType);
|
|
3076
|
-
}
|
|
3077
|
-
if (message.objectId !== undefined) {
|
|
3078
|
-
writer.uint32(112).uint64(message.objectId.toString());
|
|
3079
|
-
}
|
|
3080
|
-
if (!message.currencyId.equals(long_1.default.UZERO)) {
|
|
3081
|
-
writer.uint32(120).uint64(message.currencyId.toString());
|
|
3082
|
-
}
|
|
3083
|
-
if (!message.price.equals(long_1.default.UZERO)) {
|
|
3084
|
-
writer.uint32(128).uint64(message.price.toString());
|
|
3085
|
-
}
|
|
3086
|
-
if (message.createdAt !== undefined) {
|
|
3087
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(138).fork()).join();
|
|
3088
|
-
}
|
|
3089
|
-
if (message.updatedAt !== undefined) {
|
|
3090
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(146).fork()).join();
|
|
3091
|
-
}
|
|
3092
|
-
for (const v of message.components) {
|
|
3093
|
-
exports.Product.encode(v, writer.uint32(186).fork()).join();
|
|
3094
|
-
}
|
|
3095
|
-
if (message.currency !== undefined) {
|
|
3096
|
-
financial_1.Currency.encode(message.currency, writer.uint32(154).fork()).join();
|
|
3097
|
-
}
|
|
3098
|
-
if (message.productType !== undefined) {
|
|
3099
|
-
exports.ProductType.encode(message.productType, writer.uint32(162).fork()).join();
|
|
3100
|
-
}
|
|
3101
|
-
return writer;
|
|
3102
|
-
},
|
|
3103
|
-
decode(input, length) {
|
|
3104
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
3105
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3106
|
-
const message = createBaseProduct();
|
|
3107
|
-
while (reader.pos < end) {
|
|
3108
|
-
const tag = reader.uint32();
|
|
3109
|
-
switch (tag >>> 3) {
|
|
3110
|
-
case 1: {
|
|
3111
|
-
if (tag !== 8) {
|
|
3112
|
-
break;
|
|
3113
|
-
}
|
|
3114
|
-
message.id = long_1.default.fromString(reader.uint64().toString(), true);
|
|
3115
|
-
continue;
|
|
3116
|
-
}
|
|
3117
|
-
case 2: {
|
|
3118
|
-
if (tag !== 16) {
|
|
3119
|
-
break;
|
|
3120
|
-
}
|
|
3121
|
-
message.organizationId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
3122
|
-
continue;
|
|
3123
|
-
}
|
|
3124
|
-
case 3: {
|
|
3125
|
-
if (tag !== 24) {
|
|
3126
|
-
break;
|
|
3127
|
-
}
|
|
3128
|
-
message.productTypeId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
2389
|
+
message.productId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
3129
2390
|
continue;
|
|
3130
2391
|
}
|
|
3131
2392
|
case 4: {
|
|
3132
|
-
if (tag !==
|
|
2393
|
+
if (tag !== 34) {
|
|
3133
2394
|
break;
|
|
3134
2395
|
}
|
|
3135
|
-
message.
|
|
2396
|
+
message.productType = reader.string();
|
|
3136
2397
|
continue;
|
|
3137
2398
|
}
|
|
3138
2399
|
case 5: {
|
|
3139
|
-
if (tag !==
|
|
2400
|
+
if (tag !== 42) {
|
|
3140
2401
|
break;
|
|
3141
2402
|
}
|
|
3142
|
-
message.
|
|
2403
|
+
message.productName = reader.string();
|
|
3143
2404
|
continue;
|
|
3144
2405
|
}
|
|
3145
2406
|
case 6: {
|
|
3146
2407
|
if (tag !== 50) {
|
|
3147
2408
|
break;
|
|
3148
2409
|
}
|
|
3149
|
-
message.
|
|
2410
|
+
message.productDetail = reader.string();
|
|
3150
2411
|
continue;
|
|
3151
2412
|
}
|
|
3152
2413
|
case 7: {
|
|
3153
|
-
if (tag !==
|
|
2414
|
+
if (tag !== 56) {
|
|
3154
2415
|
break;
|
|
3155
2416
|
}
|
|
3156
|
-
message.
|
|
2417
|
+
message.currencyId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
3157
2418
|
continue;
|
|
3158
2419
|
}
|
|
3159
2420
|
case 8: {
|
|
3160
|
-
if (tag !==
|
|
2421
|
+
if (tag !== 64) {
|
|
3161
2422
|
break;
|
|
3162
2423
|
}
|
|
3163
|
-
message.
|
|
2424
|
+
message.discountPercent = reader.uint32();
|
|
3164
2425
|
continue;
|
|
3165
2426
|
}
|
|
3166
2427
|
case 9: {
|
|
3167
|
-
if (tag !==
|
|
2428
|
+
if (tag !== 73) {
|
|
3168
2429
|
break;
|
|
3169
2430
|
}
|
|
3170
|
-
message.
|
|
2431
|
+
message.taxPrice = reader.double();
|
|
3171
2432
|
continue;
|
|
3172
2433
|
}
|
|
3173
2434
|
case 10: {
|
|
3174
|
-
if (tag !==
|
|
2435
|
+
if (tag !== 81) {
|
|
3175
2436
|
break;
|
|
3176
2437
|
}
|
|
3177
|
-
message.
|
|
2438
|
+
message.discount = reader.double();
|
|
3178
2439
|
continue;
|
|
3179
2440
|
}
|
|
3180
2441
|
case 11: {
|
|
3181
|
-
if (tag !==
|
|
2442
|
+
if (tag !== 89) {
|
|
3182
2443
|
break;
|
|
3183
2444
|
}
|
|
3184
|
-
message.
|
|
2445
|
+
message.price = reader.double();
|
|
3185
2446
|
continue;
|
|
3186
2447
|
}
|
|
3187
2448
|
case 12: {
|
|
3188
|
-
if (tag !==
|
|
2449
|
+
if (tag !== 96) {
|
|
3189
2450
|
break;
|
|
3190
2451
|
}
|
|
3191
|
-
message.
|
|
2452
|
+
message.months = reader.uint32();
|
|
3192
2453
|
continue;
|
|
3193
2454
|
}
|
|
3194
2455
|
case 13: {
|
|
3195
2456
|
if (tag !== 106) {
|
|
3196
2457
|
break;
|
|
3197
2458
|
}
|
|
3198
|
-
message.objectType = reader.string();
|
|
3199
|
-
continue;
|
|
3200
|
-
}
|
|
3201
|
-
case 14: {
|
|
3202
|
-
if (tag !== 112) {
|
|
3203
|
-
break;
|
|
3204
|
-
}
|
|
3205
|
-
message.objectId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
3206
|
-
continue;
|
|
3207
|
-
}
|
|
3208
|
-
case 15: {
|
|
3209
|
-
if (tag !== 120) {
|
|
3210
|
-
break;
|
|
3211
|
-
}
|
|
3212
|
-
message.currencyId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
3213
|
-
continue;
|
|
3214
|
-
}
|
|
3215
|
-
case 16: {
|
|
3216
|
-
if (tag !== 128) {
|
|
3217
|
-
break;
|
|
3218
|
-
}
|
|
3219
|
-
message.price = long_1.default.fromString(reader.uint64().toString(), true);
|
|
3220
|
-
continue;
|
|
3221
|
-
}
|
|
3222
|
-
case 17: {
|
|
3223
|
-
if (tag !== 138) {
|
|
3224
|
-
break;
|
|
3225
|
-
}
|
|
3226
2459
|
message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
3227
2460
|
continue;
|
|
3228
2461
|
}
|
|
3229
|
-
case
|
|
3230
|
-
if (tag !==
|
|
2462
|
+
case 14: {
|
|
2463
|
+
if (tag !== 114) {
|
|
3231
2464
|
break;
|
|
3232
2465
|
}
|
|
3233
2466
|
message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
3234
2467
|
continue;
|
|
3235
2468
|
}
|
|
3236
|
-
case
|
|
3237
|
-
if (tag !==
|
|
3238
|
-
break;
|
|
3239
|
-
}
|
|
3240
|
-
message.components.push(exports.Product.decode(reader, reader.uint32()));
|
|
3241
|
-
continue;
|
|
3242
|
-
}
|
|
3243
|
-
case 19: {
|
|
3244
|
-
if (tag !== 154) {
|
|
3245
|
-
break;
|
|
3246
|
-
}
|
|
3247
|
-
message.currency = financial_1.Currency.decode(reader, reader.uint32());
|
|
3248
|
-
continue;
|
|
3249
|
-
}
|
|
3250
|
-
case 20: {
|
|
3251
|
-
if (tag !== 162) {
|
|
2469
|
+
case 15: {
|
|
2470
|
+
if (tag !== 122) {
|
|
3252
2471
|
break;
|
|
3253
2472
|
}
|
|
3254
|
-
message.
|
|
2473
|
+
message.product = financial_1.Product.decode(reader, reader.uint32());
|
|
3255
2474
|
continue;
|
|
3256
2475
|
}
|
|
3257
2476
|
}
|
|
@@ -3265,80 +2484,59 @@ exports.Product = {
|
|
|
3265
2484
|
fromJSON(object) {
|
|
3266
2485
|
return {
|
|
3267
2486
|
id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
objectType: isSet(object.object_type) ? globalThis.String(object.object_type) : undefined,
|
|
3280
|
-
objectId: isSet(object.object_id) ? long_1.default.fromValue(object.object_id) : undefined,
|
|
3281
|
-
currencyId: isSet(object.currency_id) ? long_1.default.fromValue(object.currency_id) : long_1.default.UZERO,
|
|
3282
|
-
price: isSet(object.price) ? long_1.default.fromValue(object.price) : 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,
|
|
3283
2498
|
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
3284
2499
|
updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
|
|
3285
|
-
|
|
3286
|
-
? object.components.map((e) => exports.Product.fromJSON(e))
|
|
3287
|
-
: [],
|
|
3288
|
-
currency: isSet(object.currency) ? financial_1.Currency.fromJSON(object.currency) : undefined,
|
|
3289
|
-
productType: isSet(object.product_type) ? exports.ProductType.fromJSON(object.product_type) : undefined,
|
|
2500
|
+
product: isSet(object.product) ? financial_1.Product.fromJSON(object.product) : undefined,
|
|
3290
2501
|
};
|
|
3291
2502
|
},
|
|
3292
2503
|
toJSON(message) {
|
|
3293
|
-
var _a;
|
|
3294
2504
|
const obj = {};
|
|
3295
2505
|
if (!message.id.equals(long_1.default.UZERO)) {
|
|
3296
2506
|
obj.id = (message.id || long_1.default.UZERO).toString();
|
|
3297
2507
|
}
|
|
3298
|
-
if (message.
|
|
3299
|
-
obj.
|
|
3300
|
-
}
|
|
3301
|
-
if (message.productTypeId !== undefined) {
|
|
3302
|
-
obj.product_type_id = (message.productTypeId || long_1.default.UZERO).toString();
|
|
3303
|
-
}
|
|
3304
|
-
if (message.createdBy !== undefined) {
|
|
3305
|
-
obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
|
|
3306
|
-
}
|
|
3307
|
-
if (message.updatedBy !== undefined) {
|
|
3308
|
-
obj.updated_by = (message.updatedBy || long_1.default.UZERO).toString();
|
|
3309
|
-
}
|
|
3310
|
-
if (message.name !== "") {
|
|
3311
|
-
obj.name = message.name;
|
|
2508
|
+
if (message.orderId !== undefined) {
|
|
2509
|
+
obj.order_id = (message.orderId || long_1.default.UZERO).toString();
|
|
3312
2510
|
}
|
|
3313
|
-
if (message.
|
|
3314
|
-
obj.
|
|
2511
|
+
if (message.productId !== undefined) {
|
|
2512
|
+
obj.product_id = (message.productId || long_1.default.UZERO).toString();
|
|
3315
2513
|
}
|
|
3316
|
-
if (message.
|
|
3317
|
-
obj.
|
|
2514
|
+
if (message.productType !== "") {
|
|
2515
|
+
obj.product_type = message.productType;
|
|
3318
2516
|
}
|
|
3319
|
-
if (message.
|
|
3320
|
-
obj.
|
|
2517
|
+
if (message.productName !== "") {
|
|
2518
|
+
obj.product_name = message.productName;
|
|
3321
2519
|
}
|
|
3322
|
-
if (message.
|
|
3323
|
-
obj.
|
|
2520
|
+
if (message.productDetail !== "") {
|
|
2521
|
+
obj.product_detail = message.productDetail;
|
|
3324
2522
|
}
|
|
3325
|
-
if (message.
|
|
3326
|
-
obj.
|
|
2523
|
+
if (message.currencyId !== undefined) {
|
|
2524
|
+
obj.currency_id = (message.currencyId || long_1.default.UZERO).toString();
|
|
3327
2525
|
}
|
|
3328
|
-
if (message.
|
|
3329
|
-
obj.
|
|
2526
|
+
if (message.discountPercent !== undefined) {
|
|
2527
|
+
obj.discount_percent = Math.round(message.discountPercent);
|
|
3330
2528
|
}
|
|
3331
|
-
if (message.
|
|
3332
|
-
obj.
|
|
2529
|
+
if (message.taxPrice !== 0) {
|
|
2530
|
+
obj.tax_price = message.taxPrice;
|
|
3333
2531
|
}
|
|
3334
|
-
if (message.
|
|
3335
|
-
obj.
|
|
2532
|
+
if (message.discount !== 0) {
|
|
2533
|
+
obj.discount = message.discount;
|
|
3336
2534
|
}
|
|
3337
|
-
if (
|
|
3338
|
-
obj.
|
|
2535
|
+
if (message.price !== 0) {
|
|
2536
|
+
obj.price = message.price;
|
|
3339
2537
|
}
|
|
3340
|
-
if (
|
|
3341
|
-
obj.
|
|
2538
|
+
if (message.months !== undefined) {
|
|
2539
|
+
obj.months = Math.round(message.months);
|
|
3342
2540
|
}
|
|
3343
2541
|
if (message.createdAt !== undefined) {
|
|
3344
2542
|
obj.created_at = message.createdAt.toISOString();
|
|
@@ -3346,59 +2544,39 @@ exports.Product = {
|
|
|
3346
2544
|
if (message.updatedAt !== undefined) {
|
|
3347
2545
|
obj.updated_at = message.updatedAt.toISOString();
|
|
3348
2546
|
}
|
|
3349
|
-
if (
|
|
3350
|
-
obj.
|
|
3351
|
-
}
|
|
3352
|
-
if (message.currency !== undefined) {
|
|
3353
|
-
obj.currency = financial_1.Currency.toJSON(message.currency);
|
|
3354
|
-
}
|
|
3355
|
-
if (message.productType !== undefined) {
|
|
3356
|
-
obj.product_type = exports.ProductType.toJSON(message.productType);
|
|
2547
|
+
if (message.product !== undefined) {
|
|
2548
|
+
obj.product = financial_1.Product.toJSON(message.product);
|
|
3357
2549
|
}
|
|
3358
2550
|
return obj;
|
|
3359
2551
|
},
|
|
3360
2552
|
create(base) {
|
|
3361
|
-
return exports.
|
|
2553
|
+
return exports.OrderProduct.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
3362
2554
|
},
|
|
3363
2555
|
fromPartial(object) {
|
|
3364
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
3365
|
-
const message =
|
|
2556
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2557
|
+
const message = createBaseOrderProduct();
|
|
3366
2558
|
message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
|
|
3367
|
-
message.
|
|
3368
|
-
? long_1.default.fromValue(object.
|
|
3369
|
-
: undefined;
|
|
3370
|
-
message.productTypeId = (object.productTypeId !== undefined && object.productTypeId !== null)
|
|
3371
|
-
? long_1.default.fromValue(object.productTypeId)
|
|
3372
|
-
: undefined;
|
|
3373
|
-
message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
|
|
3374
|
-
? long_1.default.fromValue(object.createdBy)
|
|
3375
|
-
: undefined;
|
|
3376
|
-
message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
|
|
3377
|
-
? long_1.default.fromValue(object.updatedBy)
|
|
2559
|
+
message.orderId = (object.orderId !== undefined && object.orderId !== null)
|
|
2560
|
+
? long_1.default.fromValue(object.orderId)
|
|
3378
2561
|
: undefined;
|
|
3379
|
-
message.
|
|
3380
|
-
|
|
3381
|
-
message.description = (_c = object.description) !== null && _c !== void 0 ? _c : undefined;
|
|
3382
|
-
message.properties = (_d = object.properties) !== null && _d !== void 0 ? _d : undefined;
|
|
3383
|
-
message.picture = (_e = object.picture) !== null && _e !== void 0 ? _e : undefined;
|
|
3384
|
-
message.slug = (_f = object.slug) !== null && _f !== void 0 ? _f : undefined;
|
|
3385
|
-
message.uuid = (_g = object.uuid) !== null && _g !== void 0 ? _g : undefined;
|
|
3386
|
-
message.objectType = (_h = object.objectType) !== null && _h !== void 0 ? _h : undefined;
|
|
3387
|
-
message.objectId = (object.objectId !== undefined && object.objectId !== null)
|
|
3388
|
-
? long_1.default.fromValue(object.objectId)
|
|
2562
|
+
message.productId = (object.productId !== undefined && object.productId !== null)
|
|
2563
|
+
? long_1.default.fromValue(object.productId)
|
|
3389
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 : "";
|
|
3390
2568
|
message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
|
|
3391
2569
|
? long_1.default.fromValue(object.currencyId)
|
|
3392
|
-
:
|
|
3393
|
-
message.
|
|
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;
|
|
3394
2576
|
message.createdAt = (_j = object.createdAt) !== null && _j !== void 0 ? _j : undefined;
|
|
3395
2577
|
message.updatedAt = (_k = object.updatedAt) !== null && _k !== void 0 ? _k : undefined;
|
|
3396
|
-
message.
|
|
3397
|
-
|
|
3398
|
-
? financial_1.Currency.fromPartial(object.currency)
|
|
3399
|
-
: undefined;
|
|
3400
|
-
message.productType = (object.productType !== undefined && object.productType !== null)
|
|
3401
|
-
? exports.ProductType.fromPartial(object.productType)
|
|
2578
|
+
message.product = (object.product !== undefined && object.product !== null)
|
|
2579
|
+
? financial_1.Product.fromPartial(object.product)
|
|
3402
2580
|
: undefined;
|
|
3403
2581
|
return message;
|
|
3404
2582
|
},
|
|
@@ -6009,112 +5187,6 @@ exports.ServicePagination = {
|
|
|
6009
5187
|
return message;
|
|
6010
5188
|
},
|
|
6011
5189
|
};
|
|
6012
|
-
function createBaseSubscriptionIndex() {
|
|
6013
|
-
return { partnerId: long_1.default.UZERO, customSubs: [], packages: [], gateways: [] };
|
|
6014
|
-
}
|
|
6015
|
-
exports.SubscriptionIndex = {
|
|
6016
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
6017
|
-
if (!message.partnerId.equals(long_1.default.UZERO)) {
|
|
6018
|
-
writer.uint32(8).uint64(message.partnerId.toString());
|
|
6019
|
-
}
|
|
6020
|
-
for (const v of message.customSubs) {
|
|
6021
|
-
exports.Product.encode(v, writer.uint32(18).fork()).join();
|
|
6022
|
-
}
|
|
6023
|
-
for (const v of message.packages) {
|
|
6024
|
-
exports.Product.encode(v, writer.uint32(26).fork()).join();
|
|
6025
|
-
}
|
|
6026
|
-
for (const v of message.gateways) {
|
|
6027
|
-
exports.PaymentGateway.encode(v, writer.uint32(34).fork()).join();
|
|
6028
|
-
}
|
|
6029
|
-
return writer;
|
|
6030
|
-
},
|
|
6031
|
-
decode(input, length) {
|
|
6032
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
6033
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
6034
|
-
const message = createBaseSubscriptionIndex();
|
|
6035
|
-
while (reader.pos < end) {
|
|
6036
|
-
const tag = reader.uint32();
|
|
6037
|
-
switch (tag >>> 3) {
|
|
6038
|
-
case 1: {
|
|
6039
|
-
if (tag !== 8) {
|
|
6040
|
-
break;
|
|
6041
|
-
}
|
|
6042
|
-
message.partnerId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
6043
|
-
continue;
|
|
6044
|
-
}
|
|
6045
|
-
case 2: {
|
|
6046
|
-
if (tag !== 18) {
|
|
6047
|
-
break;
|
|
6048
|
-
}
|
|
6049
|
-
message.customSubs.push(exports.Product.decode(reader, reader.uint32()));
|
|
6050
|
-
continue;
|
|
6051
|
-
}
|
|
6052
|
-
case 3: {
|
|
6053
|
-
if (tag !== 26) {
|
|
6054
|
-
break;
|
|
6055
|
-
}
|
|
6056
|
-
message.packages.push(exports.Product.decode(reader, reader.uint32()));
|
|
6057
|
-
continue;
|
|
6058
|
-
}
|
|
6059
|
-
case 4: {
|
|
6060
|
-
if (tag !== 34) {
|
|
6061
|
-
break;
|
|
6062
|
-
}
|
|
6063
|
-
message.gateways.push(exports.PaymentGateway.decode(reader, reader.uint32()));
|
|
6064
|
-
continue;
|
|
6065
|
-
}
|
|
6066
|
-
}
|
|
6067
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
6068
|
-
break;
|
|
6069
|
-
}
|
|
6070
|
-
reader.skip(tag & 7);
|
|
6071
|
-
}
|
|
6072
|
-
return message;
|
|
6073
|
-
},
|
|
6074
|
-
fromJSON(object) {
|
|
6075
|
-
return {
|
|
6076
|
-
partnerId: isSet(object.partnerId) ? long_1.default.fromValue(object.partnerId) : long_1.default.UZERO,
|
|
6077
|
-
customSubs: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.customSubs)
|
|
6078
|
-
? object.customSubs.map((e) => exports.Product.fromJSON(e))
|
|
6079
|
-
: [],
|
|
6080
|
-
packages: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.packages) ? object.packages.map((e) => exports.Product.fromJSON(e)) : [],
|
|
6081
|
-
gateways: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.gateways)
|
|
6082
|
-
? object.gateways.map((e) => exports.PaymentGateway.fromJSON(e))
|
|
6083
|
-
: [],
|
|
6084
|
-
};
|
|
6085
|
-
},
|
|
6086
|
-
toJSON(message) {
|
|
6087
|
-
var _a, _b, _c;
|
|
6088
|
-
const obj = {};
|
|
6089
|
-
if (!message.partnerId.equals(long_1.default.UZERO)) {
|
|
6090
|
-
obj.partnerId = (message.partnerId || long_1.default.UZERO).toString();
|
|
6091
|
-
}
|
|
6092
|
-
if ((_a = message.customSubs) === null || _a === void 0 ? void 0 : _a.length) {
|
|
6093
|
-
obj.customSubs = message.customSubs.map((e) => exports.Product.toJSON(e));
|
|
6094
|
-
}
|
|
6095
|
-
if ((_b = message.packages) === null || _b === void 0 ? void 0 : _b.length) {
|
|
6096
|
-
obj.packages = message.packages.map((e) => exports.Product.toJSON(e));
|
|
6097
|
-
}
|
|
6098
|
-
if ((_c = message.gateways) === null || _c === void 0 ? void 0 : _c.length) {
|
|
6099
|
-
obj.gateways = message.gateways.map((e) => exports.PaymentGateway.toJSON(e));
|
|
6100
|
-
}
|
|
6101
|
-
return obj;
|
|
6102
|
-
},
|
|
6103
|
-
create(base) {
|
|
6104
|
-
return exports.SubscriptionIndex.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
6105
|
-
},
|
|
6106
|
-
fromPartial(object) {
|
|
6107
|
-
var _a, _b, _c;
|
|
6108
|
-
const message = createBaseSubscriptionIndex();
|
|
6109
|
-
message.partnerId = (object.partnerId !== undefined && object.partnerId !== null)
|
|
6110
|
-
? long_1.default.fromValue(object.partnerId)
|
|
6111
|
-
: long_1.default.UZERO;
|
|
6112
|
-
message.customSubs = ((_a = object.customSubs) === null || _a === void 0 ? void 0 : _a.map((e) => exports.Product.fromPartial(e))) || [];
|
|
6113
|
-
message.packages = ((_b = object.packages) === null || _b === void 0 ? void 0 : _b.map((e) => exports.Product.fromPartial(e))) || [];
|
|
6114
|
-
message.gateways = ((_c = object.gateways) === null || _c === void 0 ? void 0 : _c.map((e) => exports.PaymentGateway.fromPartial(e))) || [];
|
|
6115
|
-
return message;
|
|
6116
|
-
},
|
|
6117
|
-
};
|
|
6118
5190
|
function toTimestamp(date) {
|
|
6119
5191
|
const seconds = numberToLong(Math.trunc(date.getTime() / 1000));
|
|
6120
5192
|
const nanos = (date.getTime() % 1000) * 1000000;
|