@orbe-agro/client-core 5.6.135 → 5.6.137
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/@ecme/services/ApiServiceJ.js +26 -0
- package/dist/@ecme/services/ApiServiceJ.js.map +1 -0
- package/dist/@types/@ecme/services/ApiServiceJ.d.ts +8 -0
- package/dist/@types/@ecme/services/ApiServiceJ.d.ts.map +1 -0
- package/dist/@types/base/@types/api/request/juridico/termos/termo.d.ts +54 -0
- package/dist/@types/base/@types/api/request/juridico/termos/termo.d.ts.map +1 -0
- package/dist/@types/base/@types/api/request/juridico/termos/types.d.ts +102 -0
- package/dist/@types/base/@types/api/request/juridico/termos/types.d.ts.map +1 -0
- package/dist/@types/base/configs/endpoints.config/centralNfe/centralNfe.d.ts +14 -0
- package/dist/@types/base/configs/endpoints.config/centralNfe/centralNfe.d.ts.map +1 -1
- package/dist/@types/base/configs/endpoints.config/centralNfe/config/recepcaoFisica.d.ts +16 -0
- package/dist/@types/base/configs/endpoints.config/centralNfe/config/recepcaoFisica.d.ts.map +1 -0
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts +14 -0
- package/dist/@types/base/configs/endpoints.config/endpoints.navigation.d.ts.map +1 -1
- package/dist/@types/base/configs/navigation.config/modules.submenu/centralNfe/submenu.centralNfe.d.ts.map +1 -1
- package/dist/@types/base/configs/navigation.config/submenu/centralNfe/config/recepcaoFisica.submenu.d.ts +4 -0
- package/dist/@types/base/configs/navigation.config/submenu/centralNfe/config/recepcaoFisica.submenu.d.ts.map +1 -0
- package/dist/@types/base/services/modules/centralNfe/index.d.ts +1 -0
- package/dist/@types/base/services/modules/centralNfe/index.d.ts.map +1 -1
- package/dist/@types/base/services/modules/centralNfe/recepcaoFisica/RecepcaoFisicaService.d.ts +7 -0
- package/dist/@types/base/services/modules/centralNfe/recepcaoFisica/RecepcaoFisicaService.d.ts.map +1 -0
- package/dist/@types/base/services/modules/juridico/JuridicoService.d.ts +4 -0
- package/dist/@types/base/services/modules/juridico/JuridicoService.d.ts.map +1 -0
- package/dist/@types/base/services/modules/juridico/docusignService.d.ts +32 -0
- package/dist/@types/base/services/modules/juridico/docusignService.d.ts.map +1 -0
- package/dist/@types/base/services/modules/juridico/municipiosService.d.ts +4 -0
- package/dist/@types/base/services/modules/juridico/municipiosService.d.ts.map +1 -0
- package/dist/@types/base/services/modules/juridico/termosService.d.ts +28 -0
- package/dist/@types/base/services/modules/juridico/termosService.d.ts.map +1 -0
- package/dist/base/@types/api/request/juridico/termos/termo.js +2 -0
- package/dist/base/@types/api/request/juridico/termos/termo.js.map +1 -0
- package/dist/base/@types/api/request/juridico/termos/types.js +48 -0
- package/dist/base/@types/api/request/juridico/termos/types.js.map +1 -0
- package/dist/base/configs/endpoints.config/centralNfe/centralNfe.js +3 -1
- package/dist/base/configs/endpoints.config/centralNfe/centralNfe.js.map +1 -1
- package/dist/base/configs/endpoints.config/centralNfe/config/recepcaoFisica.js +10 -0
- package/dist/base/configs/endpoints.config/centralNfe/config/recepcaoFisica.js.map +1 -0
- package/dist/base/configs/navigation.config/modules.submenu/centralNfe/submenu.centralNfe.js +2 -0
- package/dist/base/configs/navigation.config/modules.submenu/centralNfe/submenu.centralNfe.js.map +1 -1
- package/dist/base/configs/navigation.config/submenu/centralNfe/config/recepcaoFisica.submenu.js +16 -0
- package/dist/base/configs/navigation.config/submenu/centralNfe/config/recepcaoFisica.submenu.js.map +1 -0
- package/dist/base/services/modules/centralNfe/index.js +4 -0
- package/dist/base/services/modules/centralNfe/index.js.map +1 -1
- package/dist/base/services/modules/centralNfe/recepcaoFisica/RecepcaoFisicaService.js +31 -0
- package/dist/base/services/modules/centralNfe/recepcaoFisica/RecepcaoFisicaService.js.map +1 -0
- package/dist/base/services/modules/juridico/JuridicoService.js +48 -0
- package/dist/base/services/modules/juridico/JuridicoService.js.map +1 -0
- package/dist/base/services/modules/juridico/docusignService.js +112 -0
- package/dist/base/services/modules/juridico/docusignService.js.map +1 -0
- package/dist/base/services/modules/juridico/municipiosService.js +42 -0
- package/dist/base/services/modules/juridico/municipiosService.js.map +1 -0
- package/dist/base/services/modules/juridico/termosService.js +108 -0
- package/dist/base/services/modules/juridico/termosService.js.map +1 -0
- package/lib/@ecme/services/ApiServiceJ.ts +30 -0
- package/lib/base/@types/api/request/juridico/termos/termo.ts +53 -0
- package/lib/base/@types/api/request/juridico/termos/types.ts +112 -0
- package/lib/base/configs/endpoints.config/centralNfe/centralNfe.ts +3 -1
- package/lib/base/configs/endpoints.config/centralNfe/config/recepcaoFisica.ts +9 -0
- package/lib/base/configs/navigation.config/modules.submenu/centralNfe/submenu.centralNfe.ts +2 -0
- package/lib/base/configs/navigation.config/submenu/centralNfe/config/recepcaoFisica.submenu.ts +16 -0
- package/lib/base/services/modules/centralNfe/index.ts +2 -1
- package/lib/base/services/modules/centralNfe/recepcaoFisica/RecepcaoFisicaService.ts +32 -0
- package/lib/base/services/modules/juridico/JuridicoService.ts +52 -0
- package/lib/base/services/modules/juridico/docusignService.ts +154 -0
- package/lib/base/services/modules/juridico/municipiosService.ts +46 -0
- package/lib/base/services/modules/juridico/termosService.ts +118 -0
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import { apiCreateVinculoUnidadeMedida, apiFindMonitorVinculoUnidadeMedida, apiF
|
|
|
4
4
|
import { apiCreateCnpjLiberadoNota, apiFindMonitorCnpjLiberadoNota, apiFindOneCnpjLiberadoNota, apiUpdateCnpjLiberadoNota } from "./cnpjLiberadoNota/CnpjLiberadoNotaService.js";
|
|
5
5
|
import { apiCreateCnpjExcecaoNota, apiFindMonitorCnpjExcecaoNota, apiFindOneCnpjExcecaoNota, apiUpdateCnpjExcecaoNota } from "./cnpjExcecaoNota/CnpjExcecaoNotaService.js";
|
|
6
6
|
import { addLancamentoManual, apiCountNfe, apiDesvincularOrdemCompra, apiEstornarOperacao, apiEstornarPedidoCompra, apiFinalizarPedido, apiFindMonitorNfe, apiFindOneNfe, apiSetNfeLock, apiUpdateNfe, buscaValidacaoImposto, downloadPdfByChaveAcesso } from "./nfe/NfeService.js";
|
|
7
|
+
import { apiCreateRecepcaoFisica, apiFindMonitorRecepcaoFisica, apiFindOrdensCompraRecepcaoFisica } from "./recepcaoFisica/RecepcaoFisicaService.js";
|
|
7
8
|
export {
|
|
8
9
|
addLancamentoManual,
|
|
9
10
|
apiCountNfe,
|
|
@@ -11,6 +12,7 @@ export {
|
|
|
11
12
|
apiCreateCnpjLiberadoNota,
|
|
12
13
|
apiCreateIntervaloPrecoXml,
|
|
13
14
|
apiCreateNotificacaoCentralNfe,
|
|
15
|
+
apiCreateRecepcaoFisica,
|
|
14
16
|
apiCreateVinculoUnidadeMedida,
|
|
15
17
|
apiDesvincularOrdemCompra,
|
|
16
18
|
apiEstornarOperacao,
|
|
@@ -21,6 +23,7 @@ export {
|
|
|
21
23
|
apiFindMonitorIntervaloPrecoXml,
|
|
22
24
|
apiFindMonitorNfe,
|
|
23
25
|
apiFindMonitorNotificacaoCentralNfe,
|
|
26
|
+
apiFindMonitorRecepcaoFisica,
|
|
24
27
|
apiFindMonitorVinculoUnidadeMedida,
|
|
25
28
|
apiFindOneCnpjExcecaoNota,
|
|
26
29
|
apiFindOneCnpjLiberadoNota,
|
|
@@ -28,6 +31,7 @@ export {
|
|
|
28
31
|
apiFindOneNfe,
|
|
29
32
|
apiFindOneNotificacaoCentralNfe,
|
|
30
33
|
apiFindOneVinculoUnidadeMedida,
|
|
34
|
+
apiFindOrdensCompraRecepcaoFisica,
|
|
31
35
|
apiSetNfeLock,
|
|
32
36
|
apiUpdateCnpjExcecaoNota,
|
|
33
37
|
apiUpdateCnpjLiberadoNota,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import ApiService from "../../../../../@ecme/services/ApiService.js";
|
|
2
|
+
import endpointNavigationConfig from "../../../../configs/endpoints.config/endpoints.navigation.js";
|
|
3
|
+
const RECEPCAO_FISICA_ENDPOINT = endpointNavigationConfig.centralNfe.recepcaoFisica;
|
|
4
|
+
async function apiCreateRecepcaoFisica(body, userId) {
|
|
5
|
+
return ApiService.fetchDataWithAxios({
|
|
6
|
+
url: RECEPCAO_FISICA_ENDPOINT.create.endpoint,
|
|
7
|
+
method: RECEPCAO_FISICA_ENDPOINT.create.httpMethod,
|
|
8
|
+
data: body,
|
|
9
|
+
headers: { "X-User-Id": userId }
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
async function apiFindMonitorRecepcaoFisica(body) {
|
|
13
|
+
return ApiService.fetchDataWithAxios({
|
|
14
|
+
url: RECEPCAO_FISICA_ENDPOINT.findMonitor.endpoint,
|
|
15
|
+
method: RECEPCAO_FISICA_ENDPOINT.findMonitor.httpMethod,
|
|
16
|
+
data: body
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async function apiFindOrdensCompraRecepcaoFisica(cnpj) {
|
|
20
|
+
return ApiService.fetchDataWithAxios({
|
|
21
|
+
url: RECEPCAO_FISICA_ENDPOINT.findOrdensCompra.endpoint,
|
|
22
|
+
method: RECEPCAO_FISICA_ENDPOINT.findOrdensCompra.httpMethod,
|
|
23
|
+
params: { cnpj }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
apiCreateRecepcaoFisica,
|
|
28
|
+
apiFindMonitorRecepcaoFisica,
|
|
29
|
+
apiFindOrdensCompraRecepcaoFisica
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=RecepcaoFisicaService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecepcaoFisicaService.js","sources":["../../../../../../lib/base/services/modules/centralNfe/recepcaoFisica/RecepcaoFisicaService.ts"],"sourcesContent":["import ApiService from \"@/services/ApiService\";\nimport endpointConfig from \"@base/configs/endpoints.config/endpoints.navigation\";\n\nconst RECEPCAO_FISICA_ENDPOINT = endpointConfig.centralNfe.recepcaoFisica;\n\nexport async function apiCreateRecepcaoFisica(\n body: { chaveAcesso: string; ordensCompraPrevisao: string[] },\n userId: number,\n) {\n return ApiService.fetchDataWithAxios<void>({\n url: RECEPCAO_FISICA_ENDPOINT.create.endpoint,\n method: RECEPCAO_FISICA_ENDPOINT.create.httpMethod,\n data: body,\n headers: { 'X-User-Id': userId },\n })\n}\n\nexport async function apiFindMonitorRecepcaoFisica(body: any) {\n return ApiService.fetchDataWithAxios<any>({\n url: RECEPCAO_FISICA_ENDPOINT.findMonitor.endpoint,\n method: RECEPCAO_FISICA_ENDPOINT.findMonitor.httpMethod,\n data: body,\n })\n}\n\nexport async function apiFindOrdensCompraRecepcaoFisica(cnpj: string) {\n return ApiService.fetchDataWithAxios<any[]>({\n url: RECEPCAO_FISICA_ENDPOINT.findOrdensCompra.endpoint,\n method: RECEPCAO_FISICA_ENDPOINT.findOrdensCompra.httpMethod,\n params: { cnpj },\n })\n}\n"],"names":["endpointConfig"],"mappings":";;AAGA,MAAM,2BAA2BA,yBAAe,WAAW;AAE3D,eAAsB,wBAClB,MACA,QACF;AACE,SAAO,WAAW,mBAAyB;AAAA,IACvC,KAAK,yBAAyB,OAAO;AAAA,IACrC,QAAQ,yBAAyB,OAAO;AAAA,IACxC,MAAM;AAAA,IACN,SAAS,EAAE,aAAa,OAAA;AAAA,EAAO,CAClC;AACL;AAEA,eAAsB,6BAA6B,MAAW;AAC1D,SAAO,WAAW,mBAAwB;AAAA,IACtC,KAAK,yBAAyB,YAAY;AAAA,IAC1C,QAAQ,yBAAyB,YAAY;AAAA,IAC7C,MAAM;AAAA,EAAA,CACT;AACL;AAEA,eAAsB,kCAAkC,MAAc;AAClE,SAAO,WAAW,mBAA0B;AAAA,IACxC,KAAK,yBAAyB,iBAAiB;AAAA,IAC/C,QAAQ,yBAAyB,iBAAiB;AAAA,IAClD,QAAQ,EAAE,KAAA;AAAA,EAAK,CAClB;AACL;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import ApiServiceJ from "../../../../@ecme/services/ApiServiceJ.js";
|
|
2
|
+
async function apiGetTermos(body) {
|
|
3
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
4
|
+
url: "/juridico/api/juridico/termos/listar",
|
|
5
|
+
method: "get",
|
|
6
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
7
|
+
});
|
|
8
|
+
let filteredResponse = response || [];
|
|
9
|
+
if (body) {
|
|
10
|
+
if (body.id) {
|
|
11
|
+
filteredResponse = filteredResponse.filter(
|
|
12
|
+
(termo) => termo.id?.toString().includes(body.id)
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
if (body.fornecedor) {
|
|
16
|
+
const searchTerm = body.fornecedor.toLowerCase();
|
|
17
|
+
filteredResponse = filteredResponse.filter(
|
|
18
|
+
(termo) => termo.fornecedor?.nome?.toLowerCase().includes(searchTerm)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
if (body.usuarioCadastro) {
|
|
22
|
+
const searchTerm = body.usuarioCadastro.toLowerCase();
|
|
23
|
+
filteredResponse = filteredResponse.filter(
|
|
24
|
+
(termo) => termo.usuarioCadastro?.toLowerCase().includes(searchTerm)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
if (body.dataCadastro) {
|
|
28
|
+
const searchDate = body.dataCadastro;
|
|
29
|
+
filteredResponse = filteredResponse.filter((termo) => {
|
|
30
|
+
if (!termo.dataCadastro) return false;
|
|
31
|
+
const termoDate = new Date(termo.dataCadastro).toISOString().split("T")[0];
|
|
32
|
+
return termoDate === searchDate;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const paginatedResponse = {
|
|
37
|
+
content: filteredResponse,
|
|
38
|
+
size: filteredResponse.length,
|
|
39
|
+
totalElements: filteredResponse.length,
|
|
40
|
+
totalPages: 1,
|
|
41
|
+
number: 0
|
|
42
|
+
};
|
|
43
|
+
return paginatedResponse;
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
apiGetTermos
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=JuridicoService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JuridicoService.js","sources":["../../../../../lib/base/services/modules/juridico/JuridicoService.ts"],"sourcesContent":["import { IFilterParams, TQueryResponse } from '@base/@types/api'\nimport ApiServiceJ from '@/services/ApiServiceJ'\nimport { TTermo } from '@base/@types/api/request/juridico/termos/termo'\n\nexport async function apiGetTermos(body?: IFilterParams) {\n const response = await ApiServiceJ.fetchDataWithAxios<TTermo[]>({\n url: '/juridico/api/juridico/termos/listar',\n method: 'get',\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n \n // Aplicar filtros no frontend (já que o backend não suporta filtros)\n let filteredResponse = response || []\n \n if (body) {\n if (body.id) {\n filteredResponse = filteredResponse.filter((termo: TTermo) =>\n termo.id?.toString().includes(body.id as string)\n )\n }\n if (body.fornecedor) {\n const searchTerm = (body.fornecedor as string).toLowerCase()\n filteredResponse = filteredResponse.filter((termo: TTermo) =>\n termo.fornecedor?.nome?.toLowerCase().includes(searchTerm)\n )\n }\n if (body.usuarioCadastro) {\n const searchTerm = (body.usuarioCadastro as string).toLowerCase()\n filteredResponse = filteredResponse.filter((termo: TTermo) =>\n termo.usuarioCadastro?.toLowerCase().includes(searchTerm)\n )\n }\n if (body.dataCadastro) {\n const searchDate = body.dataCadastro as string\n filteredResponse = filteredResponse.filter((termo: TTermo) => {\n if (!termo.dataCadastro) return false\n const termoDate = new Date(termo.dataCadastro).toISOString().split('T')[0]\n return termoDate === searchDate\n })\n }\n }\n \n const paginatedResponse = {\n content: filteredResponse,\n size: filteredResponse.length,\n totalElements: filteredResponse.length,\n totalPages: 1,\n number: 0\n }\n \n return paginatedResponse as TQueryResponse<TTermo>\n}"],"names":[],"mappings":";AAIA,eAAs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
+
const request = {
|
|
5
|
+
brandId: "",
|
|
6
|
+
emailSubject: payload.subject,
|
|
7
|
+
status: "sent",
|
|
8
|
+
createdDateTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
9
|
+
completedDateTime: null,
|
|
10
|
+
deletedDateTime: null,
|
|
11
|
+
deliveredDateTime: null,
|
|
12
|
+
sentDateTime: null,
|
|
13
|
+
documents: [
|
|
14
|
+
{
|
|
15
|
+
documentId: payload.documentId,
|
|
16
|
+
name: "Termo",
|
|
17
|
+
fileExtension: "pdf",
|
|
18
|
+
documentBase64: payload.documentBase64
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
recipients: {
|
|
22
|
+
signers: payload.signers.map((s, idx) => ({
|
|
23
|
+
emailBody: "",
|
|
24
|
+
emailSubject: payload.subject,
|
|
25
|
+
email: s.email,
|
|
26
|
+
name: s.name,
|
|
27
|
+
recipientId: String(idx + 1),
|
|
28
|
+
routingOrder: String(idx + 1),
|
|
29
|
+
signHereTabs: []
|
|
30
|
+
}))
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
console.log("[DocuSign] POST /send-envelopeId — request:", request);
|
|
34
|
+
try {
|
|
35
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
36
|
+
url: "/docusign/api/docusign/send-envelopeId",
|
|
37
|
+
method: "POST",
|
|
38
|
+
data: request,
|
|
39
|
+
headers: { "Content-Type": "application/json" },
|
|
40
|
+
serviceKeyEnvName: "DOCUSIGN_API_KEY"
|
|
41
|
+
});
|
|
42
|
+
console.log("[DocuSign] POST /send-envelopeId — response:", response);
|
|
43
|
+
return {
|
|
44
|
+
envelopeId: response.envelopeId,
|
|
45
|
+
status: response.status
|
|
46
|
+
};
|
|
47
|
+
} catch (err) {
|
|
48
|
+
console.error("[DocuSign] POST /send-envelopeId — error:", err);
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
listEnvelopes: async (date, status) => {
|
|
53
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
54
|
+
url: `/docusign/api/docusign/list-status-envelopeId/${date}`,
|
|
55
|
+
method: "GET",
|
|
56
|
+
params: { status },
|
|
57
|
+
serviceKeyEnvName: "DOCUSIGN_API_KEY"
|
|
58
|
+
});
|
|
59
|
+
return (response.envelopes || []).map((e) => ({
|
|
60
|
+
envelopeId: e.envelopeId,
|
|
61
|
+
status: e.status,
|
|
62
|
+
updatedDateTime: e.statusChangedDateTime ?? e.createdDateTime
|
|
63
|
+
}));
|
|
64
|
+
},
|
|
65
|
+
listRecipients: async (envelopeId) => {
|
|
66
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
67
|
+
url: `/docusign/api/docusign/list-status-recipients/${envelopeId}`,
|
|
68
|
+
method: "GET",
|
|
69
|
+
serviceKeyEnvName: "DOCUSIGN_API_KEY"
|
|
70
|
+
});
|
|
71
|
+
return response.signers || [];
|
|
72
|
+
},
|
|
73
|
+
voidEnvelope: async (envelopeId, reason) => {
|
|
74
|
+
await ApiServiceJ.fetchDataWithAxios({
|
|
75
|
+
url: `/docusign/api/docusign/voided-envelope/${envelopeId}`,
|
|
76
|
+
method: "PUT",
|
|
77
|
+
params: { voidedReason: reason },
|
|
78
|
+
serviceKeyEnvName: "DOCUSIGN_API_KEY"
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
updateRecipients: async (envelopeId, signers) => {
|
|
82
|
+
const request = {
|
|
83
|
+
signers: signers.map((s) => ({
|
|
84
|
+
email: s.email,
|
|
85
|
+
recipientId: s.recipientId
|
|
86
|
+
}))
|
|
87
|
+
};
|
|
88
|
+
await ApiServiceJ.fetchDataWithAxios({
|
|
89
|
+
url: `/docusign/api/docusign/update-email/${envelopeId}`,
|
|
90
|
+
method: "PUT",
|
|
91
|
+
data: request,
|
|
92
|
+
serviceKeyEnvName: "DOCUSIGN_API_KEY"
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
downloadSignedPdf: async (envelopeId, documentId) => {
|
|
96
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
97
|
+
url: `/docusign/api/docusign/download-pdf/${envelopeId}/${documentId}`,
|
|
98
|
+
method: "GET",
|
|
99
|
+
serviceKeyEnvName: "DOCUSIGN_API_KEY"
|
|
100
|
+
});
|
|
101
|
+
const b64 = response?.pdfBase64 || "";
|
|
102
|
+
const binary = atob(b64);
|
|
103
|
+
const len = binary.length;
|
|
104
|
+
const bytes = new Uint8Array(len);
|
|
105
|
+
for (let i = 0; i < len; i++) bytes[i] = binary.charCodeAt(i);
|
|
106
|
+
return bytes.buffer;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
export {
|
|
110
|
+
docusignService
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=docusignService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docusignService.js","sources":["../../../../../lib/base/services/modules/juridico/docusignService.ts"],"sourcesContent":["import ApiServiceJ from '@/services/ApiServiceJ'\n\nexport type TSignerUpdate = {\n email: string\n recipientId: string\n name?: string\n}\n\nexport type TSendEnvelopeRequest = {\n subject: string\n signers: { email: string; name: string }[]\n documentBase64: string\n documentId?: string\n}\n\nexport type TEnvelopeOutput = {\n envelopeId: string\n status?: string\n updatedDateTime?: string\n}\n\nexport const docusignService = {\n sendEnvelope: async (payload: TSendEnvelopeRequest): Promise<TEnvelopeOutput> => {\n const request = {\n brandId: '',\n emailSubject: payload.subject,\n status: 'sent',\n createdDateTime: new Date().toISOString(),\n completedDateTime: null,\n deletedDateTime: null,\n deliveredDateTime: null,\n sentDateTime: null,\n documents: [\n {\n documentId: payload.documentId,\n name: 'Termo',\n fileExtension: 'pdf',\n documentBase64: payload.documentBase64,\n },\n ],\n recipients: {\n signers: payload.signers.map((s, idx) => ({\n emailBody: '',\n emailSubject: payload.subject,\n email: s.email,\n name: s.name,\n recipientId: String(idx + 1),\n routingOrder: String(idx + 1),\n signHereTabs: [],\n })),\n },\n }\n\n console.log('[DocuSign] POST /send-envelopeId — request:', request)\n\n try {\n const response = await ApiServiceJ.fetchDataWithAxios<{\n status?: string\n envelopeId: string\n }, typeof request>({\n url: '/docusign/api/docusign/send-envelopeId',\n method: 'POST',\n data: request,\n headers: { 'Content-Type': 'application/json' },\n serviceKeyEnvName: 'DOCUSIGN_API_KEY',\n })\n\n console.log('[DocuSign] POST /send-envelopeId — response:', response)\n\n return {\n envelopeId: response.envelopeId,\n status: response.status,\n }\n } catch (err) {\n console.error('[DocuSign] POST /send-envelopeId — error:', err)\n throw err\n }\n },\n\n listEnvelopes: async (date: string, status: string): Promise<TEnvelopeOutput[]> => {\n const response = await ApiServiceJ.fetchDataWithAxios<{\n resultSetSize: string\n totalSetSize: string\n envelopes: Array<{\n createdDateTime: string\n statusChangedDateTime?: string\n envelopeId: string\n status: string\n }>\n }, Record<string, unknown>>({\n url: `/docusign/api/docusign/list-status-envelopeId/${date}`,\n method: 'GET',\n params: { status },\n serviceKeyEnvName: 'DOCUSIGN_API_KEY',\n })\n\n return (response.envelopes || []).map((e) => ({\n envelopeId: e.envelopeId,\n status: e.status,\n updatedDateTime: e.statusChangedDateTime ?? e.createdDateTime,\n }))\n },\n\n listRecipients: async (envelopeId: string) => {\n const response = await ApiServiceJ.fetchDataWithAxios<{\n signers: Array<{ name: string; email: string; status?: string }>\n }, Record<string, unknown>>({\n url: `/docusign/api/docusign/list-status-recipients/${envelopeId}`,\n method: 'GET',\n serviceKeyEnvName: 'DOCUSIGN_API_KEY',\n })\n\n return response.signers || []\n },\n\n voidEnvelope: async (envelopeId: string, reason: string) => {\n await ApiServiceJ.fetchDataWithAxios<void, Record<string, unknown>>({\n url: `/docusign/api/docusign/voided-envelope/${envelopeId}`,\n method: 'PUT',\n params: { voidedReason: reason },\n serviceKeyEnvName: 'DOCUSIGN_API_KEY',\n })\n },\n\n updateRecipients: async (envelopeId: string, signers: TSignerUpdate[]) => {\n const request = {\n signers: signers.map((s) => ({\n email: s.email,\n recipientId: s.recipientId,\n })),\n }\n\n await ApiServiceJ.fetchDataWithAxios<void, typeof request>({\n url: `/docusign/api/docusign/update-email/${envelopeId}`,\n method: 'PUT',\n data: request,\n serviceKeyEnvName: 'DOCUSIGN_API_KEY',\n })\n },\n\n downloadSignedPdf: async (envelopeId: string, documentId: string): Promise<ArrayBuffer> => {\n const response = await ApiServiceJ.fetchDataWithAxios<{ pdfBase64: string }>({\n url: `/docusign/api/docusign/download-pdf/${envelopeId}/${documentId}`,\n method: 'GET',\n serviceKeyEnvName: 'DOCUSIGN_API_KEY',\n })\n const b64 = response?.pdfBase64 || ''\n const binary = atob(b64)\n const len = binary.length\n const bytes = new Uint8Array(len)\n for (let i = 0; i < len; i++) bytes[i] = binary.charCodeAt(i)\n return bytes.buffer\n },\n}\n"],"names":[],"mappings":";AAqBO,MAAM,kBAAkB;AAAA,EAC3B,cAAc,OAAO,YAA4D;AAC7E,UAAM,UAAU;AAAA,MACZ,SAAS;AAAA,MACT,cAAc,QAAQ;AAAA,MACtB,QAAQ;AAAA,MACR,kBAAiB,oBAAI,KAAA,GAAO,YAAA;AAAA,MAC5B,mBAAmB;AAAA,MACnB,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,WAAW;AAAA,QACP;AAAA,UACI,YAAY,QAAQ;AAAA,UACpB,MAAM;AAAA,UACN,eAAe;AAAA,UACf,gBAAgB,QAAQ;AAAA,QAAA;AAAA,MAC5B;AAAA,MAEJ,YAAY;AAAA,QACR,SAAS,QAAQ,QAAQ,IAAI,CAAC,GAAG,SAAS;AAAA,UACtC,WAAW;AAAA,UACX,cAAc,QAAQ;AAAA,UACtB,OAAO,EAAE;AAAA,UACT,MAAM,EAAE;AAAA,UACR,aAAa,OAAO,MAAM,CAAC;AAAA,UAC3B,cAAc,OAAO,MAAM,CAAC;AAAA,UAC5B,cAAc,CAAA;AAAA,QAAC,EACjB;AAAA,MAAA;AAAA,IACN;AAGJ,YAAQ,IAAI,+CAA+C,OAAO;AAElE,QA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I,CAAC,OAAO;AAAA,QACzB,OAAO,EAAE;AAAA,QACT,aAAa,EAAE;AAAA,MAAA,EACjB;AAAA,IAAA;AAGN,UAAM,YAAY,mBAAyC;AAAA,MACvD,KAAK,uCAAuC,UAAU;AAAA,MACtD,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,mBAAmB;AAAA,IAAA,CACtB;AAAA,EACL;AAAA,EAEA,mBAAmB,OAAO,YAAoB,eAA6C;AACvF,UAAM,WAAW,MAAM,YAAY,mBAA0C;AAAA,MACzE,KAAK,uCAAuC,UAAU,IAAI,UAAU;AAAA,MACpE,QAAQ;AAAA,MACR,mBAAmB;AAAA,IAAA,CACtB;AACD,UAAM,MAAM,UAAU,aAAa;AACnC,UAAM,SAAS,KAAK,GAAG;AACvB,UAAM,MAAM,OAAO;AACnB,UAAM,QAAQ,IAAI,WAAW,GAAG;AAChC,aAAS,IAAI,GAAG,IAAI,KAAK,WAAW,CAAC,IAAI,OAAO,WAAW,CAAC;AAC5D,WAAO,MAAM;AAAA,EACjB;AACJ;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import ApiService from "../../../../@ecme/services/ApiService.js";
|
|
2
|
+
const municipiosService = {
|
|
3
|
+
getAll: async () => {
|
|
4
|
+
try {
|
|
5
|
+
console.log("Fazendo requisição para /dados-mestres/api/municipio/find");
|
|
6
|
+
const response = await ApiService.fetchDataWithAxios({
|
|
7
|
+
url: "/dados-mestres/api/municipio/find",
|
|
8
|
+
method: "POST",
|
|
9
|
+
data: {
|
|
10
|
+
id: null,
|
|
11
|
+
municipio: null,
|
|
12
|
+
codigo: null,
|
|
13
|
+
pageable: {
|
|
14
|
+
pageNumber: 1,
|
|
15
|
+
pageSize: 1e4,
|
|
16
|
+
sort: [{
|
|
17
|
+
sortField: "municipio",
|
|
18
|
+
sortOrder: "asc"
|
|
19
|
+
}]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
console.log("Resposta da API:", response);
|
|
24
|
+
const municipios = response.content || [];
|
|
25
|
+
return municipios.map((municipio) => ({
|
|
26
|
+
id: municipio.id,
|
|
27
|
+
nome: municipio.municipio,
|
|
28
|
+
uf: municipio.uf,
|
|
29
|
+
codigo: municipio.codigo,
|
|
30
|
+
ativo: true
|
|
31
|
+
// Assumindo que todos os retornados estão ativos
|
|
32
|
+
}));
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error("Error fetching municipalities:", error);
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
municipiosService
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=municipiosService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"municipiosService.js","sources":["../../../../../lib/base/services/modules/juridico/municipiosService.ts"],"sourcesContent":["import ApiService from '@/services/ApiService'\nimport { TQueryResponse } from '@base/@types/api'\n\nexport const municipiosService = {\n getAll: async (): Promise<any[]> => {\n try {\n console.log('Fazendo requisição para /dados-mestres/api/municipio/find')\n \n // Usando o ApiService padrão do projeto que já inclui o X-Service-Token\n const response = await ApiService.fetchDataWithAxios<TQueryResponse<any>>({\n url: '/dados-mestres/api/municipio/find',\n method: 'POST',\n data: {\n id: null,\n municipio: null,\n codigo: null,\n pageable: {\n pageNumber: 1,\n pageSize: 10000,\n sort: [{\n sortField: 'municipio',\n sortOrder: 'asc'\n }]\n }\n }\n })\n \n console.log('Resposta da API:', response)\n \n // A resposta é paginada, então pegamos o conteúdo\n const municipios = response.content || []\n \n // Mapear para o formato esperado pelo frontend\n return municipios.map((municipio: any) => ({\n id: municipio.id,\n nome: municipio.municipio,\n uf: municipio.uf,\n codigo: municipio.codigo,\n ativo: true // Assumindo que todos os retornados estão ativos\n }))\n } catch (error) {\n console.error('Error fetching municipalities:', error)\n return []\n }\n }\n}"],"names":[],"mappings":";AAGO,MAAM,oBAAoB;AAAA,EAC7B,QAAQ,YAA4B;AAChC,QAAI;AACA,cAAQ,IAAI,2DAA2D;AAGvE,YAAM,WAAW,MAAM,WAAW,mBAAwC;AAAA,QACtE,KAAK;AAAA,QACL,QAAQ;AAAA,QACR,MAAM;AAAA,UACF,IAAI;AAAA,UACJ,WAAW;AAAA,UACX,QAAQ;AAAA,UACR,UAAU;AAAA,YACN,YAAY;AAAA,YACZ,UAAU;AAAA,YACV,MAAM,CAAC;AAAA,cACH,WAAW;AAAA,cACX,WAAW;AAAA,YAAA,CACd;AAAA,UAAA;AAAA,QACL;AAAA,MACJ,CACH;AAED,cAAQ,IAAI,oBAAoB,QAAQ;AAGxC,YAAM,aAAa,SAAS,WAAW,CAAA;AAGvC,aAAO,WAAW,IAAI,CAAC,eAAoB;AAAA,QACvC,IAAI,UAAU;AAAA,QACd,MAAM,UAAU;AAAA,QAChB,IAAI,UAAU;AAAA,QACd,QAAQ,UAAU;AAAA,QAClB,OAAO;AAAA;AAAA,MAAA,EACT;AAAA,IACN,SAAS,OAAO;AACZ,cAAQ,MAAM,kCAAkC,KAAK;AACrD,aAAO,CAAA;AAAA,IACX;AAAA,EACJ;AACJ;"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import ApiServiceJ from "../../../../@ecme/services/ApiServiceJ.js";
|
|
2
|
+
const BASE_URL = "/juridico/api/juridico/termos";
|
|
3
|
+
const termosService = {
|
|
4
|
+
create: async (termo) => {
|
|
5
|
+
try {
|
|
6
|
+
console.log("Payload being sent:", termo);
|
|
7
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
8
|
+
url: BASE_URL,
|
|
9
|
+
method: "POST",
|
|
10
|
+
data: termo,
|
|
11
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
12
|
+
});
|
|
13
|
+
return response;
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.error("Detailed error:", error.response?.data);
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
downloadPdf: async (id) => {
|
|
20
|
+
console.log("Chamando download com ID:", id);
|
|
21
|
+
try {
|
|
22
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
23
|
+
url: `${BASE_URL}/download/${id}`,
|
|
24
|
+
method: "GET",
|
|
25
|
+
responseType: "arraybuffer",
|
|
26
|
+
headers: {
|
|
27
|
+
"Accept": "application/pdf, application/json;q=0.9, */*;q=0.8"
|
|
28
|
+
},
|
|
29
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
30
|
+
});
|
|
31
|
+
console.log("Resposta recebida:", response);
|
|
32
|
+
return response;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
console.error("Erro completo:", error);
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
downloadPdfDocuSign: async (id) => {
|
|
39
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
40
|
+
url: `${BASE_URL}/${id}/docusign/download`,
|
|
41
|
+
method: "GET",
|
|
42
|
+
responseType: "arraybuffer",
|
|
43
|
+
headers: {
|
|
44
|
+
"Accept": "application/pdf, application/json;q=0.9, */*;q=0.8"
|
|
45
|
+
},
|
|
46
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
47
|
+
});
|
|
48
|
+
return response;
|
|
49
|
+
},
|
|
50
|
+
aprovarRejeitar: async (data) => {
|
|
51
|
+
return ApiServiceJ.fetchDataWithAxios({
|
|
52
|
+
url: `${BASE_URL}/aprovar-rejeitar`,
|
|
53
|
+
method: "PUT",
|
|
54
|
+
data,
|
|
55
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
getById: async (id) => {
|
|
59
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
60
|
+
url: `${BASE_URL}/${id}`,
|
|
61
|
+
method: "GET",
|
|
62
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
63
|
+
});
|
|
64
|
+
return response;
|
|
65
|
+
},
|
|
66
|
+
getContratoDocusign: async (id) => {
|
|
67
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
68
|
+
url: `${BASE_URL}/${id}/contrato-docusign`,
|
|
69
|
+
method: "GET",
|
|
70
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
71
|
+
});
|
|
72
|
+
return response;
|
|
73
|
+
},
|
|
74
|
+
attachEnvelope: async (id, envelopeId) => {
|
|
75
|
+
await ApiServiceJ.fetchDataWithAxios({
|
|
76
|
+
url: `${BASE_URL}/${id}/docusign/envelope`,
|
|
77
|
+
method: "PUT",
|
|
78
|
+
data: { envelopeId },
|
|
79
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
enviarEnvelope: async (id) => {
|
|
83
|
+
await ApiServiceJ.fetchDataWithAxios({
|
|
84
|
+
url: `${BASE_URL}/${id}/docusign/enviar`,
|
|
85
|
+
method: "POST",
|
|
86
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
syncStatusDocuSign: async () => {
|
|
90
|
+
await ApiServiceJ.fetchDataWithAxios({
|
|
91
|
+
url: `${BASE_URL}/docusign/sync-status`,
|
|
92
|
+
method: "PUT",
|
|
93
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
getRecipientsStatus: async (id) => {
|
|
97
|
+
const response = await ApiServiceJ.fetchDataWithAxios({
|
|
98
|
+
url: `${BASE_URL}/${id}/docusign/recipients`,
|
|
99
|
+
method: "GET",
|
|
100
|
+
serviceKeyEnvName: "JURIDICO_API_KEY"
|
|
101
|
+
});
|
|
102
|
+
return response || [];
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
export {
|
|
106
|
+
termosService
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=termosService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"termosService.js","sources":["../../../../../lib/base/services/modules/juridico/termosService.ts"],"sourcesContent":["import ApiServiceJ from '@/services/ApiServiceJ'\nimport { TTermo } from '@base/@types/api/request/juridico/termos/termo'\nimport { TTermoFormSchema } from '@base/@types/api/request/juridico/termos/types'\n\n\nconst BASE_URL = '/juridico/api/juridico/termos'\n\nexport const termosService = {\n create: async (termo: TTermoFormSchema): Promise<{ id: number }> => {\n try {\n console.log('Payload being sent:', termo)\n \n const response = await ApiServiceJ.fetchDataWithAxios<{ id: number }, TTermoFormSchema>({\n url: BASE_URL,\n method: 'POST',\n data: termo,\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n return response\n } catch (error: any) {\n console.error('Detailed error:', error.response?.data)\n throw error\n }\n },\n \n downloadPdf: async (id: number): Promise<ArrayBuffer> => {\n console.log('Chamando download com ID:', id)\n try {\n const response = await ApiServiceJ.fetchDataWithAxios<ArrayBuffer>({\n url: `${BASE_URL}/download/${id}`,\n method: 'GET',\n responseType: 'arraybuffer',\n headers: {\n 'Accept': 'application/pdf, application/json;q=0.9, */*;q=0.8'\n },\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n console.log('Resposta recebida:', response)\n return response\n } catch (error: any) {\n console.error('Erro completo:', error)\n throw error\n }\n },\n downloadPdfDocuSign: async (id: number): Promise<ArrayBuffer> => {\n const response = await ApiServiceJ.fetchDataWithAxios<ArrayBuffer>({\n url: `${BASE_URL}/${id}/docusign/download`,\n method: 'GET',\n responseType: 'arraybuffer',\n headers: {\n 'Accept': 'application/pdf, application/json;q=0.9, */*;q=0.8'\n },\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n return response\n },\n aprovarRejeitar: async (data: {\n termoId: number;\n status: 'APROVADO' | 'REJEITADO';\n justificativaRejeicao?: string;\n }) => {\n return ApiServiceJ.fetchDataWithAxios({\n url: `${BASE_URL}/aprovar-rejeitar`,\n method: 'PUT',\n data,\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n },\n\n getById: async (id: number): Promise<TTermo> => {\n const response = await ApiServiceJ.fetchDataWithAxios<TTermo>({\n url: `${BASE_URL}/${id}`,\n method: 'GET',\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n return response\n },\n\n getContratoDocusign: async (id: number): Promise<{ envelopeId: string; contratoId: number }> => {\n const response = await ApiServiceJ.fetchDataWithAxios<{ envelopeId: string; contratoId: number }>({\n url: `${BASE_URL}/${id}/contrato-docusign`,\n method: 'GET',\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n return response\n },\n\n attachEnvelope: async (id: number, envelopeId: string): Promise<void> => {\n await ApiServiceJ.fetchDataWithAxios<void, { envelopeId: string }>({\n url: `${BASE_URL}/${id}/docusign/envelope`,\n method: 'PUT',\n data: { envelopeId },\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n },\n enviarEnvelope: async (id: number): Promise<void> => {\n await ApiServiceJ.fetchDataWithAxios<void>({\n url: `${BASE_URL}/${id}/docusign/enviar`,\n method: 'POST',\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n },\n syncStatusDocuSign: async (): Promise<void> => {\n await ApiServiceJ.fetchDataWithAxios<void>({\n url: `${BASE_URL}/docusign/sync-status`,\n method: 'PUT',\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n },\n getRecipientsStatus: async (id: number): Promise<Array<{ name: string; email: string; status?: string }>> => {\n const response = await ApiServiceJ.fetchDataWithAxios<Array<{ name: string; email: string; status?: string }>>({\n url: `${BASE_URL}/${id}/docusign/recipients`,\n method: 'GET',\n serviceKeyEnvName: 'JURIDICO_API_KEY',\n })\n return response || []\n },\n}"],"names":[],"mappings":";AAKA,MAAM,WAAW;AAEV,MAAM,gBAAgB;AAAA,EACzB,QAAQ,OAAO,UAAqD;AAChE,QAAI;AACA,cAAQ,IAAI,uBAAuB,KAAK;AAExC,YAAM,WAAW,MAAM,YAAY,mBAAqD;AAAA,QACpF,KAAK;AAAA,QACL,QAAQ;AAAA,QACR,MAAM;AAAA,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WAAW,MAAM,YAAY,mBAA+D;AAAA,MAC9F,KAAK,GAAG,QAAQ,IAAI,EAAE;AAAA,MACtB,QAAQ;AAAA,MACR,mBAAmB;AAAA,IAAA,CACtB;AACD,WAAO;AAAA,EACX;AAAA,EAEA,gBAAgB,OAAO,IAAY,eAAsC;AACrE,UAAM,YAAY,mBAAiD;AAAA,MAC/D,KAAK,GAAG,QAAQ,IAAI,EAAE;AAAA,MACtB,QAAQ;AAAA,MACR,MAAM,EAAE,WAAA;AAAA,MACR,mBAAmB;AAAA,IAAA,CACtB;AAAA,EACL;AAAA,EACA,gBAAgB,OAAO,OAA8B;AACjD,UAAM,YAAY,mBAAyB;AAAA,MACvC,KAAK,GAAG,QAAQ,IAAI,EAAE;AAAA,MACtB,QAAQ;AAAA,MACR,mBAAmB;AAAA,IAAA,CACtB;AAAA,EACL;AAAA,EACA,oBAAoB,YAA2B;AAC3C,UAAM,YAAY,mBAAyB;AAAA,MACvC,KAAK,GAAG,QAAQ;AAAA,MAChB,QAAQ;AAAA,MACR,mBAAmB;AAAA,IAAA,CACtB;AAAA,EACL;AAAA,EACA,qBAAqB,OAAO,OAAiF;AACzG,UAAM,WAAW,MAAM,YAAY,mBAA4E;AAAA,MAC3G,KAAK,GAAG,QAAQ,IAAI,EAAE;AAAA,MACtB,QAAQ;AAAA,MACR,mBAAmB;AAAA,IAAA,CACtB;AACD,WAAO,YAAY,CAAA;AAAA,EACvB;AACJ;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import ApiService from './ApiService'
|
|
2
|
+
import type { AxiosRequestConfig } from 'axios'
|
|
3
|
+
|
|
4
|
+
const ApiServiceJ = {
|
|
5
|
+
fetchDataWithAxios<Response = unknown, Request = Record<string, unknown>>(
|
|
6
|
+
param: AxiosRequestConfig<Request> & { serviceKeyEnvName?: 'JURIDICO_API_KEY' | 'DOCUSIGN_API_KEY' },
|
|
7
|
+
) {
|
|
8
|
+
const { serviceKeyEnvName, headers: originalHeaders, ...rest } = param
|
|
9
|
+
|
|
10
|
+
const headers = { ...(originalHeaders || {}) }
|
|
11
|
+
|
|
12
|
+
if (serviceKeyEnvName) {
|
|
13
|
+
const rawSecret = (import.meta.env as any)[serviceKeyEnvName] ?? ''
|
|
14
|
+
|
|
15
|
+
if (rawSecret) {
|
|
16
|
+
headers['X-API-KEY'] = window.btoa(String(rawSecret))
|
|
17
|
+
} else {
|
|
18
|
+
console.warn(
|
|
19
|
+
`[ApiService] Variável de ambiente '${serviceKeyEnvName}' não encontrada em import.meta.env.`
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return ApiService.fetchDataWithAxios<Response, Request>({
|
|
25
|
+
...rest,
|
|
26
|
+
headers,
|
|
27
|
+
})
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
export default ApiServiceJ
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type TTermo = {
|
|
2
|
+
id: number
|
|
3
|
+
ativo: boolean
|
|
4
|
+
tipoContrato: string
|
|
5
|
+
dataCadastro: string
|
|
6
|
+
usuarioCadastro: string
|
|
7
|
+
fornecedor: {
|
|
8
|
+
id: number
|
|
9
|
+
nome: string
|
|
10
|
+
cpfCnpj: string
|
|
11
|
+
endereco: {
|
|
12
|
+
ativo: boolean
|
|
13
|
+
bairro: string
|
|
14
|
+
rua: string
|
|
15
|
+
numero: string
|
|
16
|
+
cep: string
|
|
17
|
+
municipio: {
|
|
18
|
+
id: number
|
|
19
|
+
nome: string
|
|
20
|
+
uf: string
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
representante: {
|
|
25
|
+
ativo: boolean
|
|
26
|
+
nome: string
|
|
27
|
+
cpf: string
|
|
28
|
+
email: string
|
|
29
|
+
tipo: string
|
|
30
|
+
}
|
|
31
|
+
testemunhaCereal: {
|
|
32
|
+
ativo: boolean
|
|
33
|
+
nome: string
|
|
34
|
+
cpf: string
|
|
35
|
+
email: string
|
|
36
|
+
tipo: string
|
|
37
|
+
}
|
|
38
|
+
testemunhaFornecedor: {
|
|
39
|
+
ativo: boolean
|
|
40
|
+
nome: string
|
|
41
|
+
cpf: string
|
|
42
|
+
email: string
|
|
43
|
+
tipo: string
|
|
44
|
+
}
|
|
45
|
+
numeroTermo: string
|
|
46
|
+
dataTermo: string
|
|
47
|
+
arquivoPdf: string
|
|
48
|
+
envelopeId?: string
|
|
49
|
+
statusDocuSign?: string
|
|
50
|
+
dataUltimaSincronizacaoDocuSign?: string
|
|
51
|
+
status?: 'PENDENTE' | 'APROVADO' | 'REJEITADO'
|
|
52
|
+
justificativaRejeicao: string | null
|
|
53
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { TRoles } from '@base/@types/models/adm/user'
|
|
2
|
+
|
|
3
|
+
//TODO arrumar os anys
|
|
4
|
+
export type TGeneralFormFields = {
|
|
5
|
+
username: string
|
|
6
|
+
name: string
|
|
7
|
+
email: string
|
|
8
|
+
telefone?: string
|
|
9
|
+
celular?: string
|
|
10
|
+
empresa?: any
|
|
11
|
+
departamento?: any
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type TRolesFormFields = {
|
|
15
|
+
roles?: TRoles[] | undefined
|
|
16
|
+
ativo?: boolean
|
|
17
|
+
primeiroLogin?: boolean
|
|
18
|
+
selecionaDeposito?: boolean
|
|
19
|
+
selecionaCentro?: boolean
|
|
20
|
+
pesagemManual?: boolean
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export enum TipoContrato {
|
|
24
|
+
PRE_CONTRATUAL = 'PRE_CONTRATUAL',
|
|
25
|
+
CONTRATUAL = 'CONTRATUAL',
|
|
26
|
+
CADASTRO = 'CADASTRO'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum TipoAssinante {
|
|
30
|
+
REPRESENTANTE = 'REPRESENTANTE',
|
|
31
|
+
TESTEMUNHA_CEREAL = 'TESTEMUNHA_CEREAL',
|
|
32
|
+
TESTEMUNHA_FORNECEDOR = 'TESTEMUNHA_FORNECEDOR'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export enum UF {
|
|
36
|
+
AC = 'AC',
|
|
37
|
+
AL = 'AL',
|
|
38
|
+
AP = 'AP',
|
|
39
|
+
AM = 'AM',
|
|
40
|
+
BA = 'BA',
|
|
41
|
+
CE = 'CE',
|
|
42
|
+
DF = 'DF',
|
|
43
|
+
ES = 'ES',
|
|
44
|
+
GO = 'GO',
|
|
45
|
+
MA = 'MA',
|
|
46
|
+
MT = 'MT',
|
|
47
|
+
MS = 'MS',
|
|
48
|
+
MG = 'MG',
|
|
49
|
+
PA = 'PA',
|
|
50
|
+
PB = 'PB',
|
|
51
|
+
PR = 'PR',
|
|
52
|
+
PE = 'PE',
|
|
53
|
+
PI = 'PI',
|
|
54
|
+
RJ = 'RJ',
|
|
55
|
+
RN = 'RN',
|
|
56
|
+
RS = 'RS',
|
|
57
|
+
RO = 'RO',
|
|
58
|
+
RR = 'RR',
|
|
59
|
+
SC = 'SC',
|
|
60
|
+
SP = 'SP',
|
|
61
|
+
SE = 'SE',
|
|
62
|
+
TO = 'TO'
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface TMunicipio {
|
|
66
|
+
id: number
|
|
67
|
+
nome: string
|
|
68
|
+
uf: UF
|
|
69
|
+
ativo?: boolean
|
|
70
|
+
codigo?: string
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type TEnderecoFornecedor = {
|
|
74
|
+
id?: number
|
|
75
|
+
ativo: boolean
|
|
76
|
+
bairro: string
|
|
77
|
+
rua: string
|
|
78
|
+
numero: string
|
|
79
|
+
cep: string
|
|
80
|
+
municipioId: number
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type TFornecedor = {
|
|
84
|
+
id?: number
|
|
85
|
+
nome: string
|
|
86
|
+
cpfCnpj: string
|
|
87
|
+
ativo: boolean
|
|
88
|
+
endereco: TEnderecoFornecedor
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type TAssinante = {
|
|
92
|
+
id?: number
|
|
93
|
+
nome: string
|
|
94
|
+
cpf: string
|
|
95
|
+
email: string
|
|
96
|
+
ativo: boolean
|
|
97
|
+
tipo: TipoAssinante
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type TTermoFormSchema = {
|
|
101
|
+
id?: number
|
|
102
|
+
ativo: boolean
|
|
103
|
+
tipoContrato: TipoContrato
|
|
104
|
+
dataCadastro: Date
|
|
105
|
+
usuarioCadastro: string
|
|
106
|
+
fornecedor: TFornecedor
|
|
107
|
+
representante: TAssinante
|
|
108
|
+
numeroTermo: string
|
|
109
|
+
testemunhaCereal: TAssinante
|
|
110
|
+
dataTermo: Date
|
|
111
|
+
testemunhaFornecedor: TAssinante
|
|
112
|
+
}
|
|
@@ -8,6 +8,7 @@ import vinculoIva from "./config/vinculoIva"
|
|
|
8
8
|
import nfeProduto from "./config/nfeProduto"
|
|
9
9
|
import vinculoOperacao from "./config/vinculoOperacao"
|
|
10
10
|
import cfop from "./config/cfop"
|
|
11
|
+
import recepcaoFisica from "./config/recepcaoFisica"
|
|
11
12
|
|
|
12
13
|
const centralNfe = {
|
|
13
14
|
notificacaoCentralNfe,
|
|
@@ -19,7 +20,8 @@ const centralNfe = {
|
|
|
19
20
|
vinculoIva,
|
|
20
21
|
nfeProduto,
|
|
21
22
|
vinculoOperacao,
|
|
22
|
-
cfop
|
|
23
|
+
cfop,
|
|
24
|
+
recepcaoFisica
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export default centralNfe
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const RECEPCAO_FISICA_BASE_URL = '/central-nfe/api/recepcao-fisica'
|
|
2
|
+
|
|
3
|
+
const recepcaoFisica = {
|
|
4
|
+
create: { endpoint: RECEPCAO_FISICA_BASE_URL, httpMethod: 'post' },
|
|
5
|
+
findMonitor: { endpoint: `${RECEPCAO_FISICA_BASE_URL}/find-monitor`, httpMethod: 'post' },
|
|
6
|
+
findOrdensCompra: { endpoint: `${RECEPCAO_FISICA_BASE_URL}/ordens-compra`, httpMethod: 'get' },
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default recepcaoFisica
|