├── .env.example ├── .eslintrc.json ├── .github └── workflows │ └── lint.yml ├── .gitignore ├── .prettierrc ├── LICENSE ├── README.md ├── jest.config.ts ├── knexfile.ts ├── package.json ├── src ├── app │ ├── api │ │ ├── controllers │ │ │ ├── MercadoPagoIntegrationController.ts │ │ │ └── OrderController.ts │ │ ├── index.ts │ │ ├── middlewares │ │ │ └── VerifyToken.ts │ │ └── routes │ │ │ └── index.ts │ ├── bot │ │ ├── cache │ │ │ └── OrderHandlerCache.ts │ │ ├── index.ts │ │ ├── interfaces │ │ │ ├── IQrCodeCache.ts │ │ │ ├── Order.ts │ │ │ └── QrCodeRequest.ts │ │ ├── messages │ │ │ ├── AnyMessageHandler.ts │ │ │ ├── ConfirmDataStatusHandler.ts │ │ │ ├── CreatedOrderStatusHandler.ts │ │ │ ├── DeliveryOrderStatusHandler.ts │ │ │ ├── OrderAddressHandler.ts │ │ │ ├── OrderDeliveryDataHandler.ts │ │ │ ├── OrderFinishedStatusHandler.ts │ │ │ ├── OrderMessageHandler.ts │ │ │ ├── OrderPaymentHandler.ts │ │ │ ├── OrderPaymentRequired.ts │ │ │ ├── OrderProductionStatusHandler.ts │ │ │ ├── OrderTaxaDeliveryHandler.ts │ │ │ ├── RetiradaOrderStatusHandler.ts │ │ │ └── commands │ │ │ │ ├── AboutBotCommandHandler.ts │ │ │ │ ├── CancelOrderCommandHandler.ts │ │ │ │ ├── CarTutorialCommandHandler.ts │ │ │ │ ├── ChangeStatusOrderCommandHandler.ts │ │ │ │ ├── CreatePaymentPixCommand.ts │ │ │ │ ├── DoneAtendimentoHandler.ts │ │ │ │ ├── DoubtCommandHandler.ts │ │ │ │ ├── FinishOrderCommandHandler.ts │ │ │ │ ├── HelpCommandHandler.ts │ │ │ │ ├── InfoOrderCommandHandler.ts │ │ │ │ ├── LoadOrdersFromDbToGroup.ts │ │ │ │ ├── ReportOrdersCommandHandler.ts │ │ │ │ ├── UpdateOrderStatusCommand.ts │ │ │ │ ├── UpdatePaymentStatusCommand.ts │ │ │ │ └── video4985596413699162693.mp4 │ │ └── utils │ │ │ ├── HelperCommands.ts │ │ │ ├── HelperCurrency.ts │ │ │ ├── HelperOrderProduction.ts │ │ │ ├── HelperPaymentPix.ts │ │ │ ├── HelperStr.ts │ │ │ ├── Message.ts │ │ │ ├── MessageDispatcher.ts │ │ │ └── ReturnsMessages.ts │ └── usecases │ │ ├── query-orders.ts │ │ ├── save-order.ts │ │ └── update-order.ts ├── database │ ├── connection.ts │ └── migrations │ │ └── 20220402190921_create_order.ts ├── index.ts └── services │ ├── MercadoPago.ts │ ├── redis.ts │ └── whatsapp.ts ├── tests ├── CreateOrder.spec.ts ├── CreateOrdersReport.spec.ts ├── OrderQueries.spec.ts ├── PaymentPixToOrder.spec.ts └── factories │ └── MessageOrderFactory.ts └── tsconfig.json /.env.example: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/.env.example -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/.eslintrc.json -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/.github/workflows/lint.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | notes.txt 3 | WWebJS 4 | .wwebjs_auth 5 | .env 6 | build/ -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/.prettierrc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/README.md -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/jest.config.ts -------------------------------------------------------------------------------- /knexfile.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/knexfile.ts -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/package.json -------------------------------------------------------------------------------- /src/app/api/controllers/MercadoPagoIntegrationController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/api/controllers/MercadoPagoIntegrationController.ts -------------------------------------------------------------------------------- /src/app/api/controllers/OrderController.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/api/controllers/OrderController.ts -------------------------------------------------------------------------------- /src/app/api/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/api/index.ts -------------------------------------------------------------------------------- /src/app/api/middlewares/VerifyToken.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/api/middlewares/VerifyToken.ts -------------------------------------------------------------------------------- /src/app/api/routes/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/api/routes/index.ts -------------------------------------------------------------------------------- /src/app/bot/cache/OrderHandlerCache.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/cache/OrderHandlerCache.ts -------------------------------------------------------------------------------- /src/app/bot/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/index.ts -------------------------------------------------------------------------------- /src/app/bot/interfaces/IQrCodeCache.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/interfaces/IQrCodeCache.ts -------------------------------------------------------------------------------- /src/app/bot/interfaces/Order.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/interfaces/Order.ts -------------------------------------------------------------------------------- /src/app/bot/interfaces/QrCodeRequest.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/interfaces/QrCodeRequest.ts -------------------------------------------------------------------------------- /src/app/bot/messages/AnyMessageHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/AnyMessageHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/ConfirmDataStatusHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/ConfirmDataStatusHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/CreatedOrderStatusHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/CreatedOrderStatusHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/DeliveryOrderStatusHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/DeliveryOrderStatusHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/OrderAddressHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/OrderAddressHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/OrderDeliveryDataHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/OrderDeliveryDataHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/OrderFinishedStatusHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/OrderFinishedStatusHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/OrderMessageHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/OrderMessageHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/OrderPaymentHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/OrderPaymentHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/OrderPaymentRequired.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/OrderPaymentRequired.ts -------------------------------------------------------------------------------- /src/app/bot/messages/OrderProductionStatusHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/OrderProductionStatusHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/OrderTaxaDeliveryHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/OrderTaxaDeliveryHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/RetiradaOrderStatusHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/RetiradaOrderStatusHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/AboutBotCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/AboutBotCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/CancelOrderCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/CancelOrderCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/CarTutorialCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/CarTutorialCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/ChangeStatusOrderCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/ChangeStatusOrderCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/CreatePaymentPixCommand.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/CreatePaymentPixCommand.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/DoneAtendimentoHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/DoneAtendimentoHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/DoubtCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/DoubtCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/FinishOrderCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/FinishOrderCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/HelpCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/HelpCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/InfoOrderCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/InfoOrderCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/LoadOrdersFromDbToGroup.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/LoadOrdersFromDbToGroup.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/ReportOrdersCommandHandler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/ReportOrdersCommandHandler.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/UpdateOrderStatusCommand.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/UpdateOrderStatusCommand.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/UpdatePaymentStatusCommand.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/UpdatePaymentStatusCommand.ts -------------------------------------------------------------------------------- /src/app/bot/messages/commands/video4985596413699162693.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/messages/commands/video4985596413699162693.mp4 -------------------------------------------------------------------------------- /src/app/bot/utils/HelperCommands.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/utils/HelperCommands.ts -------------------------------------------------------------------------------- /src/app/bot/utils/HelperCurrency.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/utils/HelperCurrency.ts -------------------------------------------------------------------------------- /src/app/bot/utils/HelperOrderProduction.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/utils/HelperOrderProduction.ts -------------------------------------------------------------------------------- /src/app/bot/utils/HelperPaymentPix.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/utils/HelperPaymentPix.ts -------------------------------------------------------------------------------- /src/app/bot/utils/HelperStr.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/utils/HelperStr.ts -------------------------------------------------------------------------------- /src/app/bot/utils/Message.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/utils/Message.ts -------------------------------------------------------------------------------- /src/app/bot/utils/MessageDispatcher.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/utils/MessageDispatcher.ts -------------------------------------------------------------------------------- /src/app/bot/utils/ReturnsMessages.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/bot/utils/ReturnsMessages.ts -------------------------------------------------------------------------------- /src/app/usecases/query-orders.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/usecases/query-orders.ts -------------------------------------------------------------------------------- /src/app/usecases/save-order.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/usecases/save-order.ts -------------------------------------------------------------------------------- /src/app/usecases/update-order.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/app/usecases/update-order.ts -------------------------------------------------------------------------------- /src/database/connection.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/database/connection.ts -------------------------------------------------------------------------------- /src/database/migrations/20220402190921_create_order.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/database/migrations/20220402190921_create_order.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/services/MercadoPago.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/services/MercadoPago.ts -------------------------------------------------------------------------------- /src/services/redis.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/services/redis.ts -------------------------------------------------------------------------------- /src/services/whatsapp.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/src/services/whatsapp.ts -------------------------------------------------------------------------------- /tests/CreateOrder.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/tests/CreateOrder.spec.ts -------------------------------------------------------------------------------- /tests/CreateOrdersReport.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/tests/CreateOrdersReport.spec.ts -------------------------------------------------------------------------------- /tests/OrderQueries.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/tests/OrderQueries.spec.ts -------------------------------------------------------------------------------- /tests/PaymentPixToOrder.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/tests/PaymentPixToOrder.spec.ts -------------------------------------------------------------------------------- /tests/factories/MessageOrderFactory.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/tests/factories/MessageOrderFactory.ts -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eduardoc7/bubblebot/HEAD/tsconfig.json --------------------------------------------------------------------------------