hnt_jira_report 0.0.1
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/.babelrc +5 -0
- package/.env +7 -0
- package/lib/bi/datasets_service.js +39 -0
- package/lib/bi/token_service.js +47 -0
- package/lib/bi_service.js +100 -0
- package/lib/constants.js +27 -0
- package/lib/consumo_service.js +206 -0
- package/lib/domains/governanca_hnt_servicos.js +101 -0
- package/lib/domains/grupo_compradores.js +411 -0
- package/lib/index.js +31 -0
- package/lib/issues_service.js +116 -0
- package/lib/jira/form/form_api.js +28 -0
- package/lib/jira/issues/query_api.js +81 -0
- package/lib/recovery_db/converter.js +45 -0
- package/lib/recovery_db/restore_issues.js +32 -0
- package/lib/report_service.js +79 -0
- package/lib/sap/issues_aguardando_aprovacao_services.js +513 -0
- package/lib/servicos_service.js +265 -0
- package/lib/util.js +50 -0
- package/lib/whitelist_parte/build_whitelist_parte.js +154 -0
- package/output/json/bi_aguardando_aprovacao_sap_54.json +758 -0
- package/output/json/bi_aguardando_aprovacao_sap_60.json +842 -0
- package/output/json/blocked_issues_estrategia_liberacao_60.json +422 -0
- package/package.json +32 -0
- package/src/bi/datasets_service.js +21 -0
- package/src/bi/token_service.js +18 -0
- package/src/bi_service.js +63 -0
- package/src/constants.js +25 -0
- package/src/consumo_service.js +87 -0
- package/src/domains/governanca_hnt_consumo.json +96 -0
- package/src/domains/governanca_hnt_servicos.js +111 -0
- package/src/domains/grupo_compradores/profile.json +178 -0
- package/src/domains/grupo_compradores/user.json +182 -0
- package/src/domains/grupo_compradores/user_profile.json +422 -0
- package/src/domains/grupo_compradores.js +502 -0
- package/src/domains/servicos_whitelist_process_prod.json +11002 -0
- package/src/index.js +9 -0
- package/src/issues_service.js +50 -0
- package/src/jira/form/form_api.js +15 -0
- package/src/jira/issues/query_api.js +32 -0
- package/src/recovery_db/all.json +409 -0
- package/src/recovery_db/consumo.json +128 -0
- package/src/recovery_db/consumo_276.csv +127 -0
- package/src/recovery_db/consumo_276.json +884 -0
- package/src/recovery_db/converter.js +13 -0
- package/src/recovery_db/restore_issues.js +21 -0
- package/src/recovery_db/servico.json +278 -0
- package/src/recovery_db/servico_276.csv +277 -0
- package/src/recovery_db/servico_276.json +1934 -0
- package/src/report_service.js +36 -0
- package/src/sap/issues_aguardando_aprovacao_services.js +590 -0
- package/src/servicos_service.js +157 -0
- package/src/util.js +43 -0
- package/src/whitelist_parte/build_whitelist_parte.js +103 -0
- package/src/whitelist_parte/parte_2.csv +80 -0
- package/src/whitelist_parte/parte_3.csv +160 -0
- package/src/whitelist_parte/parte_4.csv +18 -0
- package/src/whitelist_parte/por_impostos_51.csv +52 -0
- package/tests/approver_notification.test.js +42 -0
- package/tests/bi_service.test.js +36 -0
- package/tests/consumo_service.test.js +74 -0
- package/tests/filter.test.js +48 -0
- package/tests/prosegur_whitelist.test.js +44 -0
- package/tests/recovery_db/csv2json.test.js +21 -0
- package/tests/recovery_miros/format_issues.test.js +54 -0
- package/tests/report_service.test.js +27 -0
- package/tests/servicos_service.test.js +204 -0
- package/tests/user_profile.test.js +24 -0
- package/tests/whitelist/build_whitelist_parte.test.js +19 -0
package/.env
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
JIRA_ACCESS_TOKEN=YWRtaW5pc3RyYWRvci5qaXJhQGhvcnRpZnJ1dGkuY29tLmJyOkFUQVRUM3hGZkdGMDRWWG5xNXVmSXc3eFU1bk9XLXBYU2swdXJVd1FraFZDNnRPSWlRdUZlRkU1UGtJMjRZLUdnV1FLeUNpYTZJYllmamlmOTk4enZWOXFGRVpsYUE3Z1BfRXl3S2dFZWszUDBBR1h4UFJoVk5MakZ0MGNqR2VyaENSNHVkVFp6WXRRUm1QcXJvZFB1UDdrdlBaLXM0VkE5YmhoeFE2bmppS2QwdlJpY2sxRnFuOD1CM0JGOTg0Nw==
|
|
2
|
+
BI_USERNAME=rpa-hnt@hortifruti.com.br
|
|
3
|
+
BI_PASSWORD=5Is3G0O2l8lx
|
|
4
|
+
BI_CLIENT_ID=e1ee074c-37c0-4ea5-add5-a3089d434ce4
|
|
5
|
+
BI_CLIENT_SECRET=Y~o8Q~6xb4pb-FKkb3UvJATB3KEnZXFWeRH5-bm6
|
|
6
|
+
GROUPID=9601d600-e7a7-4a56-b441-647cf45ced0d
|
|
7
|
+
DATASETID=4b9f5f64-d341-4b8c-b777-dd7786fcee4f
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.postRowsInGroup = exports.getDatasetInGroup = exports.deleteRowsInGroup = void 0;
|
|
7
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
var instance = function instance(token) {
|
|
10
|
+
return _axios["default"].create({
|
|
11
|
+
baseURL: 'https://api.powerbi.com/v1.0/myorg',
|
|
12
|
+
headers: {
|
|
13
|
+
authorization: "Bearer ".concat(token),
|
|
14
|
+
Accept: 'application/json',
|
|
15
|
+
'Content-Type': 'application/json'
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var getDatasetInGroup = exports.getDatasetInGroup = function getDatasetInGroup(_ref) {
|
|
20
|
+
var token = _ref.token,
|
|
21
|
+
datasetId = _ref.datasetId,
|
|
22
|
+
groupId = _ref.groupId;
|
|
23
|
+
return instance(token).get("/groups/".concat(groupId, "/datasets/").concat(datasetId));
|
|
24
|
+
};
|
|
25
|
+
var deleteRowsInGroup = exports.deleteRowsInGroup = function deleteRowsInGroup(_ref2) {
|
|
26
|
+
var token = _ref2.token,
|
|
27
|
+
datasetId = _ref2.datasetId,
|
|
28
|
+
groupId = _ref2.groupId,
|
|
29
|
+
tableName = _ref2.tableName;
|
|
30
|
+
return instance(token)["delete"]("/groups/".concat(groupId, "/datasets/").concat(datasetId, "/tables/").concat(tableName, "/rows"));
|
|
31
|
+
};
|
|
32
|
+
var postRowsInGroup = exports.postRowsInGroup = function postRowsInGroup(_ref3) {
|
|
33
|
+
var token = _ref3.token,
|
|
34
|
+
datasetId = _ref3.datasetId,
|
|
35
|
+
groupId = _ref3.groupId,
|
|
36
|
+
tableName = _ref3.tableName,
|
|
37
|
+
data = _ref3.data;
|
|
38
|
+
return instance(token).post("/groups/".concat(groupId, "/datasets/").concat(datasetId, "/tables/").concat(tableName, "/rows"), JSON.stringify(data));
|
|
39
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getAccessToken = void 0;
|
|
8
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
12
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
13
|
+
var getAccessToken = exports.getAccessToken = /*#__PURE__*/function () {
|
|
14
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
15
|
+
var username, password, client_id, client_secret, _yield$axios$post, data;
|
|
16
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
17
|
+
while (1) switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
username = _ref.username, password = _ref.password, client_id = _ref.client_id, client_secret = _ref.client_secret;
|
|
20
|
+
_context.next = 3;
|
|
21
|
+
return _axios["default"].post('https://login.microsoftonline.com/common/oauth2/token', {
|
|
22
|
+
grant_type: 'password',
|
|
23
|
+
client_id: client_id,
|
|
24
|
+
client_secret: client_secret,
|
|
25
|
+
resource: 'https://analysis.windows.net/powerbi/api',
|
|
26
|
+
scope: 'openid',
|
|
27
|
+
username: username,
|
|
28
|
+
password: password
|
|
29
|
+
}, {
|
|
30
|
+
headers: {
|
|
31
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
case 3:
|
|
35
|
+
_yield$axios$post = _context.sent;
|
|
36
|
+
data = _yield$axios$post.data;
|
|
37
|
+
return _context.abrupt("return", data);
|
|
38
|
+
case 6:
|
|
39
|
+
case "end":
|
|
40
|
+
return _context.stop();
|
|
41
|
+
}
|
|
42
|
+
}, _callee);
|
|
43
|
+
}));
|
|
44
|
+
return function getAccessToken(_x) {
|
|
45
|
+
return _ref2.apply(this, arguments);
|
|
46
|
+
};
|
|
47
|
+
}();
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.publishReport = exports.formatReport = void 0;
|
|
7
|
+
var _datasets_service = require("./bi/datasets_service.js");
|
|
8
|
+
var _token_service = require("./bi/token_service.js");
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
12
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
var outputFormatAguardandoAprovacao = function outputFormatAguardandoAprovacao(_ref) {
|
|
19
|
+
var key = _ref.key,
|
|
20
|
+
nro_documento_pedido = _ref.nro_documento_pedido,
|
|
21
|
+
nro_nota_fiscal = _ref.nro_nota_fiscal,
|
|
22
|
+
valor_nota = _ref.valor_nota,
|
|
23
|
+
razao_fornecedor = _ref.razao_fornecedor,
|
|
24
|
+
data_emissao = _ref.data_emissao,
|
|
25
|
+
data_vencimento = _ref.data_vencimento,
|
|
26
|
+
status = _ref.status,
|
|
27
|
+
grupo_compradores_denominacao = _ref.grupo_compradores_denominacao,
|
|
28
|
+
responsavel = _ref.responsavel,
|
|
29
|
+
responsavel_email = _ref.responsavel_email,
|
|
30
|
+
last_update = _ref.last_update;
|
|
31
|
+
return {
|
|
32
|
+
key: key,
|
|
33
|
+
nro_documento_pedido: nro_documento_pedido,
|
|
34
|
+
nro_nota_fiscal: nro_nota_fiscal,
|
|
35
|
+
valor_nota: valor_nota,
|
|
36
|
+
razao_fornecedor: razao_fornecedor,
|
|
37
|
+
data_emissao: data_emissao,
|
|
38
|
+
data_vencimento: data_vencimento,
|
|
39
|
+
status: status,
|
|
40
|
+
grupo_compradores_denominacao: grupo_compradores_denominacao,
|
|
41
|
+
responsavel: responsavel,
|
|
42
|
+
responsavel_email: responsavel_email,
|
|
43
|
+
last_update: last_update
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
var formatReport = exports.formatReport = function formatReport(_ref2) {
|
|
47
|
+
var blockedIssues = _ref2.blockedIssues,
|
|
48
|
+
aguardandoAprovacaoSAPIssues = _ref2.aguardandoAprovacaoSAPIssues;
|
|
49
|
+
var currentIsues = blockedIssues.filter(function (blockedIssue) {
|
|
50
|
+
return aguardandoAprovacaoSAPIssues.find(function (i) {
|
|
51
|
+
return i.key == blockedIssue.key;
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
console.log('blockedIssues size:%s, aguardandoAprovacaoSAPIssues size:%s, currentIsues size:%s', blockedIssues.length, aguardandoAprovacaoSAPIssues.length, currentIsues.length);
|
|
55
|
+
return currentIsues.map(function (blockedIssue) {
|
|
56
|
+
return _objectSpread(_objectSpread({}, aguardandoAprovacaoSAPIssues.find(function (i) {
|
|
57
|
+
return i.key == blockedIssue.key;
|
|
58
|
+
})), blockedIssue);
|
|
59
|
+
}).map(outputFormatAguardandoAprovacao);
|
|
60
|
+
};
|
|
61
|
+
var publishReport = exports.publishReport = /*#__PURE__*/function () {
|
|
62
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref3) {
|
|
63
|
+
var credentials, datasetId, groupId, tableName, rows, _yield$getAccessToken, access_token;
|
|
64
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
65
|
+
while (1) switch (_context.prev = _context.next) {
|
|
66
|
+
case 0:
|
|
67
|
+
credentials = _ref3.credentials, datasetId = _ref3.datasetId, groupId = _ref3.groupId, tableName = _ref3.tableName, rows = _ref3.rows;
|
|
68
|
+
_context.next = 3;
|
|
69
|
+
return (0, _token_service.getAccessToken)(credentials);
|
|
70
|
+
case 3:
|
|
71
|
+
_yield$getAccessToken = _context.sent;
|
|
72
|
+
access_token = _yield$getAccessToken.access_token;
|
|
73
|
+
_context.next = 7;
|
|
74
|
+
return (0, _datasets_service.deleteRowsInGroup)({
|
|
75
|
+
token: access_token,
|
|
76
|
+
datasetId: datasetId,
|
|
77
|
+
groupId: groupId,
|
|
78
|
+
tableName: tableName
|
|
79
|
+
});
|
|
80
|
+
case 7:
|
|
81
|
+
_context.next = 9;
|
|
82
|
+
return (0, _datasets_service.postRowsInGroup)({
|
|
83
|
+
token: access_token,
|
|
84
|
+
datasetId: datasetId,
|
|
85
|
+
groupId: groupId,
|
|
86
|
+
tableName: tableName,
|
|
87
|
+
data: {
|
|
88
|
+
rows: rows
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
case 9:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee);
|
|
96
|
+
}));
|
|
97
|
+
return function publishReport(_x) {
|
|
98
|
+
return _ref4.apply(this, arguments);
|
|
99
|
+
};
|
|
100
|
+
}();
|
package/lib/constants.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TRANSACAO = exports.TIPO_ALOCACAO = exports.SECONDS = exports.SAP_COD_SERVICO = exports.SAP_COD_FORNECEDOR = exports.ORD_INTERNA = exports.NRO_NOTA_FISCAL = exports.NRO_DOCUMENTO_PEDIDO = exports.NRO_DOCUMENTO_NOTA_FISCAL = exports.NOTAS_FISCAIS_DE_SERVICO_FORM_TEMPLATE = exports.NOTAS_FISCAIS_DE_CONSUMO_FORM_TEMPLATE = exports.IMPOSTO_SEM_RETENCAO = exports.GRUPO_COMPRADORES = exports.CONTA_RAZAO = exports.COD_SERVICO = exports.CODIGO_IMPOSTO = exports.CHUNKSIZE = exports.CHAVE_ACESSO = exports.CENTRO_CUSTO = exports.AUTOMACAO_FORM_TEMPLATE = void 0;
|
|
7
|
+
var NOTAS_FISCAIS_DE_SERVICO_FORM_TEMPLATE = exports.NOTAS_FISCAIS_DE_SERVICO_FORM_TEMPLATE = '6545f970-bc4f-413c-9a77-de3611a3a615';
|
|
8
|
+
var NOTAS_FISCAIS_DE_CONSUMO_FORM_TEMPLATE = exports.NOTAS_FISCAIS_DE_CONSUMO_FORM_TEMPLATE = '720b4c69-9d84-4f08-930e-1d6c22805f71';
|
|
9
|
+
var AUTOMACAO_FORM_TEMPLATE = exports.AUTOMACAO_FORM_TEMPLATE = '910a886b-701a-490d-8b02-708b6c2d9881';
|
|
10
|
+
var CODIGO_IMPOSTO = exports.CODIGO_IMPOSTO = 'codigo_imposto';
|
|
11
|
+
var GRUPO_COMPRADORES = exports.GRUPO_COMPRADORES = 'grupo_compradores';
|
|
12
|
+
var CONTA_RAZAO = exports.CONTA_RAZAO = 'conta_razao';
|
|
13
|
+
var TIPO_ALOCACAO = exports.TIPO_ALOCACAO = 'tipo_alocacao';
|
|
14
|
+
var CENTRO_CUSTO = exports.CENTRO_CUSTO = 'centro_custo';
|
|
15
|
+
var ORD_INTERNA = exports.ORD_INTERNA = 'ord_interna';
|
|
16
|
+
var IMPOSTO_SEM_RETENCAO = exports.IMPOSTO_SEM_RETENCAO = 'imposto_sem_retencao';
|
|
17
|
+
var SAP_COD_FORNECEDOR = exports.SAP_COD_FORNECEDOR = 'sap_cod_fornecedor';
|
|
18
|
+
var COD_SERVICO = exports.COD_SERVICO = 'cod_servico';
|
|
19
|
+
var SAP_COD_SERVICO = exports.SAP_COD_SERVICO = 'sap_cod_servico';
|
|
20
|
+
var TRANSACAO = exports.TRANSACAO = 'transacao';
|
|
21
|
+
var NRO_DOCUMENTO_PEDIDO = exports.NRO_DOCUMENTO_PEDIDO = 'nro_documento_pedido';
|
|
22
|
+
var NRO_DOCUMENTO_NOTA_FISCAL = exports.NRO_DOCUMENTO_NOTA_FISCAL = 'nro_documento_nota_fiscal';
|
|
23
|
+
var CHAVE_ACESSO = exports.CHAVE_ACESSO = 'chave_acesso';
|
|
24
|
+
var NRO_NOTA_FISCAL = exports.NRO_NOTA_FISCAL = 'nro_nota_fiscal';
|
|
25
|
+
// JS
|
|
26
|
+
var CHUNKSIZE = exports.CHUNKSIZE = 20;
|
|
27
|
+
var SECONDS = exports.SECONDS = 1000;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.formatConsumo = exports.enrichComplement = void 0;
|
|
8
|
+
var _issues_service = require("./issues_service.js");
|
|
9
|
+
var fs = _interopRequireWildcard(require("fs"));
|
|
10
|
+
var _form_api = require("./jira/form/form_api.js");
|
|
11
|
+
var _constants = require("./constants.js");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
15
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
17
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
18
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
19
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
22
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
25
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
26
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
28
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
29
|
+
var formatConsumo = exports.formatConsumo = /*#__PURE__*/function () {
|
|
30
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
31
|
+
var issues, formatedIssues;
|
|
32
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
|
34
|
+
case 0:
|
|
35
|
+
issues = _ref.issues;
|
|
36
|
+
formatedIssues = issues.map(function (issue) {
|
|
37
|
+
var valor_nota = issue.valor_nota;
|
|
38
|
+
var result = _objectSpread({}, issue);
|
|
39
|
+
result['valor_nota'] = valor_nota != null && valor_nota.length ? (0, _issues_service.convertToDecimal)(valor_nota) : null;
|
|
40
|
+
return result;
|
|
41
|
+
});
|
|
42
|
+
fs.writeFileSync((0, _issues_service.debugFilename)({
|
|
43
|
+
prefix: 'tbl_ghn_issues_consumo_formatted',
|
|
44
|
+
executionId: formatedIssues.length
|
|
45
|
+
}), JSON.stringify(formatedIssues, null, 2));
|
|
46
|
+
case 3:
|
|
47
|
+
case "end":
|
|
48
|
+
return _context.stop();
|
|
49
|
+
}
|
|
50
|
+
}, _callee);
|
|
51
|
+
}));
|
|
52
|
+
return function formatConsumo(_x) {
|
|
53
|
+
return _ref2.apply(this, arguments);
|
|
54
|
+
};
|
|
55
|
+
}();
|
|
56
|
+
var chunkArray = function chunkArray(array, chunkSize) {
|
|
57
|
+
var result = [];
|
|
58
|
+
for (var i = 0; i < array.length; i += chunkSize) {
|
|
59
|
+
result.push(array.slice(i, i + chunkSize));
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
var sleep = function sleep(waitTimeInMs) {
|
|
64
|
+
return new Promise(function (resolve) {
|
|
65
|
+
return setTimeout(resolve, waitTimeInMs);
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
var enrichComplement = exports.enrichComplement = /*#__PURE__*/function () {
|
|
69
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3) {
|
|
70
|
+
var issues, complementIssues, chunkedArray, pos, _iterator, _step, _step$value, i, array, promissesIndex, promissesConsumo, _iterator2, _step2, _step2$value, index, key, responsesIdx, _iterator3, _step3, _step3$value, _index, issueKey, forms, formConsumo, consumoFormId, responsesConsumo, _iterator4, _step4, _step4$value, _index2, issue, consumoAnswers, foundChaveAcesso, chaveAcesso, founNroNotaFiscal, nroNotaFiscal;
|
|
71
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
72
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
73
|
+
case 0:
|
|
74
|
+
issues = _ref3.issues;
|
|
75
|
+
complementIssues = [];
|
|
76
|
+
_context2.prev = 2;
|
|
77
|
+
chunkedArray = chunkArray(issues, _constants.CHUNKSIZE);
|
|
78
|
+
pos = 1;
|
|
79
|
+
_iterator = _createForOfIteratorHelper(chunkedArray.entries());
|
|
80
|
+
_context2.prev = 6;
|
|
81
|
+
_iterator.s();
|
|
82
|
+
case 8:
|
|
83
|
+
if ((_step = _iterator.n()).done) {
|
|
84
|
+
_context2.next = 28;
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
_step$value = _slicedToArray(_step.value, 2), i = _step$value[0], array = _step$value[1];
|
|
88
|
+
promissesIndex = [];
|
|
89
|
+
promissesConsumo = [];
|
|
90
|
+
_iterator2 = _createForOfIteratorHelper(array.entries());
|
|
91
|
+
try {
|
|
92
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
93
|
+
_step2$value = _slicedToArray(_step2.value, 2), index = _step2$value[0], key = _step2$value[1].key;
|
|
94
|
+
console.log('chunk:%s/%s - %s/%s issueKey:%s', i, chunkedArray.length, pos++, issues.length, key);
|
|
95
|
+
promissesIndex.push((0, _form_api.getFormIndex)(key));
|
|
96
|
+
}
|
|
97
|
+
} catch (err) {
|
|
98
|
+
_iterator2.e(err);
|
|
99
|
+
} finally {
|
|
100
|
+
_iterator2.f();
|
|
101
|
+
}
|
|
102
|
+
_context2.next = 16;
|
|
103
|
+
return Promise.all(promissesIndex);
|
|
104
|
+
case 16:
|
|
105
|
+
responsesIdx = _context2.sent;
|
|
106
|
+
_iterator3 = _createForOfIteratorHelper(array.entries());
|
|
107
|
+
try {
|
|
108
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
109
|
+
_step3$value = _slicedToArray(_step3.value, 2), _index = _step3$value[0], issueKey = _step3$value[1].key;
|
|
110
|
+
forms = responsesIdx[_index].data;
|
|
111
|
+
formConsumo = forms.find(function (form) {
|
|
112
|
+
return form.formTemplate.id == _constants.NOTAS_FISCAIS_DE_CONSUMO_FORM_TEMPLATE;
|
|
113
|
+
});
|
|
114
|
+
if (formConsumo) {
|
|
115
|
+
consumoFormId = formConsumo.id;
|
|
116
|
+
promissesConsumo.push((0, _form_api.getFormSimplifiedAnswers)({
|
|
117
|
+
issueKey: issueKey,
|
|
118
|
+
formId: consumoFormId
|
|
119
|
+
}));
|
|
120
|
+
} else {
|
|
121
|
+
promissesConsumo.push(new Promise(function (resolve, reject) {
|
|
122
|
+
resolve({
|
|
123
|
+
data: [{
|
|
124
|
+
fieldKey: _constants.CHAVE_ACESSO,
|
|
125
|
+
answer: null
|
|
126
|
+
}, {
|
|
127
|
+
fieldKey: _constants.NRO_NOTA_FISCAL,
|
|
128
|
+
answer: null
|
|
129
|
+
}]
|
|
130
|
+
});
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
} catch (err) {
|
|
135
|
+
_iterator3.e(err);
|
|
136
|
+
} finally {
|
|
137
|
+
_iterator3.f();
|
|
138
|
+
}
|
|
139
|
+
_context2.next = 21;
|
|
140
|
+
return Promise.all(promissesConsumo);
|
|
141
|
+
case 21:
|
|
142
|
+
responsesConsumo = _context2.sent;
|
|
143
|
+
_iterator4 = _createForOfIteratorHelper(array.entries());
|
|
144
|
+
try {
|
|
145
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
146
|
+
_step4$value = _slicedToArray(_step4.value, 2), _index2 = _step4$value[0], issue = _step4$value[1];
|
|
147
|
+
consumoAnswers = responsesConsumo[_index2].data;
|
|
148
|
+
foundChaveAcesso = consumoAnswers.find(function (answer) {
|
|
149
|
+
return answer.fieldKey == _constants.CHAVE_ACESSO;
|
|
150
|
+
});
|
|
151
|
+
chaveAcesso = foundChaveAcesso ? foundChaveAcesso.answer : null;
|
|
152
|
+
founNroNotaFiscal = consumoAnswers.find(function (answer) {
|
|
153
|
+
return answer.fieldKey == _constants.NRO_NOTA_FISCAL;
|
|
154
|
+
});
|
|
155
|
+
nroNotaFiscal = founNroNotaFiscal ? founNroNotaFiscal.answer : null;
|
|
156
|
+
complementIssues.push(_objectSpread(_objectSpread({}, issue), {}, {
|
|
157
|
+
chave_acesso: chaveAcesso != null && chaveAcesso.length ? chaveAcesso : null,
|
|
158
|
+
nro_nota_fiscal: nroNotaFiscal != null && nroNotaFiscal.length ? nroNotaFiscal : null
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
} catch (err) {
|
|
162
|
+
_iterator4.e(err);
|
|
163
|
+
} finally {
|
|
164
|
+
_iterator4.f();
|
|
165
|
+
}
|
|
166
|
+
_context2.next = 26;
|
|
167
|
+
return sleep(1000);
|
|
168
|
+
case 26:
|
|
169
|
+
_context2.next = 8;
|
|
170
|
+
break;
|
|
171
|
+
case 28:
|
|
172
|
+
_context2.next = 33;
|
|
173
|
+
break;
|
|
174
|
+
case 30:
|
|
175
|
+
_context2.prev = 30;
|
|
176
|
+
_context2.t0 = _context2["catch"](6);
|
|
177
|
+
_iterator.e(_context2.t0);
|
|
178
|
+
case 33:
|
|
179
|
+
_context2.prev = 33;
|
|
180
|
+
_iterator.f();
|
|
181
|
+
return _context2.finish(33);
|
|
182
|
+
case 36:
|
|
183
|
+
fs.writeFileSync((0, _issues_service.debugFilename)({
|
|
184
|
+
prefix: 'tbl_ghn_issues_consumo_enrich_',
|
|
185
|
+
executionId: complementIssues.length
|
|
186
|
+
}), JSON.stringify(complementIssues, null, 2));
|
|
187
|
+
_context2.next = 43;
|
|
188
|
+
break;
|
|
189
|
+
case 39:
|
|
190
|
+
_context2.prev = 39;
|
|
191
|
+
_context2.t1 = _context2["catch"](2);
|
|
192
|
+
console.error(_context2.t1);
|
|
193
|
+
fs.writeFileSync((0, _issues_service.debugFilename)({
|
|
194
|
+
prefix: 'part_tbl_ghn_issues_consumo_enrich_',
|
|
195
|
+
executionId: complementIssues.length
|
|
196
|
+
}), JSON.stringify(complementIssues, null, 2));
|
|
197
|
+
case 43:
|
|
198
|
+
case "end":
|
|
199
|
+
return _context2.stop();
|
|
200
|
+
}
|
|
201
|
+
}, _callee2, null, [[2, 39], [6, 30, 33, 36]]);
|
|
202
|
+
}));
|
|
203
|
+
return function enrichComplement(_x2) {
|
|
204
|
+
return _ref4.apply(this, arguments);
|
|
205
|
+
};
|
|
206
|
+
}();
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.schemaServico = void 0;
|
|
7
|
+
var schemaServico = exports.schemaServico = function schemaServico() {
|
|
8
|
+
return {
|
|
9
|
+
"jira": {
|
|
10
|
+
"project": "Governança HNT - NFs",
|
|
11
|
+
"request_type": "Aprovações NFs - Serviço"
|
|
12
|
+
},
|
|
13
|
+
"db": {
|
|
14
|
+
"table_name": "tbl_ghn_issues_servico"
|
|
15
|
+
},
|
|
16
|
+
"fields": [{
|
|
17
|
+
"field": "created",
|
|
18
|
+
"column": "created",
|
|
19
|
+
"seed": "2024-09-05T04:07:53.106-0300"
|
|
20
|
+
}, {
|
|
21
|
+
"field": "status",
|
|
22
|
+
"column": "status",
|
|
23
|
+
"seed": {
|
|
24
|
+
"status": {
|
|
25
|
+
"name": "Concluído"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
"field": "assignee",
|
|
30
|
+
"column": "assignee",
|
|
31
|
+
"seed": {
|
|
32
|
+
"assignee": {
|
|
33
|
+
"displayName": "Targeto - Jose Luis Uribe"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
"field": "customfield_11149",
|
|
38
|
+
"column": "data_ultima_consulta_liberacao",
|
|
39
|
+
"seed": "20240905193300"
|
|
40
|
+
}, {
|
|
41
|
+
"field": "customfield_11126",
|
|
42
|
+
"column": "data_vencimento",
|
|
43
|
+
"seed": "2024-09-04"
|
|
44
|
+
}, {
|
|
45
|
+
"field": "customfield_10433",
|
|
46
|
+
"column": "data_emissao",
|
|
47
|
+
"seed": "2024-09-03"
|
|
48
|
+
}, {
|
|
49
|
+
"field": "statuscategorychangedate",
|
|
50
|
+
"column": "status_category_change_date",
|
|
51
|
+
"seed": "2024-09-05T19:33:17.458-0300"
|
|
52
|
+
}, {
|
|
53
|
+
"field": "customfield_11175",
|
|
54
|
+
"column": "valor_nota",
|
|
55
|
+
"column_type": "DECIMAL_10_2",
|
|
56
|
+
"seed": "1.639,02"
|
|
57
|
+
}, {
|
|
58
|
+
"field": "customfield_11131",
|
|
59
|
+
"column": "nro_nota_fiscal",
|
|
60
|
+
"seed": "68928"
|
|
61
|
+
}, {
|
|
62
|
+
"field": "customfield_11168",
|
|
63
|
+
"column": "cnpj_fornecedor",
|
|
64
|
+
"seed": "31382336000190"
|
|
65
|
+
}, {
|
|
66
|
+
"field": "customfield_11123",
|
|
67
|
+
"column": "razao_fornecedor",
|
|
68
|
+
"seed": "PREMIERSOFT SOLUCOES EM TECNOLOGIA LTDA"
|
|
69
|
+
}, {
|
|
70
|
+
"field": "customfield_11169",
|
|
71
|
+
"column": "cnpj_destinatario",
|
|
72
|
+
"seed": "00776574200597"
|
|
73
|
+
}, {
|
|
74
|
+
"field": "customfield_11174",
|
|
75
|
+
"column": "unidade_loja",
|
|
76
|
+
"seed": "CA01 - Central - RJ"
|
|
77
|
+
}, {
|
|
78
|
+
"field": "customfield_11378",
|
|
79
|
+
"column": "cod_servico",
|
|
80
|
+
"seed": "16.02"
|
|
81
|
+
}, {
|
|
82
|
+
"field": "customfield_11147",
|
|
83
|
+
"column": "nro_documento_pedido",
|
|
84
|
+
"seed": "4506539174"
|
|
85
|
+
}, {
|
|
86
|
+
"field": "customfield_11146",
|
|
87
|
+
"column": "nro_documento_nota_fiscal",
|
|
88
|
+
"seed": "5106076851"
|
|
89
|
+
}, {
|
|
90
|
+
"field": "customfield_11145",
|
|
91
|
+
"column": "nro_documento_fatura",
|
|
92
|
+
"seed": "2400106511"
|
|
93
|
+
}, {
|
|
94
|
+
"field": "comment",
|
|
95
|
+
"column": "comment",
|
|
96
|
+
"seed": {
|
|
97
|
+
"comments": []
|
|
98
|
+
}
|
|
99
|
+
}]
|
|
100
|
+
};
|
|
101
|
+
};
|