@nomalism-com/api 0.33.83 → 0.34.2
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/.editorconfig +9 -0
- package/.prettierrc +7 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +371 -0
- package/dist/main.js.map +1 -0
- package/dist/modules/document/billOfLading.d.ts +1 -0
- package/dist/modules/document/billOfLading.d.ts.map +1 -0
- package/dist/modules/document/billOfLading.js +12 -0
- package/dist/modules/document/billOfLading.js.map +1 -0
- package/dist/modules/document/inventario.d.ts +1 -0
- package/dist/modules/document/inventario.d.ts.map +1 -0
- package/dist/modules/document/inventario.js +11 -0
- package/dist/modules/document/inventario.js.map +1 -0
- package/dist/modules/document/materialEntrance.d.ts +1 -0
- package/dist/modules/document/materialEntrance.d.ts.map +1 -0
- package/dist/modules/document/materialEntrance.js +51 -0
- package/dist/modules/document/materialEntrance.js.map +1 -0
- package/dist/modules/document/order.d.ts +1 -0
- package/dist/modules/document/order.d.ts.map +1 -0
- package/dist/modules/document/order.js +49 -0
- package/dist/modules/document/order.js.map +1 -0
- package/dist/modules/document/productionOrder.d.ts +1 -0
- package/dist/modules/document/productionOrder.d.ts.map +1 -0
- package/dist/modules/document/productionOrder.js +11 -0
- package/dist/modules/document/productionOrder.js.map +1 -0
- package/dist/modules/document/proforma.d.ts +1 -0
- package/dist/modules/document/proforma.d.ts.map +1 -0
- package/dist/modules/document/proforma.js +12 -0
- package/dist/modules/document/proforma.js.map +1 -0
- package/dist/modules/document/propostaFornecedor.d.ts +1 -0
- package/dist/modules/document/propostaFornecedor.d.ts.map +1 -0
- package/dist/modules/document/propostaFornecedor.js +12 -0
- package/dist/modules/document/propostaFornecedor.js.map +1 -0
- package/dist/modules/document/propostaSheets.d.ts +1 -0
- package/dist/modules/document/propostaSheets.d.ts.map +1 -0
- package/dist/modules/document/propostaSheets.js +51 -0
- package/dist/modules/document/propostaSheets.js.map +1 -0
- package/dist/modules/document/providerCreditNoteFromReturn.d.ts +1 -0
- package/dist/modules/document/providerCreditNoteFromReturn.d.ts.map +1 -0
- package/dist/modules/document/providerCreditNoteFromReturn.js +17 -0
- package/dist/modules/document/providerCreditNoteFromReturn.js.map +1 -0
- package/dist/modules/document/providerFinancialCreditNote.d.ts +1 -0
- package/dist/modules/document/providerFinancialCreditNote.d.ts.map +1 -0
- package/dist/modules/document/providerFinancialCreditNote.js +17 -0
- package/dist/modules/document/providerFinancialCreditNote.js.map +1 -0
- package/dist/modules/document/providerServiceInvoice.d.ts +1 -0
- package/dist/modules/document/providerServiceInvoice.d.ts.map +1 -0
- package/dist/modules/document/providerServiceInvoice.js +11 -0
- package/dist/modules/document/providerServiceInvoice.js.map +1 -0
- package/dist/modules/document/purchase.d.ts +1 -0
- package/dist/modules/document/purchase.d.ts.map +1 -0
- package/dist/modules/document/purchase.js +25 -0
- package/dist/modules/document/purchase.js.map +1 -0
- package/dist/modules/document/quebra.d.ts +1 -0
- package/dist/modules/document/quebra.d.ts.map +1 -0
- package/dist/modules/document/quebra.js +27 -0
- package/dist/modules/document/quebra.js.map +1 -0
- package/dist/modules/document/returnToProvider.d.ts +1 -0
- package/dist/modules/document/returnToProvider.d.ts.map +1 -0
- package/dist/modules/document/returnToProvider.js +21 -0
- package/dist/modules/document/returnToProvider.js.map +1 -0
- package/dist/modules/document/transformado.d.ts +1 -0
- package/dist/modules/document/transformado.d.ts.map +1 -0
- package/dist/modules/document/transformado.js +12 -0
- package/dist/modules/document/transformado.js.map +1 -0
- package/dist/modules/document/upfrontReturn.d.ts +1 -0
- package/dist/modules/document/upfrontReturn.d.ts.map +1 -0
- package/dist/modules/document/upfrontReturn.js +12 -0
- package/dist/modules/document/upfrontReturn.js.map +1 -0
- package/dist/modules/documentManagement/multimedia.d.ts +1 -0
- package/dist/modules/documentManagement/multimedia.d.ts.map +1 -0
- package/dist/modules/documentManagement/multimedia.js +27 -0
- package/dist/modules/documentManagement/multimedia.js.map +1 -0
- package/dist/modules/integration/emailLog.d.ts +1 -0
- package/dist/modules/integration/emailLog.d.ts.map +1 -0
- package/dist/modules/integration/emailLog.js +24 -0
- package/dist/modules/integration/emailLog.js.map +1 -0
- package/dist/modules/integration/emailTemplate.d.ts +1 -0
- package/dist/modules/integration/emailTemplate.d.ts.map +1 -0
- package/dist/modules/integration/emailTemplate.js +27 -0
- package/dist/modules/integration/emailTemplate.js.map +1 -0
- package/dist/modules/integration/emailTemplateAttachment.d.ts +1 -0
- package/dist/modules/integration/emailTemplateAttachment.d.ts.map +1 -0
- package/dist/modules/integration/emailTemplateAttachment.js +15 -0
- package/dist/modules/integration/emailTemplateAttachment.js.map +1 -0
- package/dist/modules/integration/emailVerification.d.ts +1 -0
- package/dist/modules/integration/emailVerification.d.ts.map +1 -0
- package/dist/modules/integration/emailVerification.js +20 -0
- package/dist/modules/integration/emailVerification.js.map +1 -0
- package/dist/modules/integration/googleFilePermission.d.ts +1 -0
- package/dist/modules/integration/googleFilePermission.d.ts.map +1 -0
- package/dist/modules/integration/googleFilePermission.js +24 -0
- package/dist/modules/integration/googleFilePermission.js.map +1 -0
- package/dist/modules/integration/googleSheets.d.ts +1 -0
- package/dist/modules/integration/googleSheets.d.ts.map +1 -0
- package/dist/modules/integration/googleSheets.js +25 -0
- package/dist/modules/integration/googleSheets.js.map +1 -0
- package/dist/modules/integration/observation.d.ts +1 -0
- package/dist/modules/integration/observation.d.ts.map +1 -0
- package/dist/modules/integration/observation.js +30 -0
- package/dist/modules/integration/observation.js.map +1 -0
- package/dist/modules/integration/observationType.d.ts +1 -0
- package/dist/modules/integration/observationType.d.ts.map +1 -0
- package/dist/modules/integration/observationType.js +30 -0
- package/dist/modules/integration/observationType.js.map +1 -0
- package/dist/modules/integration/projectInfo.d.ts +1 -0
- package/dist/modules/integration/projectInfo.d.ts.map +1 -0
- package/dist/modules/integration/projectInfo.js +11 -0
- package/dist/modules/integration/projectInfo.js.map +1 -0
- package/dist/modules/integration/settings.d.ts +1 -0
- package/dist/modules/integration/settings.d.ts.map +1 -0
- package/dist/modules/integration/settings.js +30 -0
- package/dist/modules/integration/settings.js.map +1 -0
- package/dist/modules/print/npc.d.ts +1 -0
- package/dist/modules/print/npc.d.ts.map +1 -0
- package/dist/modules/print/npc.js +20 -0
- package/dist/modules/print/npc.js.map +1 -0
- package/dist/modules/print/printer.d.ts +1 -0
- package/dist/modules/print/printer.d.ts.map +1 -0
- package/dist/modules/print/printer.js +27 -0
- package/dist/modules/print/printer.js.map +1 -0
- package/dist/modules/print/schedulePrintJob.d.ts +1 -0
- package/dist/modules/print/schedulePrintJob.d.ts.map +1 -0
- package/dist/modules/print/schedulePrintJob.js +25 -0
- package/dist/modules/print/schedulePrintJob.js.map +1 -0
- package/dist/modules/stock/chat.d.ts +1 -0
- package/dist/modules/stock/chat.d.ts.map +1 -0
- package/dist/modules/stock/chat.js +33 -0
- package/dist/modules/stock/chat.js.map +1 -0
- package/dist/modules/stock/chatRapidMessage.d.ts +1 -0
- package/dist/modules/stock/chatRapidMessage.d.ts.map +1 -0
- package/dist/modules/stock/chatRapidMessage.js +27 -0
- package/dist/modules/stock/chatRapidMessage.js.map +1 -0
- package/dist/modules/stock/dashboard.d.ts +1 -0
- package/dist/modules/stock/dashboard.d.ts.map +1 -0
- package/dist/modules/stock/dashboard.js +12 -0
- package/dist/modules/stock/dashboard.js.map +1 -0
- package/dist/modules/stock/file.d.ts +1 -0
- package/dist/modules/stock/file.d.ts.map +1 -0
- package/dist/modules/stock/file.js +25 -0
- package/dist/modules/stock/file.js.map +1 -0
- package/dist/modules/stock/location.d.ts +1 -0
- package/dist/modules/stock/location.d.ts.map +1 -0
- package/dist/modules/stock/location.js +44 -0
- package/dist/modules/stock/location.js.map +1 -0
- package/dist/modules/stock/prison.d.ts +1 -0
- package/dist/modules/stock/prison.d.ts.map +1 -0
- package/dist/modules/stock/prison.js +33 -0
- package/dist/modules/stock/prison.js.map +1 -0
- package/dist/modules/stock/productGoogleSheets.d.ts +1 -0
- package/dist/modules/stock/productGoogleSheets.d.ts.map +1 -0
- package/dist/modules/stock/productGoogleSheets.js +109 -0
- package/dist/modules/stock/productGoogleSheets.js.map +1 -0
- package/dist/modules/stock/productImage.d.ts +1 -0
- package/dist/modules/stock/productImage.d.ts.map +1 -0
- package/dist/modules/stock/productImage.js +41 -0
- package/dist/modules/stock/productImage.js.map +1 -0
- package/dist/modules/stock/promotion.d.ts +1 -0
- package/dist/modules/stock/promotion.d.ts.map +1 -0
- package/dist/modules/stock/promotion.js +59 -0
- package/dist/modules/stock/promotion.js.map +1 -0
- package/dist/modules/stock/promotionAssoc.d.ts +1 -0
- package/dist/modules/stock/promotionAssoc.d.ts.map +1 -0
- package/dist/modules/stock/promotionAssoc.js +38 -0
- package/dist/modules/stock/promotionAssoc.js.map +1 -0
- package/dist/modules/stock/queryList.d.ts +1 -0
- package/dist/modules/stock/queryList.d.ts.map +1 -0
- package/dist/modules/stock/queryList.js +50 -0
- package/dist/modules/stock/queryList.js.map +1 -0
- package/dist/modules/stock/queryParameter.d.ts +1 -0
- package/dist/modules/stock/queryParameter.d.ts.map +1 -0
- package/dist/modules/stock/queryParameter.js +34 -0
- package/dist/modules/stock/queryParameter.js.map +1 -0
- package/dist/modules/stock/recurrentTasks.d.ts +1 -0
- package/dist/modules/stock/recurrentTasks.d.ts.map +1 -0
- package/dist/modules/stock/recurrentTasks.js +14 -0
- package/dist/modules/stock/recurrentTasks.js.map +1 -0
- package/dist/modules/stock/returnReason.d.ts +1 -0
- package/dist/modules/stock/returnReason.d.ts.map +1 -0
- package/dist/modules/stock/returnReason.js +24 -0
- package/dist/modules/stock/returnReason.js.map +1 -0
- package/dist/modules/stock/savedEmPicking.d.ts +1 -0
- package/dist/modules/stock/savedEmPicking.d.ts.map +1 -0
- package/dist/modules/stock/savedEmPicking.js +22 -0
- package/dist/modules/stock/savedEmPicking.js.map +1 -0
- package/dist/modules/stock/savedProviderProposal.d.ts +1 -0
- package/dist/modules/stock/savedProviderProposal.d.ts.map +1 -0
- package/dist/modules/stock/savedProviderProposal.js +24 -0
- package/dist/modules/stock/savedProviderProposal.js.map +1 -0
- package/dist/modules/stock/schedule.d.ts +1 -0
- package/dist/modules/stock/schedule.d.ts.map +1 -0
- package/dist/modules/stock/schedule.js +13 -0
- package/dist/modules/stock/schedule.js.map +1 -0
- package/dist/modules/stock/sideMenu.d.ts +1 -0
- package/dist/modules/stock/sideMenu.d.ts.map +1 -0
- package/dist/modules/stock/sideMenu.js +28 -0
- package/dist/modules/stock/sideMenu.js.map +1 -0
- package/dist/modules/stock/stockMovement.d.ts +1 -0
- package/dist/modules/stock/stockMovement.d.ts.map +1 -0
- package/dist/modules/stock/stockMovement.js +37 -0
- package/dist/modules/stock/stockMovement.js.map +1 -0
- package/dist/modules/stock/task.d.ts +1 -0
- package/dist/modules/stock/task.d.ts.map +1 -0
- package/dist/modules/stock/task.js +30 -0
- package/dist/modules/stock/task.js.map +1 -0
- package/dist/modules/stock/taskMessage.d.ts +1 -0
- package/dist/modules/stock/taskMessage.d.ts.map +1 -0
- package/dist/modules/stock/taskMessage.js +18 -0
- package/dist/modules/stock/taskMessage.js.map +1 -0
- package/dist/modules/stock/taskRead.d.ts +1 -0
- package/dist/modules/stock/taskRead.d.ts.map +1 -0
- package/dist/modules/stock/taskRead.js +14 -0
- package/dist/modules/stock/taskRead.js.map +1 -0
- package/dist/modules/stock/typeOfLocation.d.ts +1 -0
- package/dist/modules/stock/typeOfLocation.d.ts.map +1 -0
- package/dist/modules/stock/typeOfLocation.js +44 -0
- package/dist/modules/stock/typeOfLocation.js.map +1 -0
- package/dist/modules/stock/unitOfMeasure.d.ts +1 -0
- package/dist/modules/stock/unitOfMeasure.d.ts.map +1 -0
- package/dist/modules/stock/unitOfMeasure.js +44 -0
- package/dist/modules/stock/unitOfMeasure.js.map +1 -0
- package/dist/modules/stock/vatTax.d.ts +1 -0
- package/dist/modules/stock/vatTax.d.ts.map +1 -0
- package/dist/modules/stock/vatTax.js +44 -0
- package/dist/modules/stock/vatTax.js.map +1 -0
- package/dist/modules/stock/vatTaxZone.d.ts +1 -0
- package/dist/modules/stock/vatTaxZone.d.ts.map +1 -0
- package/dist/modules/stock/vatTaxZone.js +44 -0
- package/dist/modules/stock/vatTaxZone.js.map +1 -0
- package/dist/modules/supply/clientCurrentAccount.d.ts +1 -0
- package/dist/modules/supply/clientCurrentAccount.d.ts.map +1 -0
- package/dist/modules/supply/clientCurrentAccount.js +43 -0
- package/dist/modules/supply/clientCurrentAccount.js.map +1 -0
- package/dist/modules/supply/documentHeader.d.ts +1 -0
- package/dist/modules/supply/documentHeader.d.ts.map +1 -0
- package/dist/modules/supply/documentHeader.js +117 -0
- package/dist/modules/supply/documentHeader.js.map +1 -0
- package/dist/modules/supply/documentLine.d.ts +1 -0
- package/dist/modules/supply/documentLine.d.ts.map +1 -0
- package/dist/modules/supply/documentLine.js +42 -0
- package/dist/modules/supply/documentLine.js.map +1 -0
- package/dist/modules/supply/documentLineAssoc.d.ts +1 -0
- package/dist/modules/supply/documentLineAssoc.d.ts.map +1 -0
- package/dist/modules/supply/documentLineAssoc.js +32 -0
- package/dist/modules/supply/documentLineAssoc.js.map +1 -0
- package/dist/modules/supply/documentLineMt.d.ts +1 -0
- package/dist/modules/supply/documentLineMt.d.ts.map +1 -0
- package/dist/modules/supply/documentLineMt.js +15 -0
- package/dist/modules/supply/documentLineMt.js.map +1 -0
- package/dist/modules/supply/documentLineNote.d.ts +1 -0
- package/dist/modules/supply/documentLineNote.d.ts.map +1 -0
- package/dist/modules/supply/documentLineNote.js +20 -0
- package/dist/modules/supply/documentLineNote.js.map +1 -0
- package/dist/modules/supply/documentLineRm.d.ts +1 -0
- package/dist/modules/supply/documentLineRm.d.ts.map +1 -0
- package/dist/modules/supply/documentLineRm.js +15 -0
- package/dist/modules/supply/documentLineRm.js.map +1 -0
- package/dist/modules/supply/documentSet.d.ts +1 -0
- package/dist/modules/supply/documentSet.d.ts.map +1 -0
- package/dist/modules/supply/documentSet.js +32 -0
- package/dist/modules/supply/documentSet.js.map +1 -0
- package/dist/modules/supply/documentType.d.ts +1 -0
- package/dist/modules/supply/documentType.d.ts.map +1 -0
- package/dist/modules/supply/documentType.js +35 -0
- package/dist/modules/supply/documentType.js.map +1 -0
- package/dist/modules/supply/externalDocumentHeader.d.ts +1 -0
- package/dist/modules/supply/externalDocumentHeader.d.ts.map +1 -0
- package/dist/modules/supply/externalDocumentHeader.js +53 -0
- package/dist/modules/supply/externalDocumentHeader.js.map +1 -0
- package/dist/modules/supply/externalDocumentType.d.ts +1 -0
- package/dist/modules/supply/externalDocumentType.d.ts.map +1 -0
- package/dist/modules/supply/externalDocumentType.js +16 -0
- package/dist/modules/supply/externalDocumentType.js.map +1 -0
- package/dist/modules/supply/orderManagement.d.ts +1 -0
- package/dist/modules/supply/orderManagement.d.ts.map +1 -0
- package/dist/modules/supply/orderManagement.js +18 -0
- package/dist/modules/supply/orderManagement.js.map +1 -0
- package/dist/modules/supply/payment.d.ts +1 -0
- package/dist/modules/supply/payment.d.ts.map +1 -0
- package/dist/modules/supply/payment.js +101 -0
- package/dist/modules/supply/payment.js.map +1 -0
- package/dist/modules/supply/preSale.d.ts +1 -0
- package/dist/modules/supply/preSale.d.ts.map +1 -0
- package/dist/modules/supply/preSale.js +40 -0
- package/dist/modules/supply/preSale.js.map +1 -0
- package/dist/modules/supply/preSaleProduct.d.ts +1 -0
- package/dist/modules/supply/preSaleProduct.d.ts.map +1 -0
- package/dist/modules/supply/preSaleProduct.js +16 -0
- package/dist/modules/supply/preSaleProduct.js.map +1 -0
- package/dist/modules/supply/providerCurrentAccount.d.ts +1 -0
- package/dist/modules/supply/providerCurrentAccount.d.ts.map +1 -0
- package/dist/modules/supply/providerCurrentAccount.js +14 -0
- package/dist/modules/supply/providerCurrentAccount.js.map +1 -0
- package/dist/modules/supply/startDocumentHeaderLastUpdate.d.ts +1 -0
- package/dist/modules/supply/startDocumentHeaderLastUpdate.d.ts.map +1 -0
- package/dist/modules/supply/startDocumentHeaderLastUpdate.js +12 -0
- package/dist/modules/supply/startDocumentHeaderLastUpdate.js.map +1 -0
- package/dist/modules/supply/vatValidation.d.ts +1 -0
- package/dist/modules/supply/vatValidation.d.ts.map +1 -0
- package/dist/modules/supply/vatValidation.js +16 -0
- package/dist/modules/supply/vatValidation.js.map +1 -0
- package/dist/modules/supply/workflow.d.ts +1 -0
- package/dist/modules/supply/workflow.d.ts.map +1 -0
- package/dist/modules/supply/workflow.js +28 -0
- package/dist/modules/supply/workflow.js.map +1 -0
- package/dist/modules/tickets/channel.d.ts +1 -0
- package/dist/modules/tickets/channel.d.ts.map +1 -0
- package/dist/modules/tickets/channel.js +32 -0
- package/dist/modules/tickets/channel.js.map +1 -0
- package/dist/modules/tickets/clt.d.ts +1 -0
- package/dist/modules/tickets/clt.d.ts.map +1 -0
- package/dist/modules/tickets/clt.js +32 -0
- package/dist/modules/tickets/clt.js.map +1 -0
- package/dist/modules/tickets/language.d.ts +1 -0
- package/dist/modules/tickets/language.d.ts.map +1 -0
- package/dist/modules/tickets/language.js +32 -0
- package/dist/modules/tickets/language.js.map +1 -0
- package/dist/modules/tickets/tickets.d.ts +1 -0
- package/dist/modules/tickets/tickets.d.ts.map +1 -0
- package/dist/modules/tickets/tickets.js +24 -0
- package/dist/modules/tickets/tickets.js.map +1 -0
- package/dist/modules/user/bankData.d.ts +1 -0
- package/dist/modules/user/bankData.d.ts.map +1 -0
- package/dist/modules/user/bankData.js +38 -0
- package/dist/modules/user/bankData.js.map +1 -0
- package/dist/modules/user/chatSubscriber.d.ts +1 -0
- package/dist/modules/user/chatSubscriber.d.ts.map +1 -0
- package/dist/modules/user/chatSubscriber.js +27 -0
- package/dist/modules/user/chatSubscriber.js.map +1 -0
- package/dist/modules/user/clientType.d.ts +1 -0
- package/dist/modules/user/clientType.d.ts.map +1 -0
- package/dist/modules/user/clientType.js +38 -0
- package/dist/modules/user/clientType.js.map +1 -0
- package/dist/modules/user/clients.d.ts +1 -0
- package/dist/modules/user/clients.d.ts.map +1 -0
- package/dist/modules/user/clients.js +52 -0
- package/dist/modules/user/clients.js.map +1 -0
- package/dist/modules/user/commissioner.d.ts +1 -0
- package/dist/modules/user/commissioner.d.ts.map +1 -0
- package/dist/modules/user/commissioner.js +44 -0
- package/dist/modules/user/commissioner.js.map +1 -0
- package/dist/modules/user/country.d.ts +1 -0
- package/dist/modules/user/country.d.ts.map +1 -0
- package/dist/modules/user/country.js +44 -0
- package/dist/modules/user/country.js.map +1 -0
- package/dist/modules/user/deliveryMethods.d.ts +1 -0
- package/dist/modules/user/deliveryMethods.d.ts.map +1 -0
- package/dist/modules/user/deliveryMethods.js +34 -0
- package/dist/modules/user/deliveryMethods.js.map +1 -0
- package/dist/modules/user/favorites.d.ts +1 -0
- package/dist/modules/user/favorites.d.ts.map +1 -0
- package/dist/modules/user/favorites.js +24 -0
- package/dist/modules/user/favorites.js.map +1 -0
- package/dist/modules/user/groupPermission.d.ts +1 -0
- package/dist/modules/user/groupPermission.d.ts.map +1 -0
- package/dist/modules/user/groupPermission.js +26 -0
- package/dist/modules/user/groupPermission.js.map +1 -0
- package/dist/modules/user/language.d.ts +1 -0
- package/dist/modules/user/language.d.ts.map +1 -0
- package/dist/modules/user/language.js +38 -0
- package/dist/modules/user/language.js.map +1 -0
- package/dist/modules/user/logout.d.ts +1 -0
- package/dist/modules/user/logout.d.ts.map +1 -0
- package/dist/modules/user/logout.js +11 -0
- package/dist/modules/user/logout.js.map +1 -0
- package/dist/modules/user/maturityDates.d.ts +1 -0
- package/dist/modules/user/maturityDates.d.ts.map +1 -0
- package/dist/modules/user/maturityDates.js +34 -0
- package/dist/modules/user/maturityDates.js.map +1 -0
- package/dist/modules/user/password.d.ts +1 -0
- package/dist/modules/user/password.d.ts.map +1 -0
- package/dist/modules/user/password.js +14 -0
- package/dist/modules/user/password.js.map +1 -0
- package/dist/modules/user/paymentMethods.d.ts +1 -0
- package/dist/modules/user/paymentMethods.d.ts.map +1 -0
- package/dist/modules/user/paymentMethods.js +34 -0
- package/dist/modules/user/paymentMethods.js.map +1 -0
- package/dist/modules/user/permission.d.ts +1 -0
- package/dist/modules/user/permission.d.ts.map +1 -0
- package/dist/modules/user/permission.js +26 -0
- package/dist/modules/user/permission.js.map +1 -0
- package/dist/modules/user/persona.d.ts +1 -0
- package/dist/modules/user/persona.d.ts.map +1 -0
- package/dist/modules/user/persona.js +52 -0
- package/dist/modules/user/persona.js.map +1 -0
- package/dist/modules/user/provider.d.ts +1 -0
- package/dist/modules/user/provider.d.ts.map +1 -0
- package/dist/modules/user/provider.js +54 -0
- package/dist/modules/user/provider.js.map +1 -0
- package/dist/modules/user/providerType.d.ts +1 -0
- package/dist/modules/user/providerType.d.ts.map +1 -0
- package/dist/modules/user/providerType.js +38 -0
- package/dist/modules/user/providerType.js.map +1 -0
- package/dist/modules/user/purchaseCondition.d.ts +1 -0
- package/dist/modules/user/purchaseCondition.d.ts.map +1 -0
- package/dist/modules/user/purchaseCondition.js +38 -0
- package/dist/modules/user/purchaseCondition.js.map +1 -0
- package/dist/modules/user/reasonForExemption.d.ts +1 -0
- package/dist/modules/user/reasonForExemption.d.ts.map +1 -0
- package/dist/modules/user/reasonForExemption.js +38 -0
- package/dist/modules/user/reasonForExemption.js.map +1 -0
- package/dist/modules/user/refreshToken.d.ts +1 -0
- package/dist/modules/user/refreshToken.d.ts.map +1 -0
- package/dist/modules/user/refreshToken.js +12 -0
- package/dist/modules/user/refreshToken.js.map +1 -0
- package/dist/modules/user/segmentsArea.d.ts +1 -0
- package/dist/modules/user/segmentsArea.d.ts.map +1 -0
- package/dist/modules/user/segmentsArea.js +38 -0
- package/dist/modules/user/segmentsArea.js.map +1 -0
- package/dist/modules/user/sessions.d.ts +1 -0
- package/dist/modules/user/sessions.d.ts.map +1 -0
- package/dist/modules/user/sessions.js +12 -0
- package/dist/modules/user/sessions.js.map +1 -0
- package/dist/modules/user/shippings.d.ts +1 -0
- package/dist/modules/user/shippings.d.ts.map +1 -0
- package/dist/modules/user/shippings.js +38 -0
- package/dist/modules/user/shippings.js.map +1 -0
- package/dist/modules/user/storeOperator.d.ts +1 -0
- package/dist/modules/user/storeOperator.d.ts.map +1 -0
- package/dist/modules/user/storeOperator.js +51 -0
- package/dist/modules/user/storeOperator.js.map +1 -0
- package/dist/modules/user/swift.d.ts +1 -0
- package/dist/modules/user/swift.d.ts.map +1 -0
- package/dist/modules/user/swift.js +38 -0
- package/dist/modules/user/swift.js.map +1 -0
- package/dist/modules/user/tenant.d.ts +1 -0
- package/dist/modules/user/tenant.d.ts.map +1 -0
- package/dist/modules/user/tenant.js +24 -0
- package/dist/modules/user/tenant.js.map +1 -0
- package/dist/modules/user/theme.d.ts +1 -0
- package/dist/modules/user/theme.d.ts.map +1 -0
- package/dist/modules/user/theme.js +11 -0
- package/dist/modules/user/theme.js.map +1 -0
- package/dist/modules/user/user.d.ts +1 -0
- package/dist/modules/user/user.d.ts.map +1 -0
- package/dist/modules/user/user.js +46 -0
- package/dist/modules/user/user.js.map +1 -0
- package/dist/modules/user/userPermission.d.ts +1 -0
- package/dist/modules/user/userPermission.d.ts.map +1 -0
- package/dist/modules/user/userPermission.js +22 -0
- package/dist/modules/user/userPermission.js.map +1 -0
- package/dist/modules/user/userPositions.d.ts +1 -0
- package/dist/modules/user/userPositions.d.ts.map +1 -0
- package/dist/modules/user/userPositions.js +38 -0
- package/dist/modules/user/userPositions.js.map +1 -0
- package/dist/modules/user/vehicles.d.ts +1 -0
- package/dist/modules/user/vehicles.d.ts.map +1 -0
- package/dist/modules/user/vehicles.js +24 -0
- package/dist/modules/user/vehicles.js.map +1 -0
- package/dist/modules/user/zipCode.d.ts +1 -0
- package/dist/modules/user/zipCode.d.ts.map +1 -0
- package/dist/modules/user/zipCode.js +15 -0
- package/dist/modules/user/zipCode.js.map +1 -0
- package/dist/modules/view/adminPanel.d.ts +1 -0
- package/dist/modules/view/adminPanel.d.ts.map +1 -0
- package/dist/modules/view/adminPanel.js +12 -0
- package/dist/modules/view/adminPanel.js.map +1 -0
- package/dist/modules/view/errorLog.d.ts +1 -0
- package/dist/modules/view/errorLog.d.ts.map +1 -0
- package/dist/modules/view/errorLog.js +11 -0
- package/dist/modules/view/errorLog.js.map +1 -0
- package/eslint.config.mjs +38 -0
- package/package-lock.json +2606 -0
- package/package.json +19 -18
- package/src/index.ts +3 -0
- package/src/main.ts +791 -0
- package/src/modules/document/billOfLading.ts +24 -0
- package/src/modules/document/inventario.ts +23 -0
- package/src/modules/document/materialEntrance.ts +117 -0
- package/src/modules/document/order.ts +88 -0
- package/src/modules/document/productionOrder.ts +23 -0
- package/src/modules/document/proforma.ts +22 -0
- package/src/modules/document/propostaFornecedor.ts +24 -0
- package/src/modules/document/propostaSheets.ts +102 -0
- package/src/modules/document/providerCreditNoteFromReturn.ts +32 -0
- package/src/modules/document/providerFinancialCreditNote.ts +32 -0
- package/src/modules/document/providerServiceInvoice.ts +23 -0
- package/src/modules/document/purchase.ts +48 -0
- package/src/modules/document/quebra.ts +47 -0
- package/src/modules/document/returnToProvider.ts +43 -0
- package/src/modules/document/transformado.ts +26 -0
- package/src/modules/document/upfrontReturn.ts +24 -0
- package/src/modules/documentManagement/multimedia.ts +41 -0
- package/src/modules/integration/emailLog.ts +47 -0
- package/src/modules/integration/emailTemplate.ts +50 -0
- package/src/modules/integration/emailTemplateAttachment.ts +30 -0
- package/src/modules/integration/emailVerification.ts +34 -0
- package/src/modules/integration/googleFilePermission.ts +40 -0
- package/src/modules/integration/googleSheets.ts +56 -0
- package/src/modules/integration/observation.ts +57 -0
- package/src/modules/integration/observationType.ts +55 -0
- package/src/modules/integration/projectInfo.ts +23 -0
- package/src/modules/integration/settings.ts +49 -0
- package/src/modules/print/npc.ts +43 -0
- package/src/modules/print/printer.ts +52 -0
- package/src/modules/print/schedulePrintJob.ts +45 -0
- package/src/modules/stock/chat.ts +54 -0
- package/src/modules/stock/chatRapidMessage.ts +48 -0
- package/src/modules/stock/dashboard.ts +24 -0
- package/src/modules/stock/file.ts +45 -0
- package/src/modules/stock/location.ts +80 -0
- package/src/modules/stock/prison.ts +61 -0
- package/src/modules/stock/productGoogleSheets.ts +176 -0
- package/src/modules/stock/productImage.ts +78 -0
- package/src/modules/stock/promotion.ts +114 -0
- package/src/modules/stock/promotionAssoc.ts +75 -0
- package/src/modules/stock/queryList.ts +83 -0
- package/src/modules/stock/queryParameter.ts +63 -0
- package/src/modules/stock/recurrentTasks.ts +25 -0
- package/src/modules/stock/returnReason.ts +46 -0
- package/src/modules/stock/savedEmPicking.ts +35 -0
- package/src/modules/stock/savedProviderProposal.ts +44 -0
- package/src/modules/stock/schedule.ts +27 -0
- package/src/modules/stock/sideMenu.ts +49 -0
- package/src/modules/stock/stockMovement.ts +63 -0
- package/src/modules/stock/task.ts +50 -0
- package/src/modules/stock/taskMessage.ts +33 -0
- package/src/modules/stock/taskRead.ts +25 -0
- package/src/modules/stock/typeOfLocation.ts +81 -0
- package/src/modules/stock/unitOfMeasure.ts +81 -0
- package/src/modules/stock/vatTax.ts +81 -0
- package/src/modules/stock/vatTaxZone.ts +83 -0
- package/src/modules/supply/clientCurrentAccount.ts +83 -0
- package/src/modules/supply/documentHeader.ts +221 -0
- package/src/modules/supply/documentLine.ts +87 -0
- package/src/modules/supply/documentLineAssoc.ts +63 -0
- package/src/modules/supply/documentLineMt.ts +28 -0
- package/src/modules/supply/documentLineNote.ts +37 -0
- package/src/modules/supply/documentLineRm.ts +28 -0
- package/src/modules/supply/documentSet.ts +59 -0
- package/src/modules/supply/documentType.ts +74 -0
- package/src/modules/supply/externalDocumentHeader.ts +99 -0
- package/src/modules/supply/externalDocumentType.ts +32 -0
- package/src/modules/supply/orderManagement.ts +35 -0
- package/src/modules/supply/payment.ts +182 -0
- package/src/modules/supply/preSale.ts +86 -0
- package/src/modules/supply/preSaleProduct.ts +29 -0
- package/src/modules/supply/providerCurrentAccount.ts +28 -0
- package/src/modules/supply/startDocumentHeaderLastUpdate.ts +24 -0
- package/src/modules/supply/vatValidation.ts +28 -0
- package/src/modules/supply/workflow.ts +61 -0
- package/src/modules/tickets/channel.ts +55 -0
- package/src/modules/tickets/clt.ts +53 -0
- package/src/modules/tickets/language.ts +53 -0
- package/src/modules/tickets/tickets.ts +49 -0
- package/src/modules/user/bankData.ts +75 -0
- package/src/modules/user/chatSubscriber.ts +53 -0
- package/src/modules/user/clientType.ts +72 -0
- package/src/modules/user/clients.ts +98 -0
- package/src/modules/user/commissioner.ts +85 -0
- package/src/modules/user/country.ts +79 -0
- package/src/modules/user/deliveryMethods.ts +61 -0
- package/src/modules/user/favorites.ts +44 -0
- package/src/modules/user/groupPermission.ts +45 -0
- package/src/modules/user/language.ts +72 -0
- package/src/modules/user/logout.ts +20 -0
- package/src/modules/user/maturityDates.ts +61 -0
- package/src/modules/user/password.ts +29 -0
- package/src/modules/user/paymentMethods.ts +61 -0
- package/src/modules/user/permission.ts +45 -0
- package/src/modules/user/persona.ts +92 -0
- package/src/modules/user/provider.ts +99 -0
- package/src/modules/user/providerType.ts +72 -0
- package/src/modules/user/purchaseCondition.ts +71 -0
- package/src/modules/user/reasonForExemption.ts +72 -0
- package/src/modules/user/refreshToken.ts +25 -0
- package/src/modules/user/segmentsArea.ts +72 -0
- package/src/modules/user/sessions.ts +25 -0
- package/src/modules/user/shippings.ts +71 -0
- package/src/modules/user/storeOperator.ts +99 -0
- package/src/modules/user/swift.ts +71 -0
- package/src/modules/user/tenant.ts +45 -0
- package/src/modules/user/theme.ts +25 -0
- package/src/modules/user/user.ts +93 -0
- package/src/modules/user/userPermission.ts +43 -0
- package/src/modules/user/userPositions.ts +72 -0
- package/src/modules/user/vehicles.ts +46 -0
- package/src/modules/user/zipCode.ts +31 -0
- package/src/modules/view/adminPanel.ts +24 -0
- package/src/modules/view/errorLog.ts +21 -0
- package/tsconfig.json +18 -0
- package/dist/index.min.js +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
|
|
5
|
+
export default class Repository implements Nomalism.Chat.IRepository {
|
|
6
|
+
public route: string;
|
|
7
|
+
|
|
8
|
+
public publicRoute: string;
|
|
9
|
+
|
|
10
|
+
private api: AxiosInstance;
|
|
11
|
+
|
|
12
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
+
this.api = api;
|
|
14
|
+
this.route = route;
|
|
15
|
+
this.publicRoute = publicRoute;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async findActiveByOwnerId(
|
|
19
|
+
params: Nomalism.shared.IFindByOwnerIdRequest,
|
|
20
|
+
): Promise<Nomalism.Chat.IPublicFindActiveByOwnerIdResponse> {
|
|
21
|
+
const response = await this.api.get(`${this.route}active`, {
|
|
22
|
+
params,
|
|
23
|
+
});
|
|
24
|
+
return response.data;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async create(body: Nomalism.Chat.ICreateRequest): Promise<Nomalism.Chat.Entity> {
|
|
28
|
+
const response = await this.api.post(`${this.route}`, body);
|
|
29
|
+
return response.data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async update(
|
|
33
|
+
selector: Nomalism.shared.IFindByIdRequest,
|
|
34
|
+
body: Nomalism.Chat.IUpdateRequest,
|
|
35
|
+
): Promise<void> {
|
|
36
|
+
await this.api.put(`${this.route}${selector.id}`, body);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<void> {
|
|
40
|
+
await this.api.delete(`${this.route}${selector.id}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async resendLast({ owner_id }: Nomalism.shared.IFindByOwnerIdRequest): Promise<void> {
|
|
44
|
+
await this.api.post(`${this.route}resend_last/${owner_id}`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async markAllAsRead(selector: Nomalism.shared.IFindByOwnerIdRequest): Promise<void> {
|
|
48
|
+
await this.api.put(`${this.route}mark_all_as_read/${selector.owner_id}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async markAllAsUnread(selector: Nomalism.shared.IFindByOwnerIdRequest): Promise<void> {
|
|
52
|
+
await this.api.put(`${this.route}mark_all_as_unread/${selector.owner_id}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
|
|
5
|
+
export default class Repository implements Nomalism.ChatRapidMessage.IRepository {
|
|
6
|
+
public route: string;
|
|
7
|
+
|
|
8
|
+
public publicRoute: string;
|
|
9
|
+
|
|
10
|
+
private api: AxiosInstance;
|
|
11
|
+
|
|
12
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
+
this.api = api;
|
|
14
|
+
this.route = route;
|
|
15
|
+
this.publicRoute = publicRoute;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async create(
|
|
19
|
+
data: Nomalism.ChatRapidMessage.ICreateRequest,
|
|
20
|
+
): Promise<Nomalism.ChatRapidMessage.Entity> {
|
|
21
|
+
const response = await this.api.post(`${this.route}`, data);
|
|
22
|
+
return response.data;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async findMinified(): Promise<Nomalism.ChatRapidMessage.IFindMinifiedResponse[]> {
|
|
26
|
+
const response = await this.api.get(`${this.route}`);
|
|
27
|
+
return response.data;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async findById(
|
|
31
|
+
selector: Nomalism.shared.IFindByIdRequest,
|
|
32
|
+
): Promise<Nomalism.ChatRapidMessage.Entity> {
|
|
33
|
+
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
34
|
+
return response.data;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async update(
|
|
38
|
+
selector: Nomalism.shared.IFindByIdRequest,
|
|
39
|
+
data: Nomalism.ChatRapidMessage.IUpdateRequest,
|
|
40
|
+
): Promise<void> {
|
|
41
|
+
const response = await this.api.put(`${this.route}${selector.date}`, data);
|
|
42
|
+
return response.data;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async delete(selector: Nomalism.shared.IFindByIdRequest): Promise<void> {
|
|
46
|
+
await this.api.delete(`${this.route}${selector.id}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
|
|
5
|
+
export default class Repository implements Nomalism.Dashboard.IRepository {
|
|
6
|
+
public route: string;
|
|
7
|
+
|
|
8
|
+
public publicRoute: string;
|
|
9
|
+
|
|
10
|
+
private api: AxiosInstance;
|
|
11
|
+
|
|
12
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
13
|
+
this.api = api;
|
|
14
|
+
this.route = route;
|
|
15
|
+
this.publicRoute = publicRoute;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async findByDate(
|
|
19
|
+
selector: Nomalism.Dashboard.IFindDashboardByDate,
|
|
20
|
+
): Promise<Nomalism.Dashboard.IDashboardResponse> {
|
|
21
|
+
const response = await this.api.get(`${this.route}${selector.date}`);
|
|
22
|
+
return response.data;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
|
|
5
|
+
export import IFindByOwnerIdRequest = Nomalism.File.IFindByOwnerRequest;
|
|
6
|
+
export import IEntity = Nomalism.File.Entity;
|
|
7
|
+
export import ICreateRequest = Nomalism.File.ICreateRequest;
|
|
8
|
+
|
|
9
|
+
export default class Repository implements Nomalism.File.IRepository {
|
|
10
|
+
public route: string;
|
|
11
|
+
|
|
12
|
+
public publicRoute: string;
|
|
13
|
+
|
|
14
|
+
private api: AxiosInstance;
|
|
15
|
+
|
|
16
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
17
|
+
this.api = api;
|
|
18
|
+
this.route = route;
|
|
19
|
+
this.publicRoute = publicRoute;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async findByOwnerId(params: IFindByOwnerIdRequest): Promise<IEntity[]> {
|
|
23
|
+
const response = await this.api.get(`${this.route}by_owner`, {
|
|
24
|
+
params,
|
|
25
|
+
});
|
|
26
|
+
return response.data;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async create(body: ICreateRequest): Promise<IEntity> {
|
|
30
|
+
const response = await this.api.post(`${this.publicRoute}`, body);
|
|
31
|
+
return response.data;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async update(
|
|
35
|
+
{ id }: Nomalism.shared.IFindByIdRequest,
|
|
36
|
+
body: Nomalism.File.IUpdateRequest,
|
|
37
|
+
): Promise<void> {
|
|
38
|
+
await this.api.put(`${this.publicRoute}${id}`, body);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<IEntity | null> {
|
|
42
|
+
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
43
|
+
return response.data;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
|
|
5
|
+
export import IFindRequest = Nomalism.Location.IFindRequest;
|
|
6
|
+
export import IFindResponse = Nomalism.Location.IFindResponse;
|
|
7
|
+
|
|
8
|
+
export import IFindPaginatedRequest = Nomalism.Location.IFindPaginatedRequest;
|
|
9
|
+
|
|
10
|
+
export import IFindMinifiedRequest = Nomalism.shared.IFindMinifiedRequest;
|
|
11
|
+
export import IFindMinifiedResponse = Nomalism.shared.IFindMinifiedResponse;
|
|
12
|
+
|
|
13
|
+
export import IFindByOwnerIdRequest = Nomalism.shared.IFindByOwnerIdRequest;
|
|
14
|
+
|
|
15
|
+
export import ICreateRequest = Nomalism.Location.ICreateRequest;
|
|
16
|
+
|
|
17
|
+
export import IUpdateRequest = Nomalism.Location.IUpdateRequest;
|
|
18
|
+
export type IPaginationResponse =
|
|
19
|
+
Nomalism.shared.IPaginationResponse<Nomalism.Location.IFindResponse>;
|
|
20
|
+
|
|
21
|
+
export default class Repository implements Nomalism.Location.IRepository {
|
|
22
|
+
public route: string;
|
|
23
|
+
|
|
24
|
+
public publicRoute: string;
|
|
25
|
+
|
|
26
|
+
private api: AxiosInstance;
|
|
27
|
+
|
|
28
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
29
|
+
this.api = api;
|
|
30
|
+
this.route = route;
|
|
31
|
+
this.publicRoute = publicRoute;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async find(params: IFindRequest): Promise<IFindResponse[]> {
|
|
35
|
+
const response = await this.api.get(`${this.route}`, { params });
|
|
36
|
+
return response.data;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async findPaginated(params: IFindPaginatedRequest): Promise<IPaginationResponse> {
|
|
40
|
+
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
41
|
+
return response.data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async findMinified(params?: IFindMinifiedRequest): Promise<IFindMinifiedResponse[]> {
|
|
45
|
+
const response = await this.api.get(`${this.route}minified`, {
|
|
46
|
+
params,
|
|
47
|
+
});
|
|
48
|
+
return response.data;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async findByOwnerId(params: IFindByOwnerIdRequest): Promise<IFindResponse[]> {
|
|
52
|
+
const response = await this.api.get(`${this.route}by_owner`, {
|
|
53
|
+
params,
|
|
54
|
+
});
|
|
55
|
+
return response.data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async findById(selector: Nomalism.shared.IFindByIdRequest): Promise<IFindResponse | null> {
|
|
59
|
+
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
60
|
+
return response.data;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async create(body: ICreateRequest): Promise<IFindResponse> {
|
|
64
|
+
const response = await this.api.post(`${this.route}`, body);
|
|
65
|
+
return response.data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async update(
|
|
69
|
+
selector: Nomalism.shared.IFindByIdRequest,
|
|
70
|
+
body: IUpdateRequest,
|
|
71
|
+
): Promise<IFindResponse | null> {
|
|
72
|
+
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
73
|
+
return response.data;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<IFindResponse | null> {
|
|
77
|
+
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
78
|
+
return response.data;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
|
|
5
|
+
export import IFindByOwnerIdRequest = Nomalism.shared.IFindByOwnerIdRequest;
|
|
6
|
+
|
|
7
|
+
export import IFindByIdRequest = Nomalism.shared.IFindByIdRequest;
|
|
8
|
+
|
|
9
|
+
export import IFindLinesInPrisonResponse = Nomalism.Prison.IFindLinesInPrisonResponse;
|
|
10
|
+
|
|
11
|
+
export import ICheckLineInPrisonOptions = Nomalism.Prison.ICheckLineInPrisonOptions;
|
|
12
|
+
|
|
13
|
+
export import ICheckLinesInPrisonLinesRequest = Nomalism.Prison.ICheckLinesInPrisonLinesRequest;
|
|
14
|
+
export import ICheckLinesInPrisonRequest = Nomalism.Prison.ICheckLinesInPrisonRequest;
|
|
15
|
+
|
|
16
|
+
export import ICreateLinesInPrisonRequest = Nomalism.Prison.ICreateLinesInPrisonRequest;
|
|
17
|
+
|
|
18
|
+
export const { checkLineInPrisonOptions } = Nomalism.Prison;
|
|
19
|
+
|
|
20
|
+
export default class Repository implements Nomalism.Prison.IApi {
|
|
21
|
+
public route: string;
|
|
22
|
+
|
|
23
|
+
public publicRoute: string;
|
|
24
|
+
|
|
25
|
+
private api: AxiosInstance;
|
|
26
|
+
|
|
27
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
28
|
+
this.api = api;
|
|
29
|
+
this.route = route;
|
|
30
|
+
this.publicRoute = publicRoute;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async putLineInPrison(data: IFindByIdRequest): Promise<void> {
|
|
34
|
+
const response = await this.api.post(`${this.route}put_in_prison`, data);
|
|
35
|
+
return response.data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async removeLineFromPrison(data: IFindByIdRequest): Promise<void> {
|
|
39
|
+
const response = await this.api.post(`${this.route}remove_from_prison`, data);
|
|
40
|
+
return response.data;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async findLinesInPrison(): Promise<IFindLinesInPrisonResponse[]> {
|
|
44
|
+
const response = await this.api.get(`${this.route}in_prison`, {});
|
|
45
|
+
return response.data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async findLinesInPrisonProviders(): Promise<Nomalism.shared.IFindMinifiedResponse[]> {
|
|
49
|
+
const response = await this.api.get(`${this.route}in_prison_providers`, {});
|
|
50
|
+
return response.data;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async checkLinesInPrison(data: ICheckLinesInPrisonRequest): Promise<void> {
|
|
54
|
+
await this.api.post(`${this.route}check_in_prison`, data);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async createLinesInPrison(data: ICreateLinesInPrisonRequest): Promise<string[]> {
|
|
58
|
+
const response = await this.api.post(`${this.route}create_lines`, data);
|
|
59
|
+
return response.data;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
import { IProductLocation } from '@nomalism-com/types/dist/modules/stock/productGoogleSheets/interface';
|
|
5
|
+
|
|
6
|
+
export default class Repository implements Nomalism.ProductGoogleSheets.IRepository {
|
|
7
|
+
public route: string;
|
|
8
|
+
|
|
9
|
+
public publicRoute: string;
|
|
10
|
+
|
|
11
|
+
private api: AxiosInstance;
|
|
12
|
+
|
|
13
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
14
|
+
this.api = api;
|
|
15
|
+
this.route = route;
|
|
16
|
+
this.publicRoute = publicRoute;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async basicSearch(
|
|
20
|
+
params: Nomalism.ProductGoogleSheets.IBasicSearchRequest,
|
|
21
|
+
): Promise<
|
|
22
|
+
Nomalism.shared.IPaginationResponse<Nomalism.ProductGoogleSheets.IBasicSearchResponse>
|
|
23
|
+
> {
|
|
24
|
+
const response = await this.api.get(`${this.route}basic_search`, {
|
|
25
|
+
params,
|
|
26
|
+
});
|
|
27
|
+
return response.data;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async findReferenceAndIdForMobile(
|
|
31
|
+
params: Nomalism.ProductGoogleSheets.IFindForMobileRequest,
|
|
32
|
+
): Promise<Nomalism.ProductGoogleSheets.IFindReferenceAndIdForMobileResponse | null> {
|
|
33
|
+
const response = await this.api.get(`${this.route}reference_and_id_mobile`, {
|
|
34
|
+
params,
|
|
35
|
+
});
|
|
36
|
+
return response.data;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async findDataForMobile(
|
|
40
|
+
params: Nomalism.shared.IFindByIdRequest,
|
|
41
|
+
): Promise<Nomalism.ProductGoogleSheets.IFindDataForMobileResponse | null> {
|
|
42
|
+
const response = await this.api.get(`${this.route}data_mobile/${params.id}`);
|
|
43
|
+
return response.data;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async findStockForMobile(
|
|
47
|
+
params: Nomalism.shared.IFindByIdRequest,
|
|
48
|
+
): Promise<Nomalism.ProductGoogleSheets.IFindStockForMobileResponse | null> {
|
|
49
|
+
const response = await this.api.get(`${this.route}stock_mobile/${params.id}`);
|
|
50
|
+
return response.data;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async findPreArtigo(
|
|
54
|
+
params: Nomalism.ProductGoogleSheets.IFindProductSheetByReference,
|
|
55
|
+
): Promise<Nomalism.ProductGoogleSheets.IProductSheetCabideEntity | null> {
|
|
56
|
+
const response = await this.api.get(`${this.route}pre_artigo`, {
|
|
57
|
+
params,
|
|
58
|
+
});
|
|
59
|
+
return response.data;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async updatePricesFromPreArtigo(): Promise<void> {
|
|
63
|
+
await this.api.get(`${this.route}update_prices_from_pre_artigo`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async validateByRef(
|
|
67
|
+
params: Nomalism.ProductGoogleSheets.IValidateByReferenceRequest,
|
|
68
|
+
): Promise<Nomalism.ProductGoogleSheets.IEntityMinified | null> {
|
|
69
|
+
const response = await this.api.get(`${this.route}validate_by_ref`, {
|
|
70
|
+
params,
|
|
71
|
+
});
|
|
72
|
+
return response.data;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async findSimilarProductsByName(
|
|
76
|
+
params: Nomalism.ProductGoogleSheets.IFindSimilarProductsByNameRequest,
|
|
77
|
+
): Promise<Nomalism.ProductGoogleSheets.IFindSimilarProductsByNameResponse[]> {
|
|
78
|
+
const response = await this.api.get(`${this.route}similar_products`, {
|
|
79
|
+
params,
|
|
80
|
+
});
|
|
81
|
+
return response.data;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async findByProductType(
|
|
85
|
+
params: Nomalism.ProductGoogleSheets.IFindByProductTypeRequest,
|
|
86
|
+
): Promise<Nomalism.ProductGoogleSheets.IFindByProductTypeResponse[]> {
|
|
87
|
+
const response = await this.api.get(`${this.route}by_product_type`, {
|
|
88
|
+
params,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return response.data;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async findById({
|
|
95
|
+
id,
|
|
96
|
+
}: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.ProductGoogleSheets.IProductSheetEntity> {
|
|
97
|
+
const response = await this.api.get(`${this.route}${id}`);
|
|
98
|
+
return response.data;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async findByIdWithStock({
|
|
102
|
+
id,
|
|
103
|
+
}: Nomalism.shared.IFindByIdRequest): Promise<Nomalism.ProductGoogleSheets.IProductVirtuals> {
|
|
104
|
+
const response = await this.api.get(`${this.route}${id}/with_stock`);
|
|
105
|
+
return response.data;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async updateGoogleSheetsLinesProduct(body: Nomalism.shared.IFindByIdRequest[]): Promise<void> {
|
|
109
|
+
const response = await this.api.put(`${this.route}update_google_sheets_lines_product`, body);
|
|
110
|
+
return response.data;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async googleSheetsFieldsByRef(
|
|
114
|
+
params: Nomalism.ProductGoogleSheets.IFindByReferenceRequest,
|
|
115
|
+
): Promise<string> {
|
|
116
|
+
const response = await this.api.get(
|
|
117
|
+
`${this.route}google_sheets_fields_by_ref/${params.reference}`,
|
|
118
|
+
);
|
|
119
|
+
return response.data;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async findRowPositionOnSheetsWithColumns(
|
|
123
|
+
params: Nomalism.ProductGoogleSheets.IFindProductSheetByReference,
|
|
124
|
+
): Promise<string> {
|
|
125
|
+
const response = await this.api.get(`${this.route}sheet_row_and_columns/${params.selector}`);
|
|
126
|
+
return response.data;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async checkStockByIds(
|
|
130
|
+
data: Nomalism.ProductGoogleSheets.ICheckStockByIdsRequest,
|
|
131
|
+
): Promise<Nomalism.ProductGoogleSheets.ICheckStockByIdsResponse[]> {
|
|
132
|
+
const response = await this.api.post(`${this.route}check_stock_by_ids`, data);
|
|
133
|
+
return response.data;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async create(body: Nomalism.ProductGoogleSheets.ICreateRequest): Promise<string> {
|
|
137
|
+
const response = await this.api.post(`${this.route}`, body);
|
|
138
|
+
return response.data;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async update(
|
|
142
|
+
{ id }: Nomalism.shared.IFindByIdRequest,
|
|
143
|
+
body: Nomalism.ProductGoogleSheets.IUpdateRequest,
|
|
144
|
+
): Promise<void> {
|
|
145
|
+
await this.api.put(`${this.route}${id}`, body);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<void> {
|
|
149
|
+
await this.api.delete(`${this.route}${selector.id}`);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
printLabelToPdfUrl({ id }: Nomalism.shared.IFindByIdRequest, token: string): string {
|
|
153
|
+
const qs = new URLSearchParams();
|
|
154
|
+
qs.set('token', token);
|
|
155
|
+
return `${this.publicRoute}print_label_pdf/${id}?${qs.toString()}`;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
printLabelToPdfBulk(ids: string[], token: string): string {
|
|
159
|
+
const qs = new URLSearchParams();
|
|
160
|
+
qs.set('token', token);
|
|
161
|
+
qs.set('ids', ids.join(','));
|
|
162
|
+
return `${this.publicRoute}print_label_pdf/bulk?${qs.toString()}`;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async updateDbFromSheets(): Promise<void> {
|
|
166
|
+
await this.api.post(`${this.route}update_db_from_sheets`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async partialLocation(body: IProductLocation): Promise<void> {
|
|
170
|
+
await this.api.post(`${this.route}partial_location`, body);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async fullLocation(body: IProductLocation): Promise<void> {
|
|
174
|
+
await this.api.post(`${this.route}full_location`, body);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
|
|
5
|
+
export import IEntity = Nomalism.ProductImage.Entity;
|
|
6
|
+
|
|
7
|
+
export import ImageTypeEnum = Nomalism.ProductImage.ImageTypeEnum;
|
|
8
|
+
|
|
9
|
+
export import IImageType = Nomalism.ProductImage.IImageType;
|
|
10
|
+
|
|
11
|
+
export import imageTypes = Nomalism.ProductImage.imageTypes;
|
|
12
|
+
|
|
13
|
+
export import IFindRequest = Nomalism.ProductImage.IFindRequest;
|
|
14
|
+
export import IFindResponse = Nomalism.ProductImage.IFindResponse;
|
|
15
|
+
|
|
16
|
+
export import IFindPaginatedRequest = Nomalism.ProductImage.IFindPaginatedRequest;
|
|
17
|
+
|
|
18
|
+
export import IFindByOwnerIdRequest = Nomalism.shared.IFindByOwnerIdRequest;
|
|
19
|
+
|
|
20
|
+
export import ICreateRequest = Nomalism.ProductImage.ICreateRequest;
|
|
21
|
+
|
|
22
|
+
export import IUpdateRequest = Nomalism.ProductImage.IUpdateRequest;
|
|
23
|
+
export type IPaginationResponse =
|
|
24
|
+
Nomalism.shared.IPaginationResponse<Nomalism.ProductImage.IFindResponse>;
|
|
25
|
+
|
|
26
|
+
export default class Repository implements Nomalism.ProductImage.IRepository {
|
|
27
|
+
public route: string;
|
|
28
|
+
|
|
29
|
+
public publicRoute: string;
|
|
30
|
+
|
|
31
|
+
private api: AxiosInstance;
|
|
32
|
+
|
|
33
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
34
|
+
this.api = api;
|
|
35
|
+
this.route = route;
|
|
36
|
+
this.publicRoute = publicRoute;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async find(params: IFindRequest): Promise<IFindResponse[]> {
|
|
40
|
+
const response = await this.api.get(`${this.route}`, { params });
|
|
41
|
+
return response.data;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async findPaginated(params: IFindPaginatedRequest): Promise<IPaginationResponse> {
|
|
45
|
+
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
46
|
+
return response.data;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async findByOwnerId(params: IFindByOwnerIdRequest): Promise<IFindResponse[]> {
|
|
50
|
+
const response = await this.api.get(`${this.route}by_owner`, {
|
|
51
|
+
params,
|
|
52
|
+
});
|
|
53
|
+
return response.data;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async findById(selector: Nomalism.shared.IFindByIdRequest): Promise<IFindResponse | null> {
|
|
57
|
+
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
58
|
+
return response.data;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async create(body: ICreateRequest): Promise<IEntity> {
|
|
62
|
+
const response = await this.api.post(`${this.route}`, body);
|
|
63
|
+
return response.data;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async update(
|
|
67
|
+
selector: Nomalism.shared.IFindByIdRequest,
|
|
68
|
+
body: IUpdateRequest,
|
|
69
|
+
): Promise<IEntity | null> {
|
|
70
|
+
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
71
|
+
return response.data;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<IEntity | null> {
|
|
75
|
+
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
76
|
+
return response.data;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import Nomalism from '@nomalism-com/types';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
import { IModuleConstructor } from '../../main';
|
|
4
|
+
|
|
5
|
+
export import IFindRequest = Nomalism.Promotion.IFindRequest;
|
|
6
|
+
export import IFindResponse = Nomalism.Promotion.IFindResponse;
|
|
7
|
+
|
|
8
|
+
export import IFindPaginatedRequest = Nomalism.Promotion.IFindPaginatedRequest;
|
|
9
|
+
|
|
10
|
+
export import IFindByOwnerIdRequest = Nomalism.shared.IFindByOwnerIdRequest;
|
|
11
|
+
|
|
12
|
+
export import IFindMinifiedRequest = Nomalism.shared.IFindMinifiedRequest;
|
|
13
|
+
export import IFindMinifiedResponse = Nomalism.shared.IFindMinifiedResponse;
|
|
14
|
+
|
|
15
|
+
export import ICreateRequest = Nomalism.Promotion.ICreateRequest;
|
|
16
|
+
export import IEntity = Nomalism.Promotion.Entity;
|
|
17
|
+
|
|
18
|
+
export import IUpdateRequest = Nomalism.Promotion.IUpdateRequest;
|
|
19
|
+
export type IPaginationResponse =
|
|
20
|
+
Nomalism.shared.IPaginationResponse<Nomalism.Promotion.IFindResponse>;
|
|
21
|
+
|
|
22
|
+
export default class Repository implements Nomalism.Promotion.IRepository {
|
|
23
|
+
public route: string;
|
|
24
|
+
|
|
25
|
+
public publicRoute: string;
|
|
26
|
+
|
|
27
|
+
private api: AxiosInstance;
|
|
28
|
+
|
|
29
|
+
constructor({ api, route, publicRoute }: IModuleConstructor) {
|
|
30
|
+
this.api = api;
|
|
31
|
+
this.route = route;
|
|
32
|
+
this.publicRoute = publicRoute;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async find(params: IFindRequest): Promise<IFindResponse[]> {
|
|
36
|
+
const response = await this.api.get(`${this.route}`, { params });
|
|
37
|
+
return response.data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async findPaginated(params: IFindPaginatedRequest): Promise<IPaginationResponse> {
|
|
41
|
+
const response = await this.api.get(`${this.route}paginated`, { params });
|
|
42
|
+
return response.data;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async findMinified(params?: IFindMinifiedRequest): Promise<IFindMinifiedResponse[]> {
|
|
46
|
+
const response = await this.api.get(`${this.route}minified`, {
|
|
47
|
+
params,
|
|
48
|
+
});
|
|
49
|
+
return response.data;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async findByOwnerId(params: IFindByOwnerIdRequest): Promise<Nomalism.Promotion.IFindResponse[]> {
|
|
53
|
+
const response = await this.api.get(`${this.route}by_owner`, {
|
|
54
|
+
params,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return response.data;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async findById(selector: Nomalism.shared.IFindByIdRequest): Promise<IFindResponse | null> {
|
|
61
|
+
const response = await this.api.get(`${this.route}${selector.id}`);
|
|
62
|
+
return response.data;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async create(body: ICreateRequest): Promise<IEntity> {
|
|
66
|
+
const response = await this.api.post(`${this.route}`, body);
|
|
67
|
+
return response.data;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async update(
|
|
71
|
+
selector: Nomalism.shared.IFindByIdRequest,
|
|
72
|
+
body: IUpdateRequest,
|
|
73
|
+
): Promise<IEntity | null> {
|
|
74
|
+
const response = await this.api.put(`${this.route}${selector.id}`, body);
|
|
75
|
+
return response.data;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async deleteOne(selector: Nomalism.shared.IFindByIdRequest): Promise<IEntity | null> {
|
|
79
|
+
const response = await this.api.delete(`${this.route}${selector.id}`);
|
|
80
|
+
return response.data;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getBestDiscount(
|
|
84
|
+
promotions: Pick<
|
|
85
|
+
Nomalism.ProductGoogleSheets.IProductPromotionVirtuals,
|
|
86
|
+
'exclusive_to_location_id' | 'exclusive_to_client_id' | 'discount'
|
|
87
|
+
>[],
|
|
88
|
+
discount?: number,
|
|
89
|
+
location_id?: string,
|
|
90
|
+
client_id?: string,
|
|
91
|
+
product_no_discount?: boolean,
|
|
92
|
+
) {
|
|
93
|
+
const highestPromoDiscount = promotions
|
|
94
|
+
.filter((promotion) => {
|
|
95
|
+
const locationEligible = promotion.exclusive_to_location_id
|
|
96
|
+
? promotion.exclusive_to_location_id === location_id
|
|
97
|
+
: true;
|
|
98
|
+
|
|
99
|
+
const clientEligible = promotion.exclusive_to_client_id
|
|
100
|
+
? promotion.exclusive_to_client_id === client_id
|
|
101
|
+
: true;
|
|
102
|
+
|
|
103
|
+
return locationEligible && clientEligible;
|
|
104
|
+
})
|
|
105
|
+
.reduce(
|
|
106
|
+
(highest, promotion) => (promotion.discount > highest ? promotion.discount : highest),
|
|
107
|
+
0,
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const clientDiscount = product_no_discount ? 0 : discount || 0;
|
|
111
|
+
|
|
112
|
+
return highestPromoDiscount > clientDiscount ? highestPromoDiscount : clientDiscount;
|
|
113
|
+
}
|
|
114
|
+
}
|