@fatehan/tsrp 1.4.21 → 1.4.23
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/fatehan/financial/financial.d.ts +67 -0
- package/dist/fatehan/financial/financial.d.ts.map +1 -1
- package/dist/fatehan/financial/financial.js +1053 -1
- package/dist/fatehan/identities/identities.d.ts +9 -0
- package/dist/fatehan/identities/identities.d.ts.map +1 -1
- package/dist/fatehan/identities/identities.js +49 -0
- package/dist/fatehan/packets/dataModule.d.ts +26 -12
- package/dist/fatehan/packets/dataModule.d.ts.map +1 -1
- package/dist/fatehan/packets/dataModule.js +215 -89
- package/dist/fatehan/services/api.d.ts +7 -1
- package/dist/fatehan/services/api.d.ts.map +1 -1
- package/dist/fatehan/services/api.js +88 -2
- package/package.json +3 -3
|
@@ -8,11 +8,12 @@ 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.PaymentGateway_Config = exports.PaymentGateway = exports.Product = exports.ProductType = exports.Currency = exports.Wallet = exports.protobufPackage = void 0;
|
|
11
|
+
exports.OrderProduct = exports.Order = exports.OrderPagination = exports.PaymentGateway_Config = exports.PaymentGateway = exports.Product = exports.ProductType = exports.Partner = exports.Currency = exports.Wallet = 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"));
|
|
15
15
|
const timestamp_1 = require("../google/protobuf/timestamp");
|
|
16
|
+
const identities_1 = require("../identities/identities");
|
|
16
17
|
exports.protobufPackage = "com.fatehan.financial";
|
|
17
18
|
function createBaseWallet() {
|
|
18
19
|
return {
|
|
@@ -356,6 +357,91 @@ exports.Currency = {
|
|
|
356
357
|
return message;
|
|
357
358
|
},
|
|
358
359
|
};
|
|
360
|
+
function createBasePartner() {
|
|
361
|
+
return { id: long_1.default.UZERO, name: undefined, domains: [] };
|
|
362
|
+
}
|
|
363
|
+
exports.Partner = {
|
|
364
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
365
|
+
if (!message.id.equals(long_1.default.UZERO)) {
|
|
366
|
+
writer.uint32(8).uint64(message.id.toString());
|
|
367
|
+
}
|
|
368
|
+
if (message.name !== undefined) {
|
|
369
|
+
writer.uint32(26).string(message.name);
|
|
370
|
+
}
|
|
371
|
+
for (const v of message.domains) {
|
|
372
|
+
writer.uint32(18).string(v);
|
|
373
|
+
}
|
|
374
|
+
return writer;
|
|
375
|
+
},
|
|
376
|
+
decode(input, length) {
|
|
377
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
378
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
379
|
+
const message = createBasePartner();
|
|
380
|
+
while (reader.pos < end) {
|
|
381
|
+
const tag = reader.uint32();
|
|
382
|
+
switch (tag >>> 3) {
|
|
383
|
+
case 1: {
|
|
384
|
+
if (tag !== 8) {
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
message.id = long_1.default.fromString(reader.uint64().toString(), true);
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
case 3: {
|
|
391
|
+
if (tag !== 26) {
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
message.name = reader.string();
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
case 2: {
|
|
398
|
+
if (tag !== 18) {
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
message.domains.push(reader.string());
|
|
402
|
+
continue;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
reader.skip(tag & 7);
|
|
409
|
+
}
|
|
410
|
+
return message;
|
|
411
|
+
},
|
|
412
|
+
fromJSON(object) {
|
|
413
|
+
return {
|
|
414
|
+
id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
|
|
415
|
+
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
|
|
416
|
+
domains: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.domains) ? object.domains.map((e) => globalThis.String(e)) : [],
|
|
417
|
+
};
|
|
418
|
+
},
|
|
419
|
+
toJSON(message) {
|
|
420
|
+
var _a;
|
|
421
|
+
const obj = {};
|
|
422
|
+
if (!message.id.equals(long_1.default.UZERO)) {
|
|
423
|
+
obj.id = (message.id || long_1.default.UZERO).toString();
|
|
424
|
+
}
|
|
425
|
+
if (message.name !== undefined) {
|
|
426
|
+
obj.name = message.name;
|
|
427
|
+
}
|
|
428
|
+
if ((_a = message.domains) === null || _a === void 0 ? void 0 : _a.length) {
|
|
429
|
+
obj.domains = message.domains;
|
|
430
|
+
}
|
|
431
|
+
return obj;
|
|
432
|
+
},
|
|
433
|
+
create(base) {
|
|
434
|
+
return exports.Partner.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
435
|
+
},
|
|
436
|
+
fromPartial(object) {
|
|
437
|
+
var _a, _b;
|
|
438
|
+
const message = createBasePartner();
|
|
439
|
+
message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
|
|
440
|
+
message.name = (_a = object.name) !== null && _a !== void 0 ? _a : undefined;
|
|
441
|
+
message.domains = ((_b = object.domains) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
|
|
442
|
+
return message;
|
|
443
|
+
},
|
|
444
|
+
};
|
|
359
445
|
function createBaseProductType() {
|
|
360
446
|
return {
|
|
361
447
|
id: long_1.default.UZERO,
|
|
@@ -1178,6 +1264,972 @@ exports.PaymentGateway_Config = {
|
|
|
1178
1264
|
return message;
|
|
1179
1265
|
},
|
|
1180
1266
|
};
|
|
1267
|
+
function createBaseOrderPagination() {
|
|
1268
|
+
return {
|
|
1269
|
+
currentPage: 0,
|
|
1270
|
+
firstPageUrl: "",
|
|
1271
|
+
lastPageUrl: "",
|
|
1272
|
+
nextPageUrl: "",
|
|
1273
|
+
prevPageUrl: "",
|
|
1274
|
+
path: "",
|
|
1275
|
+
from: 0,
|
|
1276
|
+
lastPage: 0,
|
|
1277
|
+
perPage: 0,
|
|
1278
|
+
to: 0,
|
|
1279
|
+
data: [],
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
exports.OrderPagination = {
|
|
1283
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1284
|
+
if (message.currentPage !== 0) {
|
|
1285
|
+
writer.uint32(8).uint32(message.currentPage);
|
|
1286
|
+
}
|
|
1287
|
+
if (message.firstPageUrl !== "") {
|
|
1288
|
+
writer.uint32(18).string(message.firstPageUrl);
|
|
1289
|
+
}
|
|
1290
|
+
if (message.lastPageUrl !== "") {
|
|
1291
|
+
writer.uint32(26).string(message.lastPageUrl);
|
|
1292
|
+
}
|
|
1293
|
+
if (message.nextPageUrl !== "") {
|
|
1294
|
+
writer.uint32(34).string(message.nextPageUrl);
|
|
1295
|
+
}
|
|
1296
|
+
if (message.prevPageUrl !== "") {
|
|
1297
|
+
writer.uint32(42).string(message.prevPageUrl);
|
|
1298
|
+
}
|
|
1299
|
+
if (message.path !== "") {
|
|
1300
|
+
writer.uint32(50).string(message.path);
|
|
1301
|
+
}
|
|
1302
|
+
if (message.from !== 0) {
|
|
1303
|
+
writer.uint32(56).uint32(message.from);
|
|
1304
|
+
}
|
|
1305
|
+
if (message.lastPage !== 0) {
|
|
1306
|
+
writer.uint32(64).uint32(message.lastPage);
|
|
1307
|
+
}
|
|
1308
|
+
if (message.perPage !== 0) {
|
|
1309
|
+
writer.uint32(72).uint32(message.perPage);
|
|
1310
|
+
}
|
|
1311
|
+
if (message.to !== 0) {
|
|
1312
|
+
writer.uint32(80).uint32(message.to);
|
|
1313
|
+
}
|
|
1314
|
+
for (const v of message.data) {
|
|
1315
|
+
exports.Order.encode(v, writer.uint32(90).fork()).join();
|
|
1316
|
+
}
|
|
1317
|
+
return writer;
|
|
1318
|
+
},
|
|
1319
|
+
decode(input, length) {
|
|
1320
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1321
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1322
|
+
const message = createBaseOrderPagination();
|
|
1323
|
+
while (reader.pos < end) {
|
|
1324
|
+
const tag = reader.uint32();
|
|
1325
|
+
switch (tag >>> 3) {
|
|
1326
|
+
case 1: {
|
|
1327
|
+
if (tag !== 8) {
|
|
1328
|
+
break;
|
|
1329
|
+
}
|
|
1330
|
+
message.currentPage = reader.uint32();
|
|
1331
|
+
continue;
|
|
1332
|
+
}
|
|
1333
|
+
case 2: {
|
|
1334
|
+
if (tag !== 18) {
|
|
1335
|
+
break;
|
|
1336
|
+
}
|
|
1337
|
+
message.firstPageUrl = reader.string();
|
|
1338
|
+
continue;
|
|
1339
|
+
}
|
|
1340
|
+
case 3: {
|
|
1341
|
+
if (tag !== 26) {
|
|
1342
|
+
break;
|
|
1343
|
+
}
|
|
1344
|
+
message.lastPageUrl = reader.string();
|
|
1345
|
+
continue;
|
|
1346
|
+
}
|
|
1347
|
+
case 4: {
|
|
1348
|
+
if (tag !== 34) {
|
|
1349
|
+
break;
|
|
1350
|
+
}
|
|
1351
|
+
message.nextPageUrl = reader.string();
|
|
1352
|
+
continue;
|
|
1353
|
+
}
|
|
1354
|
+
case 5: {
|
|
1355
|
+
if (tag !== 42) {
|
|
1356
|
+
break;
|
|
1357
|
+
}
|
|
1358
|
+
message.prevPageUrl = reader.string();
|
|
1359
|
+
continue;
|
|
1360
|
+
}
|
|
1361
|
+
case 6: {
|
|
1362
|
+
if (tag !== 50) {
|
|
1363
|
+
break;
|
|
1364
|
+
}
|
|
1365
|
+
message.path = reader.string();
|
|
1366
|
+
continue;
|
|
1367
|
+
}
|
|
1368
|
+
case 7: {
|
|
1369
|
+
if (tag !== 56) {
|
|
1370
|
+
break;
|
|
1371
|
+
}
|
|
1372
|
+
message.from = reader.uint32();
|
|
1373
|
+
continue;
|
|
1374
|
+
}
|
|
1375
|
+
case 8: {
|
|
1376
|
+
if (tag !== 64) {
|
|
1377
|
+
break;
|
|
1378
|
+
}
|
|
1379
|
+
message.lastPage = reader.uint32();
|
|
1380
|
+
continue;
|
|
1381
|
+
}
|
|
1382
|
+
case 9: {
|
|
1383
|
+
if (tag !== 72) {
|
|
1384
|
+
break;
|
|
1385
|
+
}
|
|
1386
|
+
message.perPage = reader.uint32();
|
|
1387
|
+
continue;
|
|
1388
|
+
}
|
|
1389
|
+
case 10: {
|
|
1390
|
+
if (tag !== 80) {
|
|
1391
|
+
break;
|
|
1392
|
+
}
|
|
1393
|
+
message.to = reader.uint32();
|
|
1394
|
+
continue;
|
|
1395
|
+
}
|
|
1396
|
+
case 11: {
|
|
1397
|
+
if (tag !== 90) {
|
|
1398
|
+
break;
|
|
1399
|
+
}
|
|
1400
|
+
message.data.push(exports.Order.decode(reader, reader.uint32()));
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1405
|
+
break;
|
|
1406
|
+
}
|
|
1407
|
+
reader.skip(tag & 7);
|
|
1408
|
+
}
|
|
1409
|
+
return message;
|
|
1410
|
+
},
|
|
1411
|
+
fromJSON(object) {
|
|
1412
|
+
return {
|
|
1413
|
+
currentPage: isSet(object.current_page) ? globalThis.Number(object.current_page) : 0,
|
|
1414
|
+
firstPageUrl: isSet(object.first_page_url) ? globalThis.String(object.first_page_url) : "",
|
|
1415
|
+
lastPageUrl: isSet(object.last_page_url) ? globalThis.String(object.last_page_url) : "",
|
|
1416
|
+
nextPageUrl: isSet(object.next_page_url) ? globalThis.String(object.next_page_url) : "",
|
|
1417
|
+
prevPageUrl: isSet(object.prev_page_url) ? globalThis.String(object.prev_page_url) : "",
|
|
1418
|
+
path: isSet(object.path) ? globalThis.String(object.path) : "",
|
|
1419
|
+
from: isSet(object.from) ? globalThis.Number(object.from) : 0,
|
|
1420
|
+
lastPage: isSet(object.last_page) ? globalThis.Number(object.last_page) : 0,
|
|
1421
|
+
perPage: isSet(object.per_page) ? globalThis.Number(object.per_page) : 0,
|
|
1422
|
+
to: isSet(object.to) ? globalThis.Number(object.to) : 0,
|
|
1423
|
+
data: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.data) ? object.data.map((e) => exports.Order.fromJSON(e)) : [],
|
|
1424
|
+
};
|
|
1425
|
+
},
|
|
1426
|
+
toJSON(message) {
|
|
1427
|
+
var _a;
|
|
1428
|
+
const obj = {};
|
|
1429
|
+
if (message.currentPage !== 0) {
|
|
1430
|
+
obj.current_page = Math.round(message.currentPage);
|
|
1431
|
+
}
|
|
1432
|
+
if (message.firstPageUrl !== "") {
|
|
1433
|
+
obj.first_page_url = message.firstPageUrl;
|
|
1434
|
+
}
|
|
1435
|
+
if (message.lastPageUrl !== "") {
|
|
1436
|
+
obj.last_page_url = message.lastPageUrl;
|
|
1437
|
+
}
|
|
1438
|
+
if (message.nextPageUrl !== "") {
|
|
1439
|
+
obj.next_page_url = message.nextPageUrl;
|
|
1440
|
+
}
|
|
1441
|
+
if (message.prevPageUrl !== "") {
|
|
1442
|
+
obj.prev_page_url = message.prevPageUrl;
|
|
1443
|
+
}
|
|
1444
|
+
if (message.path !== "") {
|
|
1445
|
+
obj.path = message.path;
|
|
1446
|
+
}
|
|
1447
|
+
if (message.from !== 0) {
|
|
1448
|
+
obj.from = Math.round(message.from);
|
|
1449
|
+
}
|
|
1450
|
+
if (message.lastPage !== 0) {
|
|
1451
|
+
obj.last_page = Math.round(message.lastPage);
|
|
1452
|
+
}
|
|
1453
|
+
if (message.perPage !== 0) {
|
|
1454
|
+
obj.per_page = Math.round(message.perPage);
|
|
1455
|
+
}
|
|
1456
|
+
if (message.to !== 0) {
|
|
1457
|
+
obj.to = Math.round(message.to);
|
|
1458
|
+
}
|
|
1459
|
+
if ((_a = message.data) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1460
|
+
obj.data = message.data.map((e) => exports.Order.toJSON(e));
|
|
1461
|
+
}
|
|
1462
|
+
return obj;
|
|
1463
|
+
},
|
|
1464
|
+
create(base) {
|
|
1465
|
+
return exports.OrderPagination.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1466
|
+
},
|
|
1467
|
+
fromPartial(object) {
|
|
1468
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1469
|
+
const message = createBaseOrderPagination();
|
|
1470
|
+
message.currentPage = (_a = object.currentPage) !== null && _a !== void 0 ? _a : 0;
|
|
1471
|
+
message.firstPageUrl = (_b = object.firstPageUrl) !== null && _b !== void 0 ? _b : "";
|
|
1472
|
+
message.lastPageUrl = (_c = object.lastPageUrl) !== null && _c !== void 0 ? _c : "";
|
|
1473
|
+
message.nextPageUrl = (_d = object.nextPageUrl) !== null && _d !== void 0 ? _d : "";
|
|
1474
|
+
message.prevPageUrl = (_e = object.prevPageUrl) !== null && _e !== void 0 ? _e : "";
|
|
1475
|
+
message.path = (_f = object.path) !== null && _f !== void 0 ? _f : "";
|
|
1476
|
+
message.from = (_g = object.from) !== null && _g !== void 0 ? _g : 0;
|
|
1477
|
+
message.lastPage = (_h = object.lastPage) !== null && _h !== void 0 ? _h : 0;
|
|
1478
|
+
message.perPage = (_j = object.perPage) !== null && _j !== void 0 ? _j : 0;
|
|
1479
|
+
message.to = (_k = object.to) !== null && _k !== void 0 ? _k : 0;
|
|
1480
|
+
message.data = ((_l = object.data) === null || _l === void 0 ? void 0 : _l.map((e) => exports.Order.fromPartial(e))) || [];
|
|
1481
|
+
return message;
|
|
1482
|
+
},
|
|
1483
|
+
};
|
|
1484
|
+
function createBaseOrder() {
|
|
1485
|
+
return {
|
|
1486
|
+
id: long_1.default.UZERO,
|
|
1487
|
+
uuid: "",
|
|
1488
|
+
organizationId: long_1.default.UZERO,
|
|
1489
|
+
createdBy: undefined,
|
|
1490
|
+
paymentGatewayId: undefined,
|
|
1491
|
+
currencyId: undefined,
|
|
1492
|
+
partnerId: undefined,
|
|
1493
|
+
totalPrice: 0,
|
|
1494
|
+
tax: 0,
|
|
1495
|
+
taxPercent: 0,
|
|
1496
|
+
discount: 0,
|
|
1497
|
+
subtotal: 0,
|
|
1498
|
+
paymentUrl: undefined,
|
|
1499
|
+
transactionId: undefined,
|
|
1500
|
+
refId: undefined,
|
|
1501
|
+
paidAt: undefined,
|
|
1502
|
+
months: undefined,
|
|
1503
|
+
status: "",
|
|
1504
|
+
createdAt: undefined,
|
|
1505
|
+
updatedAt: undefined,
|
|
1506
|
+
products: [],
|
|
1507
|
+
partner: undefined,
|
|
1508
|
+
paymentGateway: undefined,
|
|
1509
|
+
currency: undefined,
|
|
1510
|
+
person: undefined,
|
|
1511
|
+
};
|
|
1512
|
+
}
|
|
1513
|
+
exports.Order = {
|
|
1514
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1515
|
+
if (!message.id.equals(long_1.default.UZERO)) {
|
|
1516
|
+
writer.uint32(8).uint64(message.id.toString());
|
|
1517
|
+
}
|
|
1518
|
+
if (message.uuid !== "") {
|
|
1519
|
+
writer.uint32(18).string(message.uuid);
|
|
1520
|
+
}
|
|
1521
|
+
if (!message.organizationId.equals(long_1.default.UZERO)) {
|
|
1522
|
+
writer.uint32(24).uint64(message.organizationId.toString());
|
|
1523
|
+
}
|
|
1524
|
+
if (message.createdBy !== undefined) {
|
|
1525
|
+
writer.uint32(32).uint64(message.createdBy.toString());
|
|
1526
|
+
}
|
|
1527
|
+
if (message.paymentGatewayId !== undefined) {
|
|
1528
|
+
writer.uint32(40).uint64(message.paymentGatewayId.toString());
|
|
1529
|
+
}
|
|
1530
|
+
if (message.currencyId !== undefined) {
|
|
1531
|
+
writer.uint32(48).uint64(message.currencyId.toString());
|
|
1532
|
+
}
|
|
1533
|
+
if (message.partnerId !== undefined) {
|
|
1534
|
+
writer.uint32(56).uint64(message.partnerId.toString());
|
|
1535
|
+
}
|
|
1536
|
+
if (message.totalPrice !== 0) {
|
|
1537
|
+
writer.uint32(65).double(message.totalPrice);
|
|
1538
|
+
}
|
|
1539
|
+
if (message.tax !== 0) {
|
|
1540
|
+
writer.uint32(73).double(message.tax);
|
|
1541
|
+
}
|
|
1542
|
+
if (message.taxPercent !== 0) {
|
|
1543
|
+
writer.uint32(80).uint32(message.taxPercent);
|
|
1544
|
+
}
|
|
1545
|
+
if (message.discount !== 0) {
|
|
1546
|
+
writer.uint32(89).double(message.discount);
|
|
1547
|
+
}
|
|
1548
|
+
if (message.subtotal !== 0) {
|
|
1549
|
+
writer.uint32(97).double(message.subtotal);
|
|
1550
|
+
}
|
|
1551
|
+
if (message.paymentUrl !== undefined) {
|
|
1552
|
+
writer.uint32(106).string(message.paymentUrl);
|
|
1553
|
+
}
|
|
1554
|
+
if (message.transactionId !== undefined) {
|
|
1555
|
+
writer.uint32(114).string(message.transactionId);
|
|
1556
|
+
}
|
|
1557
|
+
if (message.refId !== undefined) {
|
|
1558
|
+
writer.uint32(122).string(message.refId);
|
|
1559
|
+
}
|
|
1560
|
+
if (message.paidAt !== undefined) {
|
|
1561
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.paidAt), writer.uint32(130).fork()).join();
|
|
1562
|
+
}
|
|
1563
|
+
if (message.months !== undefined) {
|
|
1564
|
+
writer.uint32(136).uint32(message.months);
|
|
1565
|
+
}
|
|
1566
|
+
if (message.status !== "") {
|
|
1567
|
+
writer.uint32(146).string(message.status);
|
|
1568
|
+
}
|
|
1569
|
+
if (message.createdAt !== undefined) {
|
|
1570
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(154).fork()).join();
|
|
1571
|
+
}
|
|
1572
|
+
if (message.updatedAt !== undefined) {
|
|
1573
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(162).fork()).join();
|
|
1574
|
+
}
|
|
1575
|
+
for (const v of message.products) {
|
|
1576
|
+
exports.OrderProduct.encode(v, writer.uint32(170).fork()).join();
|
|
1577
|
+
}
|
|
1578
|
+
if (message.partner !== undefined) {
|
|
1579
|
+
exports.Partner.encode(message.partner, writer.uint32(178).fork()).join();
|
|
1580
|
+
}
|
|
1581
|
+
if (message.paymentGateway !== undefined) {
|
|
1582
|
+
exports.PaymentGateway.encode(message.paymentGateway, writer.uint32(186).fork()).join();
|
|
1583
|
+
}
|
|
1584
|
+
if (message.currency !== undefined) {
|
|
1585
|
+
exports.Currency.encode(message.currency, writer.uint32(194).fork()).join();
|
|
1586
|
+
}
|
|
1587
|
+
if (message.person !== undefined) {
|
|
1588
|
+
identities_1.Person.encode(message.person, writer.uint32(202).fork()).join();
|
|
1589
|
+
}
|
|
1590
|
+
return writer;
|
|
1591
|
+
},
|
|
1592
|
+
decode(input, length) {
|
|
1593
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1594
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1595
|
+
const message = createBaseOrder();
|
|
1596
|
+
while (reader.pos < end) {
|
|
1597
|
+
const tag = reader.uint32();
|
|
1598
|
+
switch (tag >>> 3) {
|
|
1599
|
+
case 1: {
|
|
1600
|
+
if (tag !== 8) {
|
|
1601
|
+
break;
|
|
1602
|
+
}
|
|
1603
|
+
message.id = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1604
|
+
continue;
|
|
1605
|
+
}
|
|
1606
|
+
case 2: {
|
|
1607
|
+
if (tag !== 18) {
|
|
1608
|
+
break;
|
|
1609
|
+
}
|
|
1610
|
+
message.uuid = reader.string();
|
|
1611
|
+
continue;
|
|
1612
|
+
}
|
|
1613
|
+
case 3: {
|
|
1614
|
+
if (tag !== 24) {
|
|
1615
|
+
break;
|
|
1616
|
+
}
|
|
1617
|
+
message.organizationId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1618
|
+
continue;
|
|
1619
|
+
}
|
|
1620
|
+
case 4: {
|
|
1621
|
+
if (tag !== 32) {
|
|
1622
|
+
break;
|
|
1623
|
+
}
|
|
1624
|
+
message.createdBy = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1625
|
+
continue;
|
|
1626
|
+
}
|
|
1627
|
+
case 5: {
|
|
1628
|
+
if (tag !== 40) {
|
|
1629
|
+
break;
|
|
1630
|
+
}
|
|
1631
|
+
message.paymentGatewayId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1632
|
+
continue;
|
|
1633
|
+
}
|
|
1634
|
+
case 6: {
|
|
1635
|
+
if (tag !== 48) {
|
|
1636
|
+
break;
|
|
1637
|
+
}
|
|
1638
|
+
message.currencyId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1639
|
+
continue;
|
|
1640
|
+
}
|
|
1641
|
+
case 7: {
|
|
1642
|
+
if (tag !== 56) {
|
|
1643
|
+
break;
|
|
1644
|
+
}
|
|
1645
|
+
message.partnerId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
1646
|
+
continue;
|
|
1647
|
+
}
|
|
1648
|
+
case 8: {
|
|
1649
|
+
if (tag !== 65) {
|
|
1650
|
+
break;
|
|
1651
|
+
}
|
|
1652
|
+
message.totalPrice = reader.double();
|
|
1653
|
+
continue;
|
|
1654
|
+
}
|
|
1655
|
+
case 9: {
|
|
1656
|
+
if (tag !== 73) {
|
|
1657
|
+
break;
|
|
1658
|
+
}
|
|
1659
|
+
message.tax = reader.double();
|
|
1660
|
+
continue;
|
|
1661
|
+
}
|
|
1662
|
+
case 10: {
|
|
1663
|
+
if (tag !== 80) {
|
|
1664
|
+
break;
|
|
1665
|
+
}
|
|
1666
|
+
message.taxPercent = reader.uint32();
|
|
1667
|
+
continue;
|
|
1668
|
+
}
|
|
1669
|
+
case 11: {
|
|
1670
|
+
if (tag !== 89) {
|
|
1671
|
+
break;
|
|
1672
|
+
}
|
|
1673
|
+
message.discount = reader.double();
|
|
1674
|
+
continue;
|
|
1675
|
+
}
|
|
1676
|
+
case 12: {
|
|
1677
|
+
if (tag !== 97) {
|
|
1678
|
+
break;
|
|
1679
|
+
}
|
|
1680
|
+
message.subtotal = reader.double();
|
|
1681
|
+
continue;
|
|
1682
|
+
}
|
|
1683
|
+
case 13: {
|
|
1684
|
+
if (tag !== 106) {
|
|
1685
|
+
break;
|
|
1686
|
+
}
|
|
1687
|
+
message.paymentUrl = reader.string();
|
|
1688
|
+
continue;
|
|
1689
|
+
}
|
|
1690
|
+
case 14: {
|
|
1691
|
+
if (tag !== 114) {
|
|
1692
|
+
break;
|
|
1693
|
+
}
|
|
1694
|
+
message.transactionId = reader.string();
|
|
1695
|
+
continue;
|
|
1696
|
+
}
|
|
1697
|
+
case 15: {
|
|
1698
|
+
if (tag !== 122) {
|
|
1699
|
+
break;
|
|
1700
|
+
}
|
|
1701
|
+
message.refId = reader.string();
|
|
1702
|
+
continue;
|
|
1703
|
+
}
|
|
1704
|
+
case 16: {
|
|
1705
|
+
if (tag !== 130) {
|
|
1706
|
+
break;
|
|
1707
|
+
}
|
|
1708
|
+
message.paidAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1709
|
+
continue;
|
|
1710
|
+
}
|
|
1711
|
+
case 17: {
|
|
1712
|
+
if (tag !== 136) {
|
|
1713
|
+
break;
|
|
1714
|
+
}
|
|
1715
|
+
message.months = reader.uint32();
|
|
1716
|
+
continue;
|
|
1717
|
+
}
|
|
1718
|
+
case 18: {
|
|
1719
|
+
if (tag !== 146) {
|
|
1720
|
+
break;
|
|
1721
|
+
}
|
|
1722
|
+
message.status = reader.string();
|
|
1723
|
+
continue;
|
|
1724
|
+
}
|
|
1725
|
+
case 19: {
|
|
1726
|
+
if (tag !== 154) {
|
|
1727
|
+
break;
|
|
1728
|
+
}
|
|
1729
|
+
message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1730
|
+
continue;
|
|
1731
|
+
}
|
|
1732
|
+
case 20: {
|
|
1733
|
+
if (tag !== 162) {
|
|
1734
|
+
break;
|
|
1735
|
+
}
|
|
1736
|
+
message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
1737
|
+
continue;
|
|
1738
|
+
}
|
|
1739
|
+
case 21: {
|
|
1740
|
+
if (tag !== 170) {
|
|
1741
|
+
break;
|
|
1742
|
+
}
|
|
1743
|
+
message.products.push(exports.OrderProduct.decode(reader, reader.uint32()));
|
|
1744
|
+
continue;
|
|
1745
|
+
}
|
|
1746
|
+
case 22: {
|
|
1747
|
+
if (tag !== 178) {
|
|
1748
|
+
break;
|
|
1749
|
+
}
|
|
1750
|
+
message.partner = exports.Partner.decode(reader, reader.uint32());
|
|
1751
|
+
continue;
|
|
1752
|
+
}
|
|
1753
|
+
case 23: {
|
|
1754
|
+
if (tag !== 186) {
|
|
1755
|
+
break;
|
|
1756
|
+
}
|
|
1757
|
+
message.paymentGateway = exports.PaymentGateway.decode(reader, reader.uint32());
|
|
1758
|
+
continue;
|
|
1759
|
+
}
|
|
1760
|
+
case 24: {
|
|
1761
|
+
if (tag !== 194) {
|
|
1762
|
+
break;
|
|
1763
|
+
}
|
|
1764
|
+
message.currency = exports.Currency.decode(reader, reader.uint32());
|
|
1765
|
+
continue;
|
|
1766
|
+
}
|
|
1767
|
+
case 25: {
|
|
1768
|
+
if (tag !== 202) {
|
|
1769
|
+
break;
|
|
1770
|
+
}
|
|
1771
|
+
message.person = identities_1.Person.decode(reader, reader.uint32());
|
|
1772
|
+
continue;
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1776
|
+
break;
|
|
1777
|
+
}
|
|
1778
|
+
reader.skip(tag & 7);
|
|
1779
|
+
}
|
|
1780
|
+
return message;
|
|
1781
|
+
},
|
|
1782
|
+
fromJSON(object) {
|
|
1783
|
+
return {
|
|
1784
|
+
id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
|
|
1785
|
+
uuid: isSet(object.uuid) ? globalThis.String(object.uuid) : "",
|
|
1786
|
+
organizationId: isSet(object.organization_id) ? long_1.default.fromValue(object.organization_id) : long_1.default.UZERO,
|
|
1787
|
+
createdBy: isSet(object.created_by) ? long_1.default.fromValue(object.created_by) : undefined,
|
|
1788
|
+
paymentGatewayId: isSet(object.payment_gateway_id) ? long_1.default.fromValue(object.payment_gateway_id) : undefined,
|
|
1789
|
+
currencyId: isSet(object.currency_id) ? long_1.default.fromValue(object.currency_id) : undefined,
|
|
1790
|
+
partnerId: isSet(object.partner_id) ? long_1.default.fromValue(object.partner_id) : undefined,
|
|
1791
|
+
totalPrice: isSet(object.total_price) ? globalThis.Number(object.total_price) : 0,
|
|
1792
|
+
tax: isSet(object.tax) ? globalThis.Number(object.tax) : 0,
|
|
1793
|
+
taxPercent: isSet(object.tax_percent) ? globalThis.Number(object.tax_percent) : 0,
|
|
1794
|
+
discount: isSet(object.discount) ? globalThis.Number(object.discount) : 0,
|
|
1795
|
+
subtotal: isSet(object.subtotal) ? globalThis.Number(object.subtotal) : 0,
|
|
1796
|
+
paymentUrl: isSet(object.payment_url) ? globalThis.String(object.payment_url) : undefined,
|
|
1797
|
+
transactionId: isSet(object.transaction_id) ? globalThis.String(object.transaction_id) : undefined,
|
|
1798
|
+
refId: isSet(object.ref_id) ? globalThis.String(object.ref_id) : undefined,
|
|
1799
|
+
paidAt: isSet(object.paid_at) ? fromJsonTimestamp(object.paid_at) : undefined,
|
|
1800
|
+
months: isSet(object.months) ? globalThis.Number(object.months) : undefined,
|
|
1801
|
+
status: isSet(object.status) ? globalThis.String(object.status) : "",
|
|
1802
|
+
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
1803
|
+
updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
|
|
1804
|
+
products: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.products)
|
|
1805
|
+
? object.products.map((e) => exports.OrderProduct.fromJSON(e))
|
|
1806
|
+
: [],
|
|
1807
|
+
partner: isSet(object.partner) ? exports.Partner.fromJSON(object.partner) : undefined,
|
|
1808
|
+
paymentGateway: isSet(object.payment_gateway) ? exports.PaymentGateway.fromJSON(object.payment_gateway) : undefined,
|
|
1809
|
+
currency: isSet(object.currency) ? exports.Currency.fromJSON(object.currency) : undefined,
|
|
1810
|
+
person: isSet(object.person) ? identities_1.Person.fromJSON(object.person) : undefined,
|
|
1811
|
+
};
|
|
1812
|
+
},
|
|
1813
|
+
toJSON(message) {
|
|
1814
|
+
var _a;
|
|
1815
|
+
const obj = {};
|
|
1816
|
+
if (!message.id.equals(long_1.default.UZERO)) {
|
|
1817
|
+
obj.id = (message.id || long_1.default.UZERO).toString();
|
|
1818
|
+
}
|
|
1819
|
+
if (message.uuid !== "") {
|
|
1820
|
+
obj.uuid = message.uuid;
|
|
1821
|
+
}
|
|
1822
|
+
if (!message.organizationId.equals(long_1.default.UZERO)) {
|
|
1823
|
+
obj.organization_id = (message.organizationId || long_1.default.UZERO).toString();
|
|
1824
|
+
}
|
|
1825
|
+
if (message.createdBy !== undefined) {
|
|
1826
|
+
obj.created_by = (message.createdBy || long_1.default.UZERO).toString();
|
|
1827
|
+
}
|
|
1828
|
+
if (message.paymentGatewayId !== undefined) {
|
|
1829
|
+
obj.payment_gateway_id = (message.paymentGatewayId || long_1.default.UZERO).toString();
|
|
1830
|
+
}
|
|
1831
|
+
if (message.currencyId !== undefined) {
|
|
1832
|
+
obj.currency_id = (message.currencyId || long_1.default.UZERO).toString();
|
|
1833
|
+
}
|
|
1834
|
+
if (message.partnerId !== undefined) {
|
|
1835
|
+
obj.partner_id = (message.partnerId || long_1.default.UZERO).toString();
|
|
1836
|
+
}
|
|
1837
|
+
if (message.totalPrice !== 0) {
|
|
1838
|
+
obj.total_price = message.totalPrice;
|
|
1839
|
+
}
|
|
1840
|
+
if (message.tax !== 0) {
|
|
1841
|
+
obj.tax = message.tax;
|
|
1842
|
+
}
|
|
1843
|
+
if (message.taxPercent !== 0) {
|
|
1844
|
+
obj.tax_percent = Math.round(message.taxPercent);
|
|
1845
|
+
}
|
|
1846
|
+
if (message.discount !== 0) {
|
|
1847
|
+
obj.discount = message.discount;
|
|
1848
|
+
}
|
|
1849
|
+
if (message.subtotal !== 0) {
|
|
1850
|
+
obj.subtotal = message.subtotal;
|
|
1851
|
+
}
|
|
1852
|
+
if (message.paymentUrl !== undefined) {
|
|
1853
|
+
obj.payment_url = message.paymentUrl;
|
|
1854
|
+
}
|
|
1855
|
+
if (message.transactionId !== undefined) {
|
|
1856
|
+
obj.transaction_id = message.transactionId;
|
|
1857
|
+
}
|
|
1858
|
+
if (message.refId !== undefined) {
|
|
1859
|
+
obj.ref_id = message.refId;
|
|
1860
|
+
}
|
|
1861
|
+
if (message.paidAt !== undefined) {
|
|
1862
|
+
obj.paid_at = message.paidAt.toISOString();
|
|
1863
|
+
}
|
|
1864
|
+
if (message.months !== undefined) {
|
|
1865
|
+
obj.months = Math.round(message.months);
|
|
1866
|
+
}
|
|
1867
|
+
if (message.status !== "") {
|
|
1868
|
+
obj.status = message.status;
|
|
1869
|
+
}
|
|
1870
|
+
if (message.createdAt !== undefined) {
|
|
1871
|
+
obj.created_at = message.createdAt.toISOString();
|
|
1872
|
+
}
|
|
1873
|
+
if (message.updatedAt !== undefined) {
|
|
1874
|
+
obj.updated_at = message.updatedAt.toISOString();
|
|
1875
|
+
}
|
|
1876
|
+
if ((_a = message.products) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1877
|
+
obj.products = message.products.map((e) => exports.OrderProduct.toJSON(e));
|
|
1878
|
+
}
|
|
1879
|
+
if (message.partner !== undefined) {
|
|
1880
|
+
obj.partner = exports.Partner.toJSON(message.partner);
|
|
1881
|
+
}
|
|
1882
|
+
if (message.paymentGateway !== undefined) {
|
|
1883
|
+
obj.payment_gateway = exports.PaymentGateway.toJSON(message.paymentGateway);
|
|
1884
|
+
}
|
|
1885
|
+
if (message.currency !== undefined) {
|
|
1886
|
+
obj.currency = exports.Currency.toJSON(message.currency);
|
|
1887
|
+
}
|
|
1888
|
+
if (message.person !== undefined) {
|
|
1889
|
+
obj.person = identities_1.Person.toJSON(message.person);
|
|
1890
|
+
}
|
|
1891
|
+
return obj;
|
|
1892
|
+
},
|
|
1893
|
+
create(base) {
|
|
1894
|
+
return exports.Order.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1895
|
+
},
|
|
1896
|
+
fromPartial(object) {
|
|
1897
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1898
|
+
const message = createBaseOrder();
|
|
1899
|
+
message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
|
|
1900
|
+
message.uuid = (_a = object.uuid) !== null && _a !== void 0 ? _a : "";
|
|
1901
|
+
message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
|
|
1902
|
+
? long_1.default.fromValue(object.organizationId)
|
|
1903
|
+
: long_1.default.UZERO;
|
|
1904
|
+
message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
|
|
1905
|
+
? long_1.default.fromValue(object.createdBy)
|
|
1906
|
+
: undefined;
|
|
1907
|
+
message.paymentGatewayId = (object.paymentGatewayId !== undefined && object.paymentGatewayId !== null)
|
|
1908
|
+
? long_1.default.fromValue(object.paymentGatewayId)
|
|
1909
|
+
: undefined;
|
|
1910
|
+
message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
|
|
1911
|
+
? long_1.default.fromValue(object.currencyId)
|
|
1912
|
+
: undefined;
|
|
1913
|
+
message.partnerId = (object.partnerId !== undefined && object.partnerId !== null)
|
|
1914
|
+
? long_1.default.fromValue(object.partnerId)
|
|
1915
|
+
: undefined;
|
|
1916
|
+
message.totalPrice = (_b = object.totalPrice) !== null && _b !== void 0 ? _b : 0;
|
|
1917
|
+
message.tax = (_c = object.tax) !== null && _c !== void 0 ? _c : 0;
|
|
1918
|
+
message.taxPercent = (_d = object.taxPercent) !== null && _d !== void 0 ? _d : 0;
|
|
1919
|
+
message.discount = (_e = object.discount) !== null && _e !== void 0 ? _e : 0;
|
|
1920
|
+
message.subtotal = (_f = object.subtotal) !== null && _f !== void 0 ? _f : 0;
|
|
1921
|
+
message.paymentUrl = (_g = object.paymentUrl) !== null && _g !== void 0 ? _g : undefined;
|
|
1922
|
+
message.transactionId = (_h = object.transactionId) !== null && _h !== void 0 ? _h : undefined;
|
|
1923
|
+
message.refId = (_j = object.refId) !== null && _j !== void 0 ? _j : undefined;
|
|
1924
|
+
message.paidAt = (_k = object.paidAt) !== null && _k !== void 0 ? _k : undefined;
|
|
1925
|
+
message.months = (_l = object.months) !== null && _l !== void 0 ? _l : undefined;
|
|
1926
|
+
message.status = (_m = object.status) !== null && _m !== void 0 ? _m : "";
|
|
1927
|
+
message.createdAt = (_o = object.createdAt) !== null && _o !== void 0 ? _o : undefined;
|
|
1928
|
+
message.updatedAt = (_p = object.updatedAt) !== null && _p !== void 0 ? _p : undefined;
|
|
1929
|
+
message.products = ((_q = object.products) === null || _q === void 0 ? void 0 : _q.map((e) => exports.OrderProduct.fromPartial(e))) || [];
|
|
1930
|
+
message.partner = (object.partner !== undefined && object.partner !== null)
|
|
1931
|
+
? exports.Partner.fromPartial(object.partner)
|
|
1932
|
+
: undefined;
|
|
1933
|
+
message.paymentGateway = (object.paymentGateway !== undefined && object.paymentGateway !== null)
|
|
1934
|
+
? exports.PaymentGateway.fromPartial(object.paymentGateway)
|
|
1935
|
+
: undefined;
|
|
1936
|
+
message.currency = (object.currency !== undefined && object.currency !== null)
|
|
1937
|
+
? exports.Currency.fromPartial(object.currency)
|
|
1938
|
+
: undefined;
|
|
1939
|
+
message.person = (object.person !== undefined && object.person !== null)
|
|
1940
|
+
? identities_1.Person.fromPartial(object.person)
|
|
1941
|
+
: undefined;
|
|
1942
|
+
return message;
|
|
1943
|
+
},
|
|
1944
|
+
};
|
|
1945
|
+
function createBaseOrderProduct() {
|
|
1946
|
+
return {
|
|
1947
|
+
id: long_1.default.UZERO,
|
|
1948
|
+
orderId: undefined,
|
|
1949
|
+
productId: undefined,
|
|
1950
|
+
productType: "",
|
|
1951
|
+
productName: "",
|
|
1952
|
+
productDetail: "",
|
|
1953
|
+
currencyId: undefined,
|
|
1954
|
+
discountPercent: undefined,
|
|
1955
|
+
taxPrice: 0,
|
|
1956
|
+
discount: 0,
|
|
1957
|
+
price: 0,
|
|
1958
|
+
months: undefined,
|
|
1959
|
+
createdAt: undefined,
|
|
1960
|
+
updatedAt: undefined,
|
|
1961
|
+
product: undefined,
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
exports.OrderProduct = {
|
|
1965
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1966
|
+
if (!message.id.equals(long_1.default.UZERO)) {
|
|
1967
|
+
writer.uint32(8).uint64(message.id.toString());
|
|
1968
|
+
}
|
|
1969
|
+
if (message.orderId !== undefined) {
|
|
1970
|
+
writer.uint32(16).uint64(message.orderId.toString());
|
|
1971
|
+
}
|
|
1972
|
+
if (message.productId !== undefined) {
|
|
1973
|
+
writer.uint32(24).uint64(message.productId.toString());
|
|
1974
|
+
}
|
|
1975
|
+
if (message.productType !== "") {
|
|
1976
|
+
writer.uint32(34).string(message.productType);
|
|
1977
|
+
}
|
|
1978
|
+
if (message.productName !== "") {
|
|
1979
|
+
writer.uint32(42).string(message.productName);
|
|
1980
|
+
}
|
|
1981
|
+
if (message.productDetail !== "") {
|
|
1982
|
+
writer.uint32(50).string(message.productDetail);
|
|
1983
|
+
}
|
|
1984
|
+
if (message.currencyId !== undefined) {
|
|
1985
|
+
writer.uint32(56).uint64(message.currencyId.toString());
|
|
1986
|
+
}
|
|
1987
|
+
if (message.discountPercent !== undefined) {
|
|
1988
|
+
writer.uint32(64).uint32(message.discountPercent);
|
|
1989
|
+
}
|
|
1990
|
+
if (message.taxPrice !== 0) {
|
|
1991
|
+
writer.uint32(73).double(message.taxPrice);
|
|
1992
|
+
}
|
|
1993
|
+
if (message.discount !== 0) {
|
|
1994
|
+
writer.uint32(81).double(message.discount);
|
|
1995
|
+
}
|
|
1996
|
+
if (message.price !== 0) {
|
|
1997
|
+
writer.uint32(89).double(message.price);
|
|
1998
|
+
}
|
|
1999
|
+
if (message.months !== undefined) {
|
|
2000
|
+
writer.uint32(96).uint32(message.months);
|
|
2001
|
+
}
|
|
2002
|
+
if (message.createdAt !== undefined) {
|
|
2003
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(106).fork()).join();
|
|
2004
|
+
}
|
|
2005
|
+
if (message.updatedAt !== undefined) {
|
|
2006
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(114).fork()).join();
|
|
2007
|
+
}
|
|
2008
|
+
if (message.product !== undefined) {
|
|
2009
|
+
exports.Product.encode(message.product, writer.uint32(122).fork()).join();
|
|
2010
|
+
}
|
|
2011
|
+
return writer;
|
|
2012
|
+
},
|
|
2013
|
+
decode(input, length) {
|
|
2014
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
2015
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2016
|
+
const message = createBaseOrderProduct();
|
|
2017
|
+
while (reader.pos < end) {
|
|
2018
|
+
const tag = reader.uint32();
|
|
2019
|
+
switch (tag >>> 3) {
|
|
2020
|
+
case 1: {
|
|
2021
|
+
if (tag !== 8) {
|
|
2022
|
+
break;
|
|
2023
|
+
}
|
|
2024
|
+
message.id = long_1.default.fromString(reader.uint64().toString(), true);
|
|
2025
|
+
continue;
|
|
2026
|
+
}
|
|
2027
|
+
case 2: {
|
|
2028
|
+
if (tag !== 16) {
|
|
2029
|
+
break;
|
|
2030
|
+
}
|
|
2031
|
+
message.orderId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
2032
|
+
continue;
|
|
2033
|
+
}
|
|
2034
|
+
case 3: {
|
|
2035
|
+
if (tag !== 24) {
|
|
2036
|
+
break;
|
|
2037
|
+
}
|
|
2038
|
+
message.productId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
2039
|
+
continue;
|
|
2040
|
+
}
|
|
2041
|
+
case 4: {
|
|
2042
|
+
if (tag !== 34) {
|
|
2043
|
+
break;
|
|
2044
|
+
}
|
|
2045
|
+
message.productType = reader.string();
|
|
2046
|
+
continue;
|
|
2047
|
+
}
|
|
2048
|
+
case 5: {
|
|
2049
|
+
if (tag !== 42) {
|
|
2050
|
+
break;
|
|
2051
|
+
}
|
|
2052
|
+
message.productName = reader.string();
|
|
2053
|
+
continue;
|
|
2054
|
+
}
|
|
2055
|
+
case 6: {
|
|
2056
|
+
if (tag !== 50) {
|
|
2057
|
+
break;
|
|
2058
|
+
}
|
|
2059
|
+
message.productDetail = reader.string();
|
|
2060
|
+
continue;
|
|
2061
|
+
}
|
|
2062
|
+
case 7: {
|
|
2063
|
+
if (tag !== 56) {
|
|
2064
|
+
break;
|
|
2065
|
+
}
|
|
2066
|
+
message.currencyId = long_1.default.fromString(reader.uint64().toString(), true);
|
|
2067
|
+
continue;
|
|
2068
|
+
}
|
|
2069
|
+
case 8: {
|
|
2070
|
+
if (tag !== 64) {
|
|
2071
|
+
break;
|
|
2072
|
+
}
|
|
2073
|
+
message.discountPercent = reader.uint32();
|
|
2074
|
+
continue;
|
|
2075
|
+
}
|
|
2076
|
+
case 9: {
|
|
2077
|
+
if (tag !== 73) {
|
|
2078
|
+
break;
|
|
2079
|
+
}
|
|
2080
|
+
message.taxPrice = reader.double();
|
|
2081
|
+
continue;
|
|
2082
|
+
}
|
|
2083
|
+
case 10: {
|
|
2084
|
+
if (tag !== 81) {
|
|
2085
|
+
break;
|
|
2086
|
+
}
|
|
2087
|
+
message.discount = reader.double();
|
|
2088
|
+
continue;
|
|
2089
|
+
}
|
|
2090
|
+
case 11: {
|
|
2091
|
+
if (tag !== 89) {
|
|
2092
|
+
break;
|
|
2093
|
+
}
|
|
2094
|
+
message.price = reader.double();
|
|
2095
|
+
continue;
|
|
2096
|
+
}
|
|
2097
|
+
case 12: {
|
|
2098
|
+
if (tag !== 96) {
|
|
2099
|
+
break;
|
|
2100
|
+
}
|
|
2101
|
+
message.months = reader.uint32();
|
|
2102
|
+
continue;
|
|
2103
|
+
}
|
|
2104
|
+
case 13: {
|
|
2105
|
+
if (tag !== 106) {
|
|
2106
|
+
break;
|
|
2107
|
+
}
|
|
2108
|
+
message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
2109
|
+
continue;
|
|
2110
|
+
}
|
|
2111
|
+
case 14: {
|
|
2112
|
+
if (tag !== 114) {
|
|
2113
|
+
break;
|
|
2114
|
+
}
|
|
2115
|
+
message.updatedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
2116
|
+
continue;
|
|
2117
|
+
}
|
|
2118
|
+
case 15: {
|
|
2119
|
+
if (tag !== 122) {
|
|
2120
|
+
break;
|
|
2121
|
+
}
|
|
2122
|
+
message.product = exports.Product.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
|
+
orderId: isSet(object.order_id) ? long_1.default.fromValue(object.order_id) : undefined,
|
|
2137
|
+
productId: isSet(object.product_id) ? long_1.default.fromValue(object.product_id) : undefined,
|
|
2138
|
+
productType: isSet(object.product_type) ? globalThis.String(object.product_type) : "",
|
|
2139
|
+
productName: isSet(object.product_name) ? globalThis.String(object.product_name) : "",
|
|
2140
|
+
productDetail: isSet(object.product_detail) ? globalThis.String(object.product_detail) : "",
|
|
2141
|
+
currencyId: isSet(object.currency_id) ? long_1.default.fromValue(object.currency_id) : undefined,
|
|
2142
|
+
discountPercent: isSet(object.discount_percent) ? globalThis.Number(object.discount_percent) : undefined,
|
|
2143
|
+
taxPrice: isSet(object.tax_price) ? globalThis.Number(object.tax_price) : 0,
|
|
2144
|
+
discount: isSet(object.discount) ? globalThis.Number(object.discount) : 0,
|
|
2145
|
+
price: isSet(object.price) ? globalThis.Number(object.price) : 0,
|
|
2146
|
+
months: isSet(object.months) ? globalThis.Number(object.months) : undefined,
|
|
2147
|
+
createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
|
|
2148
|
+
updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
|
|
2149
|
+
product: isSet(object.product) ? exports.Product.fromJSON(object.product) : undefined,
|
|
2150
|
+
};
|
|
2151
|
+
},
|
|
2152
|
+
toJSON(message) {
|
|
2153
|
+
const obj = {};
|
|
2154
|
+
if (!message.id.equals(long_1.default.UZERO)) {
|
|
2155
|
+
obj.id = (message.id || long_1.default.UZERO).toString();
|
|
2156
|
+
}
|
|
2157
|
+
if (message.orderId !== undefined) {
|
|
2158
|
+
obj.order_id = (message.orderId || long_1.default.UZERO).toString();
|
|
2159
|
+
}
|
|
2160
|
+
if (message.productId !== undefined) {
|
|
2161
|
+
obj.product_id = (message.productId || long_1.default.UZERO).toString();
|
|
2162
|
+
}
|
|
2163
|
+
if (message.productType !== "") {
|
|
2164
|
+
obj.product_type = message.productType;
|
|
2165
|
+
}
|
|
2166
|
+
if (message.productName !== "") {
|
|
2167
|
+
obj.product_name = message.productName;
|
|
2168
|
+
}
|
|
2169
|
+
if (message.productDetail !== "") {
|
|
2170
|
+
obj.product_detail = message.productDetail;
|
|
2171
|
+
}
|
|
2172
|
+
if (message.currencyId !== undefined) {
|
|
2173
|
+
obj.currency_id = (message.currencyId || long_1.default.UZERO).toString();
|
|
2174
|
+
}
|
|
2175
|
+
if (message.discountPercent !== undefined) {
|
|
2176
|
+
obj.discount_percent = Math.round(message.discountPercent);
|
|
2177
|
+
}
|
|
2178
|
+
if (message.taxPrice !== 0) {
|
|
2179
|
+
obj.tax_price = message.taxPrice;
|
|
2180
|
+
}
|
|
2181
|
+
if (message.discount !== 0) {
|
|
2182
|
+
obj.discount = message.discount;
|
|
2183
|
+
}
|
|
2184
|
+
if (message.price !== 0) {
|
|
2185
|
+
obj.price = message.price;
|
|
2186
|
+
}
|
|
2187
|
+
if (message.months !== undefined) {
|
|
2188
|
+
obj.months = Math.round(message.months);
|
|
2189
|
+
}
|
|
2190
|
+
if (message.createdAt !== undefined) {
|
|
2191
|
+
obj.created_at = message.createdAt.toISOString();
|
|
2192
|
+
}
|
|
2193
|
+
if (message.updatedAt !== undefined) {
|
|
2194
|
+
obj.updated_at = message.updatedAt.toISOString();
|
|
2195
|
+
}
|
|
2196
|
+
if (message.product !== undefined) {
|
|
2197
|
+
obj.product = exports.Product.toJSON(message.product);
|
|
2198
|
+
}
|
|
2199
|
+
return obj;
|
|
2200
|
+
},
|
|
2201
|
+
create(base) {
|
|
2202
|
+
return exports.OrderProduct.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2203
|
+
},
|
|
2204
|
+
fromPartial(object) {
|
|
2205
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2206
|
+
const message = createBaseOrderProduct();
|
|
2207
|
+
message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
|
|
2208
|
+
message.orderId = (object.orderId !== undefined && object.orderId !== null)
|
|
2209
|
+
? long_1.default.fromValue(object.orderId)
|
|
2210
|
+
: undefined;
|
|
2211
|
+
message.productId = (object.productId !== undefined && object.productId !== null)
|
|
2212
|
+
? long_1.default.fromValue(object.productId)
|
|
2213
|
+
: undefined;
|
|
2214
|
+
message.productType = (_a = object.productType) !== null && _a !== void 0 ? _a : "";
|
|
2215
|
+
message.productName = (_b = object.productName) !== null && _b !== void 0 ? _b : "";
|
|
2216
|
+
message.productDetail = (_c = object.productDetail) !== null && _c !== void 0 ? _c : "";
|
|
2217
|
+
message.currencyId = (object.currencyId !== undefined && object.currencyId !== null)
|
|
2218
|
+
? long_1.default.fromValue(object.currencyId)
|
|
2219
|
+
: undefined;
|
|
2220
|
+
message.discountPercent = (_d = object.discountPercent) !== null && _d !== void 0 ? _d : undefined;
|
|
2221
|
+
message.taxPrice = (_e = object.taxPrice) !== null && _e !== void 0 ? _e : 0;
|
|
2222
|
+
message.discount = (_f = object.discount) !== null && _f !== void 0 ? _f : 0;
|
|
2223
|
+
message.price = (_g = object.price) !== null && _g !== void 0 ? _g : 0;
|
|
2224
|
+
message.months = (_h = object.months) !== null && _h !== void 0 ? _h : undefined;
|
|
2225
|
+
message.createdAt = (_j = object.createdAt) !== null && _j !== void 0 ? _j : undefined;
|
|
2226
|
+
message.updatedAt = (_k = object.updatedAt) !== null && _k !== void 0 ? _k : undefined;
|
|
2227
|
+
message.product = (object.product !== undefined && object.product !== null)
|
|
2228
|
+
? exports.Product.fromPartial(object.product)
|
|
2229
|
+
: undefined;
|
|
2230
|
+
return message;
|
|
2231
|
+
},
|
|
2232
|
+
};
|
|
1181
2233
|
function toTimestamp(date) {
|
|
1182
2234
|
const seconds = numberToLong(Math.trunc(date.getTime() / 1000));
|
|
1183
2235
|
const nanos = (date.getTime() % 1000) * 1000000;
|