cloudcommerce 0.0.109 → 0.0.110
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/CHANGELOG.md +21 -0
- package/package.json +1 -1
- package/packages/api/lib/api.d.ts +4 -4940
- package/packages/api/lib/types.d.ts +17 -3
- package/packages/api/package.json +1 -1
- package/packages/api/src/types.ts +45 -23
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/frenet/lib-mjs/calculate-frenet.mjs +26 -23
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/tiny-erp/lib/event-to-tiny.js +94 -94
- package/packages/apps/tiny-erp/lib/index.js +1 -1
- package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js +71 -74
- package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +70 -73
- package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js +49 -53
- package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js +3 -3
- package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +76 -75
- package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +137 -140
- package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js +40 -39
- package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +173 -178
- package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +173 -171
- package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +123 -127
- package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js +32 -32
- package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js +37 -37
- package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js +42 -43
- package/packages/apps/tiny-erp/lib/tiny-erp.js +8 -6
- package/packages/apps/tiny-erp/lib/tiny-webhook.js +76 -73
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/events/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/lib/en_us.d.ts +1 -0
- package/packages/i18n/lib/en_us.js +1 -0
- package/packages/i18n/lib/en_us.js.map +1 -1
- package/packages/i18n/lib/pt_br.d.ts +1 -0
- package/packages/i18n/lib/pt_br.js +1 -0
- package/packages/i18n/lib/pt_br.js.map +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/i18n/src/en_us.ts +1 -0
- package/packages/i18n/src/pt_br.ts +1 -0
- package/packages/modules/lib/firebase/ajv.js +24 -19
- package/packages/modules/lib/firebase/call-app-module.js +110 -116
- package/packages/modules/lib/firebase/checkout.js +149 -154
- package/packages/modules/lib/firebase/checkout.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/fix-items.js +187 -194
- package/packages/modules/lib/firebase/functions-checkout/get-custumerId.js +33 -27
- package/packages/modules/lib/firebase/functions-checkout/get-custumerId.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js +111 -125
- package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/new-order.js +178 -178
- package/packages/modules/lib/firebase/functions-checkout/new-order.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/request-to-module.js +53 -60
- package/packages/modules/lib/firebase/functions-checkout/request-to-module.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/utils.js +197 -195
- package/packages/modules/lib/firebase/handle-module.js +146 -144
- package/packages/modules/lib/firebase/handle-module.js.map +1 -1
- package/packages/modules/lib/firebase/proxy-apps.js +1 -2
- package/packages/modules/lib/firebase/serve-modules-api.js +53 -52
- package/packages/modules/lib/firebase/serve-modules-api.js.map +1 -1
- package/packages/modules/lib/firebase.js +6 -4
- package/packages/modules/lib/index.js +17 -12
- package/packages/modules/lib/index.js.map +1 -1
- package/packages/modules/package.json +2 -1
- package/packages/modules/schemas/@checkout.cjs +13 -1
- package/packages/modules/schemas/list_payments.cjs +6 -0
- package/packages/modules/src/firebase/checkout.ts +22 -49
- package/packages/modules/src/firebase/functions-checkout/get-custumerId.ts +23 -17
- package/packages/modules/src/firebase/functions-checkout/handle-order-transaction.ts +8 -45
- package/packages/modules/src/firebase/functions-checkout/new-order.ts +4 -9
- package/packages/modules/src/firebase/functions-checkout/request-to-module.ts +2 -11
- package/packages/modules/src/firebase/handle-module.ts +1 -1
- package/packages/modules/src/firebase/serve-modules-api.ts +1 -1
- package/packages/modules/src/index.ts +2 -0
- package/packages/passport/lib/firebase/authenticate-customer.js +81 -0
- package/packages/passport/lib/firebase/authenticate-customer.js.map +1 -0
- package/packages/passport/lib/firebase/serve-passport-api.js +20 -30
- package/packages/passport/lib/firebase/serve-passport-api.js.map +1 -1
- package/packages/passport/lib/firebase.js +1 -13
- package/packages/passport/lib/firebase.js.map +1 -1
- package/packages/passport/lib/index.js +1 -1
- package/packages/passport/lib/index.js.map +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/passport/src/firebase/authenticate-customer.ts +94 -0
- package/packages/passport/src/firebase/serve-passport-api.ts +21 -49
- package/packages/passport/src/firebase.ts +1 -21
- package/packages/passport/src/index.ts +4 -1
- package/packages/ssr/package.json +1 -1
- package/packages/storefront/content/header.json +6 -0
- package/packages/storefront/dist/client/LoginDrawer.e69d1c74.js +1 -0
- package/packages/storefront/dist/client/assets/_...d5980663.css +4 -0
- package/packages/storefront/dist/client/chunks/LoginDrawer.0c26574f.js +1 -0
- package/packages/storefront/dist/client/chunks/{LoginForm.c995d3d4.js → LoginForm.892d64a5.js} +109 -109
- package/packages/storefront/dist/client/chunks/runtime-dom.esm-bundler.7f8f570f.js +1 -0
- package/packages/storefront/dist/client/{client.6736232b.js → client.246ab4a4.js} +1 -1
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/entry.mjs +2204 -26
- package/packages/storefront/package.json +1 -1
- package/packages/storefront/src/assets/pico.css +3 -400
- package/packages/storefront/src/lib/components/{AOffcanvas.vue → ADrawer.vue} +3 -3
- package/packages/storefront/src/lib/components/LoginDrawer.vue +80 -0
- package/packages/storefront/src/lib/components/LoginForm.vue +31 -14
- package/packages/storefront/src/lib/layouts/PagesHeader.astro +18 -7
- package/packages/storefront/src/lib/state/customer-session.ts +137 -0
- package/packages/types/index.ts +22 -0
- package/packages/types/modules/@checkout:params.d.ts +9 -1
- package/packages/types/modules/list_payments:params.d.ts +4 -0
- package/packages/types/package.json +1 -1
- package/packages/passport/lib/firebase/handle-passport.js +0 -112
- package/packages/passport/lib/firebase/handle-passport.js.map +0 -1
- package/packages/passport/src/firebase/handle-passport.ts +0 -142
- package/packages/storefront/dist/client/LoginOffcanvas.28d2f50c.js +0 -1
- package/packages/storefront/dist/client/assets/_...41f686e3.css +0 -4
- package/packages/storefront/dist/client/chunks/LoginOffcanvas.a1f3fe3b.js +0 -1
- package/packages/storefront/dist/client/chunks/runtime-dom.esm-bundler.62d623e7.js +0 -1
- package/packages/storefront/src/lib/components/LoginOffcanvas.vue +0 -41
|
@@ -3,159 +3,156 @@ import api from '@cloudcommerce/api';
|
|
|
3
3
|
import updateAppData from '@cloudcommerce/firebase/lib/helpers/update-app-data';
|
|
4
4
|
import postTiny from './post-tiny-erp.js';
|
|
5
5
|
import parseProduct from './parsers/product-from-tiny.js';
|
|
6
|
+
|
|
6
7
|
export default async (apiDoc, queueEntry, appData, canCreateNew, isHiddenQueue) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const [sku, productId] = String(queueEntry.nextId).split(';:');
|
|
9
|
+
let product = null;
|
|
10
|
+
try {
|
|
11
|
+
product = (await api.get(`products/${(productId || `sku:${sku}`)}`)).data;
|
|
12
|
+
} catch (err) {
|
|
13
|
+
if (err.statusCode !== 404) {
|
|
14
|
+
throw err;
|
|
11
15
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
logger.info(`SKU not found ${sku}`);
|
|
28
|
-
if (!isHiddenQueue && !appData.update_product) {
|
|
29
|
-
const msg = sku
|
|
30
|
-
+ ' corresponde a um produto com variações,'
|
|
16
|
+
}
|
|
17
|
+
let hasVariations = false;
|
|
18
|
+
let variationId;
|
|
19
|
+
if (product) {
|
|
20
|
+
const { variations } = product;
|
|
21
|
+
hasVariations = Boolean(variations && variations.length);
|
|
22
|
+
const variation = variations?.find((variation) => sku === variation.sku);
|
|
23
|
+
if (variation) {
|
|
24
|
+
variationId = variation._id;
|
|
25
|
+
} else {
|
|
26
|
+
logger.info(`SKU not found ${sku}`);
|
|
27
|
+
if (!isHiddenQueue && !appData.update_product) {
|
|
28
|
+
const msg = `${sku
|
|
29
|
+
} corresponde a um produto com variações,`
|
|
31
30
|
+ ' especifique o SKU da variação para importar.';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const err = new Error(msg);
|
|
32
|
+
err.isConfigError = true;
|
|
33
|
+
return err;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const handleTinyStock = ({ produto, tipo }, tinyProduct) => {
|
|
39
|
+
let quantity = Number(produto.saldo) || Number(produto.estoqueAtual);
|
|
40
|
+
if (produto.saldoReservado) {
|
|
41
|
+
quantity -= Number(produto.saldoReservado);
|
|
38
42
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
+
if (product && (!appData.update_product || variationId)) {
|
|
44
|
+
if (!Number.isNaN(quantity)) {
|
|
45
|
+
if (quantity < 0) {
|
|
46
|
+
quantity = 0;
|
|
43
47
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
quantity = 0;
|
|
48
|
-
}
|
|
49
|
-
let endpoint = `products/${product._id}`;
|
|
50
|
-
if (variationId) {
|
|
51
|
-
endpoint += `variations/${variationId}`;
|
|
52
|
-
}
|
|
53
|
-
endpoint += '/quantity';
|
|
54
|
-
logger.info(endpoint, { quantity });
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
return api.put(endpoint, quantity);
|
|
57
|
-
}
|
|
58
|
-
return null;
|
|
48
|
+
let endpoint = `products/${product._id}`;
|
|
49
|
+
if (variationId) {
|
|
50
|
+
endpoint += `variations/${variationId}`;
|
|
59
51
|
}
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
endpoint += '/quantity';
|
|
53
|
+
logger.info(endpoint, { quantity });
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
return api.put(endpoint, quantity);
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
if (!tinyProduct) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return postTiny('/produto.obter.php', { id: tinyProduct.id })
|
|
63
|
+
.then(({ produto }) => {
|
|
64
|
+
let method;
|
|
65
|
+
let endpoint;
|
|
66
|
+
let productId = product && product._id;
|
|
67
|
+
if (productId) {
|
|
68
|
+
method = 'PATCH';
|
|
69
|
+
endpoint = `products/${productId}`;
|
|
70
|
+
} else if (tipo === 'produto' || !tipo) {
|
|
71
|
+
method = 'POST';
|
|
72
|
+
endpoint = 'products';
|
|
73
|
+
} else {
|
|
74
|
+
return null;
|
|
62
75
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
// @ts-ignore
|
|
77
|
+
return parseProduct(produto, method === 'POST').then((product) => {
|
|
78
|
+
if (!Number.isNaN(quantity)) {
|
|
79
|
+
product.quantity = quantity >= 0 ? quantity : 0;
|
|
80
|
+
}
|
|
81
|
+
logger.info(`${method} ${endpoint}`);
|
|
82
|
+
const promise = api({
|
|
83
|
+
method,
|
|
84
|
+
endpoint,
|
|
85
|
+
data: product,
|
|
86
|
+
});
|
|
87
|
+
if (Array.isArray(produto.variacoes) && produto.variacoes.length) {
|
|
88
|
+
if (!queueEntry.app) {
|
|
89
|
+
logger.warn('Variations cannot be queued without `queueEntry.app`');
|
|
90
|
+
return promise;
|
|
78
91
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
promise.then((response) => {
|
|
93
|
+
let skus = appData.__importation && appData.__importation.skus;
|
|
94
|
+
if (!Array.isArray(skus)) {
|
|
95
|
+
skus = [];
|
|
96
|
+
}
|
|
97
|
+
let isQueuedVariations = false;
|
|
98
|
+
produto.variacoes.forEach(({ variacao }) => {
|
|
99
|
+
const { codigo } = variacao;
|
|
100
|
+
let skuAndId = codigo;
|
|
101
|
+
if (!productId) {
|
|
102
|
+
productId = response.data && response.data._id;
|
|
83
103
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
method,
|
|
87
|
-
endpoint,
|
|
88
|
-
data: product,
|
|
89
|
-
});
|
|
90
|
-
if (Array.isArray(produto.variacoes) && produto.variacoes.length) {
|
|
91
|
-
if (!queueEntry.app) {
|
|
92
|
-
logger.warn('Variations cannot be queued without `queueEntry.app`');
|
|
93
|
-
return promise;
|
|
94
|
-
}
|
|
95
|
-
promise.then((response) => {
|
|
96
|
-
let skus = appData.__importation && appData.__importation.skus;
|
|
97
|
-
if (!Array.isArray(skus)) {
|
|
98
|
-
skus = [];
|
|
99
|
-
}
|
|
100
|
-
let isQueuedVariations = false;
|
|
101
|
-
produto.variacoes.forEach(({ variacao }) => {
|
|
102
|
-
const { codigo } = variacao;
|
|
103
|
-
let skuAndId = codigo;
|
|
104
|
-
if (!productId) {
|
|
105
|
-
productId = response.data && response.data._id;
|
|
106
|
-
}
|
|
107
|
-
if (productId) {
|
|
108
|
-
skuAndId += `;:${productId}`;
|
|
109
|
-
}
|
|
110
|
-
if (!skus.includes(codigo) && !skus.includes(skuAndId)) {
|
|
111
|
-
isQueuedVariations = true;
|
|
112
|
-
skus.push(skuAndId);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
return isQueuedVariations
|
|
116
|
-
? updateAppData(queueEntry.app, {
|
|
117
|
-
__importation: {
|
|
118
|
-
...appData.__importation,
|
|
119
|
-
skus,
|
|
120
|
-
},
|
|
121
|
-
})
|
|
122
|
-
: response;
|
|
123
|
-
});
|
|
104
|
+
if (productId) {
|
|
105
|
+
skuAndId += `;:${productId}`;
|
|
124
106
|
}
|
|
125
|
-
|
|
107
|
+
if (!skus.includes(codigo) && !skus.includes(skuAndId)) {
|
|
108
|
+
isQueuedVariations = true;
|
|
109
|
+
skus.push(skuAndId);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return isQueuedVariations
|
|
113
|
+
? updateAppData(queueEntry.app, {
|
|
114
|
+
__importation: {
|
|
115
|
+
...appData.__importation,
|
|
116
|
+
skus,
|
|
117
|
+
},
|
|
118
|
+
})
|
|
119
|
+
: response;
|
|
126
120
|
});
|
|
121
|
+
}
|
|
122
|
+
return promise;
|
|
127
123
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return postTiny('/produto.obter.estoque.php', { id: tinyProduct.id })
|
|
150
|
-
.then((tinyStock) => handleTinyStock(tinyStock, tinyProduct));
|
|
151
|
-
}
|
|
152
|
-
return handleTinyStock({ produto: {} }, tinyProduct);
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
logger.info(JSON.stringify({
|
|
127
|
+
sku,
|
|
128
|
+
productId,
|
|
129
|
+
hasVariations,
|
|
130
|
+
variationId,
|
|
131
|
+
}));
|
|
132
|
+
const { tinyStockUpdate } = queueEntry;
|
|
133
|
+
if (tinyStockUpdate && isHiddenQueue && productId) {
|
|
134
|
+
return handleTinyStock(tinyStockUpdate);
|
|
135
|
+
}
|
|
136
|
+
return postTiny('/produtos.pesquisa.php', { pesquisa: sku })
|
|
137
|
+
.then(({ produtos }) => {
|
|
138
|
+
if (Array.isArray(produtos)) {
|
|
139
|
+
let tinyProduct = produtos.find(({ produto }) => sku === String(produto.codigo));
|
|
140
|
+
if (tinyProduct) {
|
|
141
|
+
tinyProduct = tinyProduct.produto;
|
|
142
|
+
if (!hasVariations || variationId) {
|
|
143
|
+
if (tinyStockUpdate) {
|
|
144
|
+
return handleTinyStock(tinyStockUpdate, tinyProduct);
|
|
153
145
|
}
|
|
146
|
+
return postTiny('/produto.obter.estoque.php', { id: tinyProduct.id })
|
|
147
|
+
.then((tinyStock) => handleTinyStock(tinyStock, tinyProduct));
|
|
148
|
+
}
|
|
149
|
+
return handleTinyStock({ produto: {} }, tinyProduct);
|
|
154
150
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
}
|
|
152
|
+
const msg = `SKU ${sku} não encontrado no Tiny`;
|
|
153
|
+
const err = new Error(msg);
|
|
154
|
+
err.isConfigError = true;
|
|
155
|
+
throw new Error(err);
|
|
159
156
|
});
|
|
160
157
|
};
|
|
161
|
-
|
|
158
|
+
// # sourceMappingURL=import-product-from-tiny.js.map
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import postTiny from '../post-tiny-erp.js';
|
|
2
|
+
|
|
2
3
|
export default (tinyOrder, shippingLines) => new Promise((resolve, reject) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const partialOrder = {};
|
|
5
|
+
if (tinyOrder.obs_interna) {
|
|
6
|
+
partialOrder.staff_notes = tinyOrder.obs_interna;
|
|
7
|
+
}
|
|
8
|
+
if (shippingLines && shippingLines.length) {
|
|
9
|
+
const shippingLine = shippingLines[0];
|
|
10
|
+
if ((tinyOrder.codigo_rastreamento || tinyOrder.url_rastreamento)
|
|
10
11
|
&& (!shippingLine.tracking_codes || !shippingLine.tracking_codes.length)) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
let link;
|
|
13
|
+
if (tinyOrder.url_rastreamento) {
|
|
14
|
+
link = tinyOrder.url_rastreamento;
|
|
15
|
+
}
|
|
16
|
+
const tracking = {
|
|
17
|
+
code: String(tinyOrder.codigo_rastreamento)
|
|
17
18
|
|| link.replace(/^https?:\/\/[^/]+/, '').replace(/^[^?]+\?/, '').substring(0, 70),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
19
|
+
link,
|
|
20
|
+
};
|
|
21
|
+
shippingLine.tracking_codes = [tracking];
|
|
22
|
+
partialOrder.shipping_lines = shippingLines;
|
|
23
|
+
}
|
|
24
|
+
if (tinyOrder.id_nota_fiscal > 0) {
|
|
25
|
+
if (!shippingLine.invoices) {
|
|
26
|
+
shippingLine.invoices = [];
|
|
27
|
+
}
|
|
28
|
+
postTiny('/nota.fiscal.obter.php', { id: tinyOrder.id_nota_fiscal })
|
|
29
|
+
.then((tinyInvoice) => {
|
|
30
|
+
const number = String(tinyInvoice.nota_fiscal.numero);
|
|
31
|
+
if (number && !shippingLine.invoices.find((invoice) => invoice.number === number)) {
|
|
32
|
+
shippingLine.invoices.push({
|
|
33
|
+
number,
|
|
34
|
+
serial_number: String(tinyInvoice.nota_fiscal.serie),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
partialOrder.shipping_lines = shippingLines;
|
|
38
|
+
resolve(partialOrder);
|
|
39
|
+
})
|
|
40
|
+
.catch(reject);
|
|
41
|
+
return;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
}
|
|
44
|
+
resolve(partialOrder);
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
+
// # sourceMappingURL=order-from-tiny.js.map
|