@things-factory/operato-hub 4.3.264 → 4.3.265
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-server/graphql/resolvers/synchronization/index.js +5 -4
- package/dist-server/graphql/resolvers/synchronization/index.js.map +1 -1
- package/dist-server/graphql/resolvers/synchronization/powrup-pack-order.js +8 -3
- package/dist-server/graphql/resolvers/synchronization/powrup-pack-order.js.map +1 -1
- package/dist-server/graphql/types/synchronization/index.js +1 -0
- package/dist-server/graphql/types/synchronization/index.js.map +1 -1
- package/package.json +5 -5
- package/server/graphql/resolvers/synchronization/index.ts +6 -4
- package/server/graphql/resolvers/synchronization/powrup-pack-order.ts +8 -3
- package/server/graphql/types/synchronization/index.ts +1 -0
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Mutation = exports.Query = void 0;
|
|
4
|
+
const auto_update_all_marketplace_product_variation_quantity_1 = require("./auto-update-all-marketplace-product-variation-quantity");
|
|
5
|
+
const create_dat_shipments_1 = require("./create-dat-shipments");
|
|
4
6
|
const fetch_sync_invoices_1 = require("./fetch-sync-invoices");
|
|
5
7
|
const fetch_sync_products_1 = require("./fetch-sync-products");
|
|
6
8
|
const fetch_sync_purchase_orders_1 = require("./fetch-sync-purchase-orders");
|
|
9
|
+
const get_lmd_awb_1 = require("./get-lmd-awb");
|
|
10
|
+
const powrup_pack_order_1 = require("./powrup-pack-order");
|
|
7
11
|
const sellercraft_pack_marketplace_order_1 = require("./sellercraft-pack-marketplace-order");
|
|
8
12
|
const sync_all_products_to_sellercraft_1 = require("./sync-all-products-to-sellercraft");
|
|
9
13
|
const sync_products_from_account_1 = require("./sync-products-from-account");
|
|
10
14
|
const sync_products_to_account_1 = require("./sync-products-to-account");
|
|
11
15
|
const sync_products_to_sellercraft_1 = require("./sync-products-to-sellercraft");
|
|
12
|
-
const create_dat_shipments_1 = require("./create-dat-shipments");
|
|
13
|
-
const auto_update_all_marketplace_product_variation_quantity_1 = require("./auto-update-all-marketplace-product-variation-quantity");
|
|
14
|
-
const get_lmd_awb_1 = require("./get-lmd-awb");
|
|
15
16
|
exports.Query = Object.assign(Object.assign(Object.assign({}, fetch_sync_products_1.fetchSyncProductsResolver), fetch_sync_purchase_orders_1.fetchSyncPurchaseOrdersResolver), fetch_sync_invoices_1.fetchSyncInvoicesResolver);
|
|
16
|
-
exports.Mutation = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sync_products_to_sellercraft_1.syncProductsToSellercraftResolver), sync_products_from_account_1.syncProductsFromAccountResolver), sync_products_to_account_1.syncProductsToAccountResolver), sync_all_products_to_sellercraft_1.syncAllProductsToSellercraftResolver), sellercraft_pack_marketplace_order_1.sellercraftPackMarketplaceOrderResolver), create_dat_shipments_1.createDatShipments), auto_update_all_marketplace_product_variation_quantity_1.autoUpdateAllMarketplaceProductVariationQuantityResolver), get_lmd_awb_1.getLmdAwbResolver);
|
|
17
|
+
exports.Mutation = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sync_products_to_sellercraft_1.syncProductsToSellercraftResolver), sync_products_from_account_1.syncProductsFromAccountResolver), sync_products_to_account_1.syncProductsToAccountResolver), sync_all_products_to_sellercraft_1.syncAllProductsToSellercraftResolver), sellercraft_pack_marketplace_order_1.sellercraftPackMarketplaceOrderResolver), create_dat_shipments_1.createDatShipments), auto_update_all_marketplace_product_variation_quantity_1.autoUpdateAllMarketplaceProductVariationQuantityResolver), get_lmd_awb_1.getLmdAwbResolver), powrup_pack_order_1.powrupPackOrderResolver);
|
|
17
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/synchronization/index.ts"],"names":[],"mappings":";;;AAAA,+DAAiE;AACjE,+DAAiE;AACjE,6EAA8E;AAC9E,6FAA8F;AAC9F,yFAAyF;AACzF,6EAA8E;AAC9E,yEAA0E;AAC1E,iFAAkF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/synchronization/index.ts"],"names":[],"mappings":";;;AAAA,qIAAmI;AACnI,iEAA2D;AAC3D,+DAAiE;AACjE,+DAAiE;AACjE,6EAA8E;AAC9E,+CAAiD;AACjD,2DAA6D;AAC7D,6FAA8F;AAC9F,yFAAyF;AACzF,6EAA8E;AAC9E,yEAA0E;AAC1E,iFAAkF;AAErE,QAAA,KAAK,iDACb,+CAAyB,GACzB,4DAA+B,GAC/B,+CAAyB,EAC7B;AAEY,QAAA,QAAQ,qIAChB,gEAAiC,GACjC,4DAA+B,GAC/B,wDAA6B,GAC7B,uEAAoC,GACpC,4EAAuC,GACvC,yCAAkB,GAClB,iHAAwD,GACxD,+BAAiB,GACjB,2CAAuB,EAC3B"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.powrupPackOrderResolver = void 0;
|
|
4
4
|
const typeorm_1 = require("typeorm");
|
|
5
|
+
const auth_base_1 = require("@things-factory/auth-base");
|
|
5
6
|
const env_1 = require("@things-factory/env");
|
|
6
7
|
const integration_base_1 = require("@things-factory/integration-base");
|
|
7
8
|
const integration_powrup_1 = require("@things-factory/integration-powrup");
|
|
@@ -12,7 +13,9 @@ exports.powrupPackOrderResolver = {
|
|
|
12
13
|
try {
|
|
13
14
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
14
15
|
try {
|
|
15
|
-
const powrup = await tx
|
|
16
|
+
const powrup = await tx
|
|
17
|
+
.getRepository(integration_powrup_1.Powrup)
|
|
18
|
+
.findOne({ where: { platform: integration_powrup_1.Platform.POWRUP, active: true } });
|
|
16
19
|
let releaseGoodQb = await tx
|
|
17
20
|
.getRepository(sales_base_1.ReleaseGood)
|
|
18
21
|
.createQueryBuilder('rg')
|
|
@@ -22,8 +25,9 @@ exports.powrupPackOrderResolver = {
|
|
|
22
25
|
.innerJoinAndSelect('rg.orderProducts', 'op')
|
|
23
26
|
.innerJoinAndSelect('op.product', 'prd')
|
|
24
27
|
.innerJoinAndSelect('op.productDetail', 'pd')
|
|
25
|
-
.where(`rg.source = :source`, { source:
|
|
28
|
+
.where(`rg.source = :source`, { source: auth_base_1.ApplicationType.POWRUP })
|
|
26
29
|
.andWhere(`rg.type = :rgType`, { rgType: 'b2c' })
|
|
30
|
+
.andWhere(`rg.ref_order_id NOTNULL`)
|
|
27
31
|
.andWhere(`rg.status NOT IN(:...status) `, {
|
|
28
32
|
status: [sales_base_1.ORDER_STATUS.CANCELLED, sales_base_1.ORDER_STATUS.PENDING_CANCEL, sales_base_1.ORDER_STATUS.DONE]
|
|
29
33
|
})
|
|
@@ -41,7 +45,8 @@ exports.powrupPackOrderResolver = {
|
|
|
41
45
|
.andWhere(qb => {
|
|
42
46
|
const subQuery = qb.subQuery().from(sales_base_1.OrderPackage, 'opk').where('rg.id = opk.release_good_id').getQuery();
|
|
43
47
|
return 'NOT EXISTS ' + subQuery;
|
|
44
|
-
})
|
|
48
|
+
})
|
|
49
|
+
.limit(1);
|
|
45
50
|
let releaseGoodsWithoutPackageId = await releaseGoodQb.getMany();
|
|
46
51
|
if ((releaseGoodsWithoutPackageId === null || releaseGoodsWithoutPackageId === void 0 ? void 0 : releaseGoodsWithoutPackageId.length) > 0) {
|
|
47
52
|
await Promise.all(releaseGoodsWithoutPackageId.map(async (releaseGood) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powrup-pack-order.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/synchronization/powrup-pack-order.ts"],"names":[],"mappings":";;;AAAA,qCAAsD;AAEtD,6CAA4C;AAC5C,uEAAgF;AAChF,
|
|
1
|
+
{"version":3,"file":"powrup-pack-order.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/syn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QAAQ,EAAE,WAAW,CAAC,QAAQ;oDAC9B,OAAO,EAAE,WAAW,CAAC,OAAO;oDAC5B,OAAO,EAAE,WAAW,CAAC,OAAO;iDAC7B,CAAA;4CACH,CAAC,CAAC,CAAA;4CAEF,MAAM,GAAG,CAAC,aAAa,CAAC,6BAAgB,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;yCAClE;qCACF;iCACF;gCAAC,OAAO,CAAC,EAAE;oCACV,YAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAA;oCAChD,MAAM,GAAG,CAAC,aAAa,CAAC,wBAAW,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;iCAC7F;4BACH,CAAC,CAAC,CAAA;wBACJ,CAAC,CAAC,CACH,CAAA;qBACF;iBACF;gBAAC,OAAO,CAAC,EAAE;oBACV,YAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE,CAAC,CAAA;iBAChD;YACH,CAAC,CAAC,CAAA;SACH;QAAC,OAAO,CAAC,EAAE;YACV,YAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAA;SACjD;IACH,CAAC;CACF,CAAA"}
|
|
@@ -18,6 +18,7 @@ exports.Mutation = `
|
|
|
18
18
|
syncProductsToAccount(accountId: String!, bizplaceId: String!): Boolean @transaction
|
|
19
19
|
syncAllProductsToSellercraft: Boolean @transaction
|
|
20
20
|
sellercraftPackMarketplaceOrder: Boolean @transaction
|
|
21
|
+
powrupPackOrder: Boolean @transaction
|
|
21
22
|
getLmdAwb: Boolean @transaction
|
|
22
23
|
createDatShipments: Boolean @transaction
|
|
23
24
|
autoUpdateAllMarketplaceProductVariationQuantity(companyDomainId: String, warehouseId: String): Boolean @transaction
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AACrD,yDAAoE;AACpE,2DAAqD;AACrD,yDAAmD;AACnD,yEAAkE;AAClE,uEAAiF;AAEpE,QAAA,KAAK,GAAiB;;;;CAIlC,CAAA;AAEY,QAAA,QAAQ,GAAiB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/types/synchronization/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqD;AACrD,yDAAoE;AACpE,2DAAqD;AACrD,yDAAmD;AACnD,yEAAkE;AAClE,uEAAiF;AAEpE,QAAA,KAAK,GAAiB;;;;CAIlC,CAAA;AAEY,QAAA,QAAQ,GAAiB;;;;;;;;;;;CAWrC,CAAA;AAEY,QAAA,KAAK,GAAG;IACnB,iCAAc;IACd,mCAAe;IACf,8CAAoB;IACpB,gDAAqB;IACrB,GAAG,+BAAM;IACT,iCAAc;IACd,mCAAe;IACf,GAAG,wBAAM;CACV,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-hub",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.265",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@things-factory/pdf": "^4.3.253",
|
|
93
93
|
"@things-factory/product-ui": "^4.3.262",
|
|
94
94
|
"@things-factory/resource-ui": "^4.3.253",
|
|
95
|
-
"@things-factory/sales-base": "^4.3.
|
|
95
|
+
"@things-factory/sales-base": "^4.3.265",
|
|
96
96
|
"@things-factory/scene-data-transform": "^4.3.253",
|
|
97
97
|
"@things-factory/scene-excel": "^4.3.253",
|
|
98
98
|
"@things-factory/scene-firebase": "^4.3.253",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"@things-factory/setting-ui": "^4.3.253",
|
|
108
108
|
"@things-factory/shell": "^4.3.253",
|
|
109
109
|
"@things-factory/system-ui": "^4.3.253",
|
|
110
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
111
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
110
|
+
"@things-factory/warehouse-base": "^4.3.265",
|
|
111
|
+
"@things-factory/worksheet-base": "^4.3.265",
|
|
112
112
|
"cron-parser": "^4.7.0",
|
|
113
113
|
"koa2-swagger-ui": "^5.0.2",
|
|
114
114
|
"swagger-jsdoc": "^5.0.0",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"resolutions": {
|
|
121
121
|
"core-js": "^3.16.0"
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "89beffaf2686bbf61b38240e0388296f96612241"
|
|
124
124
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { autoUpdateAllMarketplaceProductVariationQuantityResolver } from './auto-update-all-marketplace-product-variation-quantity'
|
|
2
|
+
import { createDatShipments } from './create-dat-shipments'
|
|
1
3
|
import { fetchSyncInvoicesResolver } from './fetch-sync-invoices'
|
|
2
4
|
import { fetchSyncProductsResolver } from './fetch-sync-products'
|
|
3
5
|
import { fetchSyncPurchaseOrdersResolver } from './fetch-sync-purchase-orders'
|
|
6
|
+
import { getLmdAwbResolver } from './get-lmd-awb'
|
|
7
|
+
import { powrupPackOrderResolver } from './powrup-pack-order'
|
|
4
8
|
import { sellercraftPackMarketplaceOrderResolver } from './sellercraft-pack-marketplace-order'
|
|
5
9
|
import { syncAllProductsToSellercraftResolver } from './sync-all-products-to-sellercraft'
|
|
6
10
|
import { syncProductsFromAccountResolver } from './sync-products-from-account'
|
|
7
11
|
import { syncProductsToAccountResolver } from './sync-products-to-account'
|
|
8
12
|
import { syncProductsToSellercraftResolver } from './sync-products-to-sellercraft'
|
|
9
|
-
import { createDatShipments } from './create-dat-shipments'
|
|
10
|
-
import { autoUpdateAllMarketplaceProductVariationQuantityResolver } from './auto-update-all-marketplace-product-variation-quantity'
|
|
11
|
-
import { getLmdAwbResolver } from './get-lmd-awb'
|
|
12
13
|
|
|
13
14
|
export const Query = {
|
|
14
15
|
...fetchSyncProductsResolver,
|
|
@@ -24,5 +25,6 @@ export const Mutation = {
|
|
|
24
25
|
...sellercraftPackMarketplaceOrderResolver,
|
|
25
26
|
...createDatShipments,
|
|
26
27
|
...autoUpdateAllMarketplaceProductVariationQuantityResolver,
|
|
27
|
-
...getLmdAwbResolver
|
|
28
|
+
...getLmdAwbResolver,
|
|
29
|
+
...powrupPackOrderResolver
|
|
28
30
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getConnection, getRepository } from 'typeorm'
|
|
2
2
|
|
|
3
|
+
import { ApplicationType } from '@things-factory/auth-base'
|
|
3
4
|
import { logger } from '@things-factory/env'
|
|
4
5
|
import { createPayloadLog, PayloadType } from '@things-factory/integration-base'
|
|
5
|
-
import { Powrup, PowrupAPI } from '@things-factory/integration-powrup'
|
|
6
|
+
import { Platform, Powrup, PowrupAPI } from '@things-factory/integration-powrup'
|
|
6
7
|
import {
|
|
7
8
|
ORDER_STATUS,
|
|
8
9
|
OrderNoGenerator,
|
|
@@ -18,7 +19,9 @@ export const powrupPackOrderResolver = {
|
|
|
18
19
|
try {
|
|
19
20
|
await getConnection().transaction(async tx => {
|
|
20
21
|
try {
|
|
21
|
-
const powrup: Powrup = await tx
|
|
22
|
+
const powrup: Powrup = await tx
|
|
23
|
+
.getRepository(Powrup)
|
|
24
|
+
.findOne({ where: { platform: Platform.POWRUP, active: true } })
|
|
22
25
|
|
|
23
26
|
let releaseGoodQb = await tx
|
|
24
27
|
.getRepository(ReleaseGood)
|
|
@@ -29,8 +32,9 @@ export const powrupPackOrderResolver = {
|
|
|
29
32
|
.innerJoinAndSelect('rg.orderProducts', 'op')
|
|
30
33
|
.innerJoinAndSelect('op.product', 'prd')
|
|
31
34
|
.innerJoinAndSelect('op.productDetail', 'pd')
|
|
32
|
-
.where(`rg.source = :source`, { source:
|
|
35
|
+
.where(`rg.source = :source`, { source: ApplicationType.POWRUP })
|
|
33
36
|
.andWhere(`rg.type = :rgType`, { rgType: 'b2c' })
|
|
37
|
+
.andWhere(`rg.ref_order_id NOTNULL`)
|
|
34
38
|
.andWhere(`rg.status NOT IN(:...status) `, {
|
|
35
39
|
status: [ORDER_STATUS.CANCELLED, ORDER_STATUS.PENDING_CANCEL, ORDER_STATUS.DONE]
|
|
36
40
|
})
|
|
@@ -49,6 +53,7 @@ export const powrupPackOrderResolver = {
|
|
|
49
53
|
const subQuery = qb.subQuery().from(OrderPackage, 'opk').where('rg.id = opk.release_good_id').getQuery()
|
|
50
54
|
return 'NOT EXISTS ' + subQuery
|
|
51
55
|
})
|
|
56
|
+
.limit(1)
|
|
52
57
|
|
|
53
58
|
let releaseGoodsWithoutPackageId: ReleaseGood[] = await releaseGoodQb.getMany()
|
|
54
59
|
|
|
@@ -17,6 +17,7 @@ export const Mutation = /* GraphQL */ `
|
|
|
17
17
|
syncProductsToAccount(accountId: String!, bizplaceId: String!): Boolean @transaction
|
|
18
18
|
syncAllProductsToSellercraft: Boolean @transaction
|
|
19
19
|
sellercraftPackMarketplaceOrder: Boolean @transaction
|
|
20
|
+
powrupPackOrder: Boolean @transaction
|
|
20
21
|
getLmdAwb: Boolean @transaction
|
|
21
22
|
createDatShipments: Boolean @transaction
|
|
22
23
|
autoUpdateAllMarketplaceProductVariationQuantity(companyDomainId: String, warehouseId: String): Boolean @transaction
|