Commit Graph

302 Commits

Author SHA1 Message Date
gpt-engineer-app[bot]
f719a4cb1e Fix: Ensure n8n workflow creation on signup
Ensured the n8n workflow creation process is correctly triggered after user registration, including correct API request details, dynamic data replacement, and saving workflow information.
2025-06-19 10:01:57 +00:00
gpt-engineer-app[bot]
176fe2c9f9 Fix: Ensure n8n workflow creation on signup
The n8n workflow creation was not triggered after user registration. This commit ensures the POST request to the n8n API is correctly configured to execute after a new user signs up.
2025-06-19 09:54:50 +00:00
gpt-engineer-app[bot]
a930b755eb Add webhook creation on WhatsApp connect
Implement POST request to Evolution API to create a webhook after successful WhatsApp QR code connection, including correct endpoint, headers, and body formatting. Log request status.
2025-06-19 09:48:06 +00:00
gpt-engineer-app[bot]
c7292ee600 Fix: Apply n8n workflow modifications
Verified the pasted JSON and applied the agreed-upon modifications for the n8n workflow integration.
2025-06-19 09:19:42 +00:00
gpt-engineer-app[bot]
e70444f320 Fix: Display WhatsApp groups and implement n8n workflow creation
- Fixed the display of WhatsApp group cards.
- Implemented the creation of an n8n workflow upon user registration, including API action setup, dynamic data modification, and post-request actions to store workflow ID and webhook URL.
- Instructions provided for the user to paste the JSON body.
2025-06-18 13:09:40 +00:00
gpt-engineer-app[bot]
7970b1b99f feat: Use user-provided group name and display created groups
- Modified the WhatsApp group creation to use the user-entered group name instead of the default.
- Implemented the display of created group cards in the "Seus grupos cadastrados" section, including a delete option.
2025-06-16 21:05:35 +00:00
gpt-engineer-app[bot]
57e016a3fb Fix: WhatsApp group creation API request
Corrected the WhatsApp group creation API request to match the Postman examples and the previously provided instructions. This includes adjusting the URL, headers, and request body to ensure successful group creation.
2025-06-16 20:56:15 +00:00
gpt-engineer-app[bot]
7f202972b2 feat: Implement WhatsApp group creation and instance management
- Implemented POST request to Evolution API for WhatsApp group creation on "Cadastrar Grupo" button click.
- Added "Desconectar Instância" button with disconnection logic and Supabase update.
- Hid debug information in the "Grupos" menu.
- Changed app name to "Finance Home".
- Added hover color to sidebar menu items.
2025-06-16 20:36:23 +00:00
gpt-engineer-app[bot]
a097f05a74 Fix: Use login column for filtering
The application was still not fetching transactions correctly. The issue was that the filtering logic was using the `email` column instead of the `login` column to match the logged-in user. This commit corrects the filtering to use the `login` column.
2025-06-15 22:29:11 +00:00
gpt-engineer-app[bot]
93c80af9c2 Fix: Use 'login' column for transaction email lookup
The application was incorrectly searching for transactions using the 'email' column instead of the 'login' column. This commit corrects the query to use the 'login' column, which is the correct identifier for the user's email in the 'transacoes' table.
2025-06-15 22:26:39 +00:00
gpt-engineer-app[bot]
0532e16041 Fix: Debug transaction fetching
Added more debug logs to `src/services/transacao/transacaoFetchService.ts` to investigate why transactions are not loading for specific users, including the user's email and `rodrigobm10@gmail.com`.
2025-06-15 22:21:33 +00:00
gpt-engineer-app[bot]
b82aced699 Fix: Verify login in transaction query
Ensured the transaction query uses the 'login' column in the 'transacoes' table to filter transactions based on the logged-in user's email.
2025-06-15 22:17:54 +00:00
gpt-engineer-app[bot]
ba467fd4fe Fix: Transactions not loading for user
The application is not fetching transactions for the user leopootz10@gmail.com.
2025-06-15 22:14:29 +00:00
gpt-engineer-app[bot]
f4f614e86b Refactor: Improve dashboard chart layout and design
Stacked charts and improved styling for a modern look.
2025-06-15 22:00:39 +00:00
gpt-engineer-app[bot]
b0bbce2637 Add permanent access feature
- Added a boolean field `liberado_permanente` to the `usuarios` table.
- Updated the RLS policy to allow inserts if `liberado_permanente` is true.
- Updated the frontend to show a custom message if the insert is blocked.
2025-06-15 21:54:18 +00:00
gpt-engineer-app[bot]
ad7266b151 Fix: Import useState in Transacoes.tsx
The `useState` hook was not imported in `src/pages/Transacoes.tsx`, causing a "Cannot find name 'useState'" error. This commit adds the necessary import to resolve the error.
2025-06-15 21:43:47 +00:00
gpt-engineer-app[bot]
528714622a Implement trial period and access restrictions
Implement a 30-day trial period for new users. After the trial, restrict the ability to add new transactions if no payment is detected. Use `usuarios.created_at` for the registration date and consider a payment active if a record exists in `pagamentos_mercadopago` with status "approved".
2025-06-15 21:43:16 +00:00
gpt-engineer-app[bot]
038c131b3b Run SQL migration for Mercado Pago payments. 2025-06-15 21:36:27 +00:00
gpt-engineer-app[bot]
ac6b5208ca Fix: Use logged-in user's email in request
Use the logged-in user's email instead of a hardcoded one in the Mercado Pago subscription request.
2025-06-15 21:05:52 +00:00
gpt-engineer-app[bot]
10d79f0f4e Fix: Transactions showing incorrect user data
The transactions were showing data from the wrong user. The `getTransacoes` function in `src/services/transacaoFetchService.ts` was updated to filter transactions by the logged-in user's email, matching the `login` column in the `transacoes` table.
2025-06-15 20:53:10 +00:00
gpt-engineer-app[bot]
9cd928329b Run SQL migration
Apply the reviewed SQL changes to the database.
2025-06-15 20:47:37 +00:00
gpt-engineer-app[bot]
8c3b01e6b6 Apply SQL migration
Apply the SQL migration to the database.
2025-06-15 20:40:16 +00:00
gpt-engineer-app[bot]
0dc7667f05 Fix: App not rendering any pages
The app was not rendering any pages.
2025-06-15 20:35:41 +00:00
gpt-engineer-app[bot]
26cd75ae81 Fix: Handle invalid session on subscription page
The subscription page now correctly handles invalid sessions, even after logging out and back in.
2025-06-15 20:32:43 +00:00
gpt-engineer-app[bot]
d7f2847a84 Fix: Use logged-in user's email for payment
Corrected the email retrieval logic to use the logged-in user's email instead of a hardcoded one when initiating Mercado Pago payments. This resolves the issue where payments were failing due to incorrect email addresses.
2025-06-15 20:21:56 +00:00
gpt-engineer-app[bot]
f91efb3823 Fix: Edge Function non-2xx status code
The "Assinar Agora" button was not working, returning a non-2xx status code.
2025-06-15 20:12:02 +00:00
gpt-engineer-app[bot]
de3dc3363f Fix: Implement "Assinar Agora" button action
Implemented the `handleSubscribe` function to handle the "Assinar Agora" button click, but the action was not being triggered. Fixed the issue.
2025-06-15 20:09:35 +00:00
gpt-engineer-app[bot]
ee0236123c feat: Implement handleSubscribe function
Adds a function to handle subscription requests to Mercado Pago, including POST request setup, error handling, and redirection on success.
2025-06-15 20:06:46 +00:00
gpt-engineer-app[bot]
363e5ac6a4 Add WhatsApp integration and subscription expiry.
- Updated subscription card to reflect WhatsApp integration.
- Removed "Exportação de dados" benefit.
- Added placeholder for subscription expiry date display.
- Identified requirements for subscription expiry logic.
2025-06-15 20:04:23 +00:00
gpt-engineer-app[bot]
17f2de2a73 feat: Add subscription page to settings
Adds a subscription page within the settings section, including a title, a card displaying plan details (name, price, benefits), and "Subscribe Now" and "View Details" buttons. Uses Tailwind CSS for styling.
2025-06-15 20:01:20 +00:00
gpt-engineer-app[bot]
c059dea681 feat: Add back button to Configurações page
Adds a "back" button to the Configurações page to navigate back to the main application layout, addressing the issue of the page opening in isolation.
2025-06-15 19:51:46 +00:00
gpt-engineer-app[bot]
fba2674876 Fix: Configuracoes page still isolated
The Configuracoes page was still rendering in an isolated manner. This commit ensures the page integrates correctly with the main app layout, resolving the issue where it appeared separately.
2025-06-15 19:38:43 +00:00
gpt-engineer-app[bot]
f103d34e02 Fix: Ensure settings page layout
Review and adjust the 'Configurações' page to integrate correctly with the main app layout, ensuring the sidebar and overall spacing are consistent with other sections.
2025-06-15 19:36:32 +00:00
gpt-engineer-app[bot]
3bb236d617 Fix: Ensure settings page layout
The settings page was still appearing as an isolated page. This commit ensures the settings page integrates with the main app layout, using the same sidebar as other pages.
2025-06-15 19:33:52 +00:00
gpt-engineer-app[bot]
67c1dd3ac3 Fix: Settings page navigation
Ensure settings page uses the same layout as other menu items, preserving the sidebar.
2025-06-15 19:30:47 +00:00
gpt-engineer-app[bot]
07bf385f0e Fix: Remove "Geral" from settings page
The "Geral" menu item should not be displayed as a separate page, but rather the content should be displayed within the "Configurações" page. This commit removes the "Geral" page and ensures the correct display of the settings menu.
2025-06-15 19:27:54 +00:00
gpt-engineer-app[bot]
e5b764b986 Fix: Resolve AuthState type error
The error "Property 'user' does not exist on type 'AuthState'" in `src/components/settings/MeuCadastroForm.tsx` is fixed. The code was updated to correctly access the user information from the authentication store.
2025-06-15 19:17:36 +00:00
gpt-engineer-app[bot]
ea1d873675 Feat: Implement settings sub-menus
Implement the settings sub-menus ("Visão Geral", "Meu cadastro", "Assinatura") and the "Meu cadastro" form, using the provided print as a reference. Fetch user data from the database to pre-fill the form and create a new table for user profile data.
2025-06-15 19:17:00 +00:00
gpt-engineer-app[bot]
612adc60b2 Fix: Wrap SettingsSidebar with SidebarProvider
The error "useSidebar must be used within a SidebarProvider" indicates that the SettingsSidebar component is using the useSidebar hook without being wrapped by the SidebarProvider. This commit wraps the SettingsSidebar component with the SidebarProvider in the Configuracoes page to resolve the error.
2025-06-15 18:38:42 +00:00
gpt-engineer-app[bot]
424b86811f feat: Add settings menu to sidebar
Adds a settings menu item to the sidebar.
2025-06-15 17:25:05 +00:00
gpt-engineer-app[bot]
2c59420776 Fix: Resolve missing export error in CreateGroupFormSimple
The error "Module '"@/services/n8nWorkflowService"' has no exported member 'createN8nWorkflow'" indicates that the `createN8nWorkflow` function is not being correctly exported from the `n8nWorkflowService.ts` file. This commit will address this by ensuring the function is exported correctly.
2025-06-12 22:56:52 +00:00
gpt-engineer-app[bot]
fd86aabf32 Refactor: Improve WhatsApp groups UI
Hide debug information and focus on essential data in the WhatsApp groups screen.
2025-06-12 22:55:10 +00:00
gpt-engineer-app[bot]
7cb41a4f9c Fix: Use existing table for credit cards
The SQL was updated to use the existing `cartoes_credito` table instead of creating a new one. This resolves the error and ensures compatibility with the existing database structure.
2025-06-11 09:20:21 +00:00
gpt-engineer-app[bot]
47e003213d Run SQL to create credit card tables. 2025-06-11 00:33:12 +00:00
gpt-engineer-app[bot]
cb3f41b8ff Fix Select.Item value error
The AI will address the "A <Select.Item /> must have a value prop that is not an empty string" error. It will review the code, particularly the `Select.Item` components, to ensure that the `value` prop is always populated with a non-empty string.
2025-06-06 18:56:29 +00:00
gpt-engineer-app[bot]
bfdd935853 Fix: Resolve "Nova Despesa" button issue
The AI will address the issue where the "Nova Despesa" button causes problems, specifically for the user "leopootz10@gmail.com". The changes will focus on the `TransactionForm.tsx`, `useTransactionForm.ts`, and `TransactionDialogs.tsx` files.
2025-06-06 18:50:28 +00:00
gpt-engineer-app[bot]
c25272b68f Fix: Nova Despesa button issue for specific user
The AI will investigate and resolve a bug that occurs when the "Nova Despesa" button is clicked by the user leopootz10@gmail.com.
2025-06-06 18:48:39 +00:00
gpt-engineer-app[bot]
3cc9ca31c8 Fix: Bug when creating new expense
The AI will investigate and fix a bug that occurs when the "Nova Despesa" button is pressed in production.
2025-06-06 18:44:28 +00:00
gpt-engineer-app[bot]
7d0dc19eb9 Fix: Resolve dynamic import fetch error
The AI addressed a "Failed to fetch dynamically imported module" error related to `src/pages/Index.tsx`. This likely involves checking the import path, ensuring the file is correctly served, and verifying the build configuration.
2025-06-06 18:40:04 +00:00
gpt-engineer-app[bot]
e1087e22c6 Fix: Improve monthly chart readability
The AI improved the monthly chart to prevent overlapping labels. It adjusted the display of revenue and expense values for better clarity.
2025-06-03 22:39:12 +00:00
gpt-engineer-app[bot]
cb2d335aab feat: Add month filter to dashboard and transactions
Implement month filtering for the dashboard and transactions pages, allowing users to select a month and view data accordingly.
2025-05-31 18:00:30 +00:00
gpt-engineer-app[bot]
e7b414724b Fix: Debug info not showing correct data
The AI will investigate why the debug information is not reflecting the expected data from the database, potentially due to incorrect database connection or data retrieval issues.
2025-05-24 14:44:09 +00:00
gpt-engineer-app[bot]
ea7398237e Fix: Resolve 'instanceData' not found error
The code was throwing a "Cannot find name 'instanceData'" error in `CreateGroupForm.tsx`. This commit resolves the error by ensuring that the `instanceData` variable is correctly defined and accessible within the component's scope.
2025-05-24 14:37:32 +00:00
gpt-engineer-app[bot]
497c27c7f1 Fix: Enable group creation button
The group creation button should be enabled when the user has a connected WhatsApp instance. The code was updated to check if the user's instance is connected.
2025-05-24 14:36:08 +00:00
gpt-engineer-app[bot]
7ea5009fbd Fix: Enable "Cadastrar Grupo" button logic
The "Cadastrar Grupo" button should be enabled when the user's WhatsApp instance name is filled in the "usuarios" table and the status is "connected". This commit implements this logic.
2025-05-24 14:31:23 +00:00
gpt-engineer-app[bot]
9afd8b4457 Fix: Resolve import error in CreateGroupForm
The CreateGroupForm component was importing a non-existent function `cadastrarGrupoWhatsApp` from `gruposWhatsAppService.ts`. This commit corrects the import to use the available `findOrCreateWhatsAppGroup` function, which is more appropriate for the intended functionality of creating a group.
2025-05-24 14:23:31 +00:00
gpt-engineer-app[bot]
b2cee3d1e5 Fix: Instance data not matching database
The AI investigated the discrepancy between the database and debug information, ensuring the correct database connection and column usage.
2025-05-24 14:21:31 +00:00
gpt-engineer-app[bot]
c004980163 feat: Save WhatsApp instance on creation
- Save the WhatsApp instance name to the 'instancia_zap' column in the 'usuarios' table when a new instance is created.
- Update the instance status based on connection status.
- Prevent the creation of multiple instances per user.
2025-05-24 14:15:57 +00:00
gpt-engineer-app[bot]
ead6400404 Fix: Enable "Cadastrar Grupo" button
The "Cadastrar Grupo" button in the Grupos menu was not enabled after connecting a WhatsApp instance. This commit reviews the logic in `CreateGroupForm.tsx` to ensure the button is correctly enabled when a WhatsApp instance is connected and the user is logged in.
2025-05-24 14:09:31 +00:00
gpt-engineer-app[bot]
417c24089b Run SQL to add WhatsApp columns
Adds `instancia_zap` and `status_instancia` columns to the `usuarios` table.
2025-05-24 14:02:02 +00:00
gpt-engineer-app[bot]
80cd8a1517 Run SQL to update database function
The SQL command to update the `registrar_usuario` function has been reviewed and approved. This commit runs the SQL.
2025-05-24 13:11:05 +00:00
gpt-engineer-app[bot]
354c53212d Refactor: Split RegisterForm.tsx into smaller components
Refactor RegisterForm.tsx into smaller, reusable components to improve code organization and maintainability.
2025-05-24 13:07:24 +00:00
gpt-engineer-app[bot]
bd322c9f45 Fix: Resolve TypeScript error in RegisterForm
The commit addresses a TypeScript error in `RegisterForm.tsx` related to the `whatsapp` field. The error message "Object literal may only specify known properties, and 'whatsapp' does not exist in type" indicates that the `whatsapp` field is not correctly recognized within the object being used.
2025-05-24 12:15:00 +00:00
gpt-engineer-app[bot]
13db2b6b01 Run SQL to add remote_jid column
The SQL commands to add the `remote_jid` column to the `usuarios` table have been approved and should be executed.
2025-05-23 16:41:37 +00:00
gpt-engineer-app[bot]
47ce122c02 Fix: TypeScript error in RegisterForm.tsx
The TypeScript error in `RegisterForm.tsx` is caused by the `whatsapp` field not being included in the type definition. This commit will address the error by updating the type definition to include the `whatsapp` field.
2025-05-23 16:40:11 +00:00
gpt-engineer-app[bot]
d304d5c9c6 Fix: Add WhatsApp to registration form type
The `RegisterForm.tsx` component was updated to include a WhatsApp field. The TypeScript error was resolved by adding the `whatsapp` property to the type definition used for the registration form data. This ensures that the object literal used to pass data to the `supabase.rpc('registrar_usuario')` function includes the `whatsapp` field, resolving the type error.
2025-05-23 16:15:10 +00:00
gpt-engineer-app[bot]
e75d0058d6 Run SQL to add WhatsApp column
Adds the WhatsApp column to the usuarios table in the Supabase database.
2025-05-23 16:11:31 +00:00
gpt-engineer-app[bot]
af6bfe3177 Fix: Redirect to dashboard after login
The app was incorrectly redirecting to a 404 page after login. This commit fixes the redirect to the dashboard after a successful login.
2025-05-22 22:00:44 +00:00
gpt-engineer-app[bot]
9a2f18c74e Add delete meta option to menu
Adds a delete option to the meta menu for deleting registered metas.
2025-05-22 21:54:38 +00:00
gpt-engineer-app[bot]
002836773d Fix: React refresh preamble error
The error "React refresh preamble was not loaded" in `sonner.tsx` suggests a problem with the Vite configuration or React refresh setup. The AI will investigate the Vite configuration (`vite.config.ts`) and the component's import/export structure to ensure proper React refresh functionality.
2025-05-22 14:15:37 +00:00
gpt-engineer-app[bot]
006c2dacc4 Add WhatsApp number to registration
Adds a WhatsApp number field to the registration form and includes it in the data sent to the webhook.
2025-05-22 12:30:35 +00:00
gpt-engineer-app[bot]
6750ecd20e Update registration webhook URL
Update the webhook URL in `src/utils/webhookService.ts` to the new URL provided by the user.
2025-05-21 19:58:14 +00:00
gpt-engineer-app[bot]
74ec708d37 Refactor: Split Auth.tsx into smaller components
Refactor src/pages/Auth.tsx into smaller, more manageable components to improve readability and maintainability.
2025-05-21 19:54:31 +00:00
gpt-engineer-app[bot]
63fd48a4a9 Fix: History replaceState overuse
The commit addresses a "SecurityError: Attempt to use history.replaceState() more than 100 times per 10 seconds" error, likely caused by excessive calls to `history.replaceState()`.
2025-05-21 18:30:26 +00:00
gpt-engineer-app[bot]
36a045d899 Feat: Send user data to webhook on signup
Implement a webhook call to send user registration data to a specified URL after successful signup.
2025-05-21 18:27:03 +00:00
gpt-engineer-app[bot]
17e570de84 Fix: Resolve module import error
The error "TypeError: Importing a module script failed" suggests an issue with module loading in the frontend. This commit aims to address the error, likely by reviewing and correcting module imports, especially in `src/main.tsx` and `index.html`, to ensure proper module loading and prevent runtime errors.
2025-05-21 17:50:06 +00:00
gpt-engineer-app[bot]
96237c4c37 Fix: Resolve module import errors
The commit fixes module import errors in `DespesaCartaoForm.tsx` and `useDespesaCartaoForm.ts` by ensuring the correct path to `despesasService` is used. This resolves the "cannot find module" errors.
2025-05-21 12:55:13 +00:00
gpt-engineer-app[bot]
70c125715a Refactor despesasService.ts
Refactor `despesasService.ts` into smaller, modular files to improve code organization and maintainability.
2025-05-21 11:47:11 +00:00
gpt-engineer-app[bot]
e58db1bb1a Fix: Incorrect card total calculation
The card total in `CartaoDetalhes.tsx` was not correctly reflecting the sum of transactions. This commit addresses the issue.
2025-05-21 10:54:12 +00:00
gpt-engineer-app[bot]
049acd069e Refactor: Split transacaoService.ts into smaller files
Refactors transacaoService.ts into smaller, more manageable files to improve code organization and maintainability.
2025-05-21 10:49:36 +00:00
gpt-engineer-app[bot]
1e9117cbd2 Refactor: Use login and nome for expense association
Update the frontend logic to display credit card expenses based on a combination of the 'login' and 'nome' columns, instead of 'cartao_id', for associating expenses with cards and users.
2025-05-21 10:44:46 +00:00
gpt-engineer-app[bot]
e6d6f5c2b3 Refactor: Split TransactionForm into smaller components
Refactors TransactionForm.tsx into smaller, reusable components and a custom hook to improve code organization and maintainability.
2025-05-21 09:54:05 +00:00
gpt-engineer-app[bot]
1cb5be29cc Refactor: Split DespesaCartaoFormSelect.tsx
Split DespesaCartaoFormSelect.tsx into smaller, more manageable components.
2025-05-21 09:50:32 +00:00
gpt-engineer-app[bot]
5e9b6ca74a Run SQL to add columns
Add `login` and `nome` columns to `despesas_cartao` table.
2025-05-21 09:45:27 +00:00
gpt-engineer-app[bot]
a7506e7070 Fix: Ensure despesas_cartao database connection
Check and resolve issues preventing credit card expense inclusion, verifying the database connection.
2025-05-21 09:25:21 +00:00
gpt-engineer-app[bot]
80835c6ca0 Fix: Include new transactions in Transacoes menu
The changes ensure that credit card expenses, new expenses, and new income are correctly included in the transactions menu.
2025-05-21 01:19:35 +00:00
gpt-engineer-app[bot]
1843cd56b2 Fix TypeScript errors in cartao and despesas services
Resolve errors related to missing properties and type inconsistencies in cartoesService.ts, despesasService.ts, and cartaoTypes.ts. Address the infinite type instantiation error.
2025-05-21 01:08:33 +00:00
gpt-engineer-app[bot]
0d7e56b168 Fix TypeScript errors in services 2025-05-21 01:04:01 +00:00
gpt-engineer-app[bot]
1c529d1310 Fix cartao service type errors
Fixes TypeScript errors related to missing properties in `cartoesService.ts` and `despesasService.ts`, specifically addressing issues with `cartao_codigo`, `bandeira`, and `banco` properties. Also addresses the infinite type instantiation error.
2025-05-21 00:59:44 +00:00
gpt-engineer-app[bot]
18e751ca31 feat: Add pagination to DespesasList
Adds pagination to the DespesasList component to improve handling of large expense lists.
2025-05-21 00:57:41 +00:00
gpt-engineer-app[bot]
4798390546 feat: Add pagination to expenses list
Adds pagination to the DespesasList component to improve handling of large expense lists. Uses the Pagination component from ui/pagination.tsx.
2025-05-21 00:56:16 +00:00
gpt-engineer-app[bot]
df6ee93e01 Refactor: Split CartoesCredito.tsx into components
Refactors the CartoesCreditoPage into smaller, reusable components to improve code organization and maintainability.
2025-05-21 00:54:15 +00:00
gpt-engineer-app[bot]
8253e603a6 Refactor: Split cartaoCreditoService.ts into smaller files
Split the cartaoCreditoService.ts file into smaller, more manageable files to improve code organization and maintainability.
2025-05-21 00:51:28 +00:00
gpt-engineer-app[bot]
8b64a56cd5 Fix TypeScript errors in credit card features
The commit addresses multiple TypeScript errors related to the credit card functionality. It corrects an argument count mismatch in `CartaoCreditoForm.tsx`, resolves missing property errors for `cartao_codigo` in `cartaoCreditoService.ts`, and fixes type instantiation issues.
2025-05-21 00:48:59 +00:00
gpt-engineer-app[bot]
586f831b30 Fix: Resolve TypeScript errors in credit card features
This commit addresses multiple TypeScript errors related to the credit card features. It fixes an argument count mismatch in `DespesaCartaoForm.tsx`, type mismatches in `cartaoCreditoService.ts` related to missing `cartao_codigo` properties, and excessively deep type instantiations. These changes ensure the correct data types are used throughout the application, resolving the build errors and improving code stability.
2025-05-21 00:34:28 +00:00
gpt-engineer-app[bot]
0d58128969 Implement credit card and expense features.
Add credit card registration form with required fields and auto-generated code. Implement expense registration form with card selection and required fields. Establish association logic between expenses and cards based on user and card codes. Ensure data privacy and validation.
2025-05-21 00:21:30 +00:00
gpt-engineer-app[bot]
04ed74ac61 Fix: WhatsApp instance refresh and expense summary
- Fixed an issue where the "Atualizar Lista" button in the WhatsApp connect menu was not correctly displaying created instances.
- Implemented the display of credit card expenses in the transaction and dashboard summaries. The summaries now include the total expenses for each credit card, aggregated with other transaction expenses.
2025-05-20 23:26:56 +00:00
gpt-engineer-app[bot]
afb53c1429 Refactor: Split Transacoes.tsx into smaller components
Refactored the `TransacoesPage` component into smaller, more manageable components to improve code organization and readability. This includes extracting the table, form, and dialog related logic into separate files. Unused imports and files were also removed.
2025-05-20 23:11:39 +00:00
gpt-engineer-app[bot]
9d02a2203d feat: Add credit card expense to transactions
Adds the functionality to include credit card expenses within the transactions menu, mirroring the existing "Nova Despesa" button functionality. This allows users to select a credit card when adding a new expense.
2025-05-20 20:26:48 +00:00
gpt-engineer-app[bot]
34968ee74a Fix: Select.Item value prop error
The Select.Item component requires a non-empty string value prop. This commit addresses the error by ensuring that the value prop is not an empty string.
2025-05-20 20:22:16 +00:00
gpt-engineer-app[bot]
1c78451e07 Fix: TransactionForm prop type and service errors
Fixes the type error in `Transacoes.tsx` by ensuring the `TransactionForm` component receives the correct props, specifically addressing the missing `transaction` prop. Also resolves the type errors in `transacaoService.ts` related to incorrect argument types for number parameters.
2025-05-20 20:17:38 +00:00
gpt-engineer-app[bot]
6d6734c17d Refactor: Split GruposWhatsApp.tsx into smaller components
Split the large GruposWhatsApp.tsx file into smaller, more manageable components to improve readability and maintainability. This refactoring aims to improve code organization without altering existing functionality.
2025-05-20 20:15:21 +00:00
gpt-engineer-app[bot]
c5f3a3d161 Feat: Add group name input and transaction actions
- Added an input field in the GruposWhatsApp menu for users to name their WhatsApp groups, and store the name in the database.
- Added delete and edit buttons to the transactions table, with database integration.
2025-05-20 20:13:08 +00:00
gpt-engineer-app[bot]
a12e1411ef Fix: Restore WhatsApp menu and fix groups menu
Reverts the WhatsApp menu item name change and addresses the non-functional groups menu.
2025-05-20 20:05:31 +00:00
gpt-engineer-app[bot]
ecaa65fdf5 Fix: Sidebar overlapping content
Adjust the sidebar's positioning to prevent it from overlapping content on the screen.
2025-05-20 20:02:46 +00:00
gpt-engineer-app[bot]
ff772429f7 Fix: Resolve import error in App.tsx
Fixes an import error in `App.tsx` related to the `authStore`.  The error message "Failed to resolve import "./stores/authStore" from "src/App.tsx". Does the file exist?" indicates that the specified module could not be found.  This commit addresses the issue by ensuring the correct import path or by creating the missing file.
2025-05-20 20:00:20 +00:00
gpt-engineer-app[bot]
ea18d3488d Run SQL for credit card and expenses
This commit executes the provided SQL script to create tables for credit cards and their associated expenses in the Supabase database.
2025-05-20 19:57:53 +00:00
gpt-engineer-app[bot]
c461f132fb Fix: Check QR code generation
Investigate and address potential issues with QR code generation for WhatsApp connections.
2025-05-20 19:49:35 +00:00
gpt-engineer-app[bot]
03bb67872a Revert instance creation changes
Reverts changes to the instance creation form and related hooks, restoring the functionality to create and connect instances as it was before the recent changes.
2025-05-20 19:37:49 +00:00
gpt-engineer-app[bot]
a9ee70ccb6 feat: Implement "Atualizar Lista" button
The "Connect WhatsApp" menu now loads instances only on clicking the "Atualizar Lista" button. The button fetches instances from the API, filters by the user's instance name, and displays the results. It also shows an appropriate message if no instances are found and addresses potential rendering errors.
2025-05-20 19:26:10 +00:00
gpt-engineer-app[bot]
66e18c3988 Fix: Resolve React error #301
The error is a minified React error, likely caused by a problem with the component's rendering. The error occurs on the /whatsapp route.
2025-05-20 17:30:32 +00:00
gpt-engineer-app[bot]
57d71c73af Fix: Remove unnecessary login message
The login message was appearing even when the user was logged in. The request on app load is only to fetch existing instances.
2025-05-20 17:07:26 +00:00
gpt-engineer-app[bot]
4da7b28d1a Refactor: Split InstanceCard into smaller components
Refactors the InstanceCard component into smaller, more manageable components to improve code organization and readability. This includes extracting parts of the UI and logic into separate components.
2025-05-20 17:03:04 +00:00
gpt-engineer-app[bot]
d9a804c36a Refactor: Break down WhatsApp.tsx into smaller components
Refactors WhatsApp.tsx into smaller, more manageable components and hooks to improve readability and maintainability. This reduces the overall complexity of the file.
2025-05-20 17:01:02 +00:00
gpt-engineer-app[bot]
62e2acbf4e Fix: WhatsApp instance search trigger
The instance search was incorrectly triggered on every keystroke in the instance name input field. The fix ensures that the search uses the saved instance name from local storage, and is only triggered when the "Conectar WhatsApp" menu is opened. The instance name input field is now only used for creating new instances.
2025-05-20 16:57:16 +00:00
gpt-engineer-app[bot]
12e6cda1df Feat: Fetch WhatsApp instance on mount
Adds functionality to fetch a WhatsApp instance from the Evolution API when the "Conectar WhatsApp" menu is accessed. The request uses the instance name entered in the form, includes the necessary headers, and displays the instance information. It also handles cases where the user is not logged in and when the instance is not found.
2025-05-20 16:01:08 +00:00
gpt-engineer-app[bot]
002103e676 Refactor: Improve chart visuals
Improve the visual appearance of the pie chart and the "Receitas vs Despesas" chart, aiming for a more modern look, without affecting other functionalities.
2025-05-20 14:35:43 +00:00
gpt-engineer-app[bot]
67c4d2e318 Refactor: Use Supabase Edge Function for workflow creation
Implement workflow creation using a Supabase Edge Function, addressing CORS issues and enhancing security. The frontend now calls the Edge Function, which handles the n8n API interaction and Supabase updates.
2025-05-20 11:40:32 +00:00
gpt-engineer-app[bot]
9d35dfb518 Fix: Prevent modification of package.json
The AI was attempting to modify the `package.json` file, which is not allowed. This commit removes any changes that would have affected this file.
2025-05-20 11:12:52 +00:00
gpt-engineer-app[bot]
12c178aeb7 Fix: Supabase client access in n8nWorkflowService
The commit addresses two TypeScript errors in `n8nWorkflowService.ts`. The first error, TS2445, arises from attempting to access the protected `supabaseUrl` property directly. The second error, TS2339, occurs because the `session` property is not directly available on the `SupabaseAuthClient`. The fix involves adjusting how the Supabase client and its properties are accessed to align with the Supabase library's intended usage.
2025-05-20 10:56:58 +00:00
gpt-engineer-app[bot]
8ec8b4a5c6 Refactor: Move n8n workflow creation to backend
The frontend now calls a backend endpoint to create n8n workflows, addressing CORS issues. The backend handles the n8n API request, updates Supabase, and returns the result to the frontend.
2025-05-20 10:54:37 +00:00
gpt-engineer-app[bot]
71d2ef79c0 Refactor: Split WhatsApp group service
Split `gruposWhatsAppService.ts` into smaller, more maintainable service files: `n8nWorkflowService.ts` and `whatsAppGroupsService.ts`. This improves code organization and readability.
2025-05-20 10:44:22 +00:00
gpt-engineer-app[bot]
e0f6bc4b86 Fix: Cadastrar Grupo button failing quickly
The "Cadastrar Grupo" button now fails immediately. The priority is to ensure the n8n workflow creation request succeeds. This commit reviews the button's context and related code to address the issue.
2025-05-20 10:37:55 +00:00
gpt-engineer-app[bot]
7736ab1452 Fix: Log n8n API HTTP status code
Log the HTTP status code returned by the n8n API to help debug the "Cadastrar Grupo" button errors.
2025-05-20 10:33:25 +00:00
gpt-engineer-app[bot]
84b22ae8bd Fix: Ensure n8n workflow creation
The code was updated to create the n8n workflow when the "Cadastrar Grupo" button is pressed. It now makes a POST request to the n8n API with the user's email in the request body.
2025-05-20 10:28:24 +00:00
gpt-engineer-app[bot]
9d6319c1b3 Fix: Determine error stage for "Cadastrar Grupo"
The user reported an error when clicking the "Cadastrar Grupo" button. This commit aims to identify the specific stage where the error occurs to facilitate debugging.
2025-05-20 10:25:14 +00:00
gpt-engineer-app[bot]
e5dbce2562 Fix: Resolve group registration error
Investigate and fix the "Não foi possível registrar o grupo" error, likely related to n8n workflow creation. Check API key and other potential causes.
2025-05-20 10:19:49 +00:00
gpt-engineer-app[bot]
aae413643d Fix: Implement group creation workflow
The "Cadastrar Grupo" button now creates a group in Supabase and attempts to create an empty workflow in n8n. If the workflow creation is successful, the workflow ID is saved. If it fails, the group is still created, but a specific error message is displayed.
2025-05-20 10:13:27 +00:00
gpt-engineer-app[bot]
edccfbde36 feat: Create n8n workflow on group registration
Implement n8n API call to create an empty workflow when a new WhatsApp group is registered. Save the returned workflow ID to the Supabase record upon successful creation. Display success message to the user.
2025-05-20 10:01:01 +00:00
gpt-engineer-app[bot]
4f84ab9a9f Add workflow integration for WhatsApp groups
Integrate n8n workflow cloning upon WhatsApp group registration.  Adds a `workflow_id` column to the `grupos_whatsapp` table and updates the `cadastrarGrupoWhatsApp` function to call the n8n webhook, capturing the returned workflow ID and saving it to the database.  The button "Cadastrar Grupo" is only visible when the user is logged in.
2025-05-20 02:24:58 +00:00
gpt-engineer-app[bot]
9331f37ec5 Fix: gruposWhatsAppService.ts insert error
The `cadastrarGrupoWhatsApp` function in `gruposWhatsAppService.ts` was updated to include the `remote_jid` field when inserting a new group into the `grupos_whatsapp` table. This resolves the TypeScript error related to missing properties in the insert call.
2025-05-20 01:10:04 +00:00
gpt-engineer-app[bot]
6a38fd0bf1 Refactor: Use email (login) for user identification
Update the system to use the user's email (login) as the primary identifier for linking users, WhatsApp groups, and transactions. This includes changes to the `grupos_whatsapp` and `transacoes` tables, as well as adjustments to queries and data retrieval logic. The `user_id` field is maintained for compatibility.
2025-05-20 01:08:48 +00:00
gpt-engineer-app[bot]
8435c03464 Run SQL to add WhatsApp group features. 2025-05-20 00:59:19 +00:00
gpt-engineer-app[bot]
5a16246b23 Apply Supabase schema changes
Apply the SQL schema changes to Supabase, including the creation of the `grupos_whatsapp` table and the addition of the `grupo_id` column to the `transacoes` table.
2025-05-20 00:04:49 +00:00
gpt-engineer-app[bot]
908904f9b9 Refactor: Split useWhatsAppInstances hook
Split the `useWhatsAppInstances.ts` hook into smaller, more manageable files to improve code organization and readability.
2025-05-19 23:59:46 +00:00
gpt-engineer-app[bot]
96426e8d8d Fix: Sidebar and page visibility issues
The user reported that no pages were visible and the menu had disappeared. This commit likely addresses the root cause of these issues, potentially related to layout, routing, or component rendering.
2025-05-19 23:12:25 +00:00
gpt-engineer-app[bot]
fa5ff08d71 Fix: Resolve infinite re-render loop
The AI identified and fixed an infinite re-render loop in `useWhatsAppInstances.ts` and `WhatsApp.tsx` by adding state checks, delays, and improving useEffect dependencies.
2025-05-19 23:10:31 +00:00
gpt-engineer-app[bot]
9cd9dcca3a Fix: Resolve React rendering errors
The AI will address two runtime errors: a minified React error (likely related to incorrect component usage or props) and a "too many re-renders" error (indicating an infinite loop). The AI will analyze the code, particularly the `WhatsApp` component and its related hooks and components, to identify and fix the root causes of these errors.
2025-05-19 23:09:26 +00:00
gpt-engineer-app[bot]
f476c1422b Fix: Access instance property in instanceManagement
The code was updated to correctly access the 'instance' property, resolving a TypeScript error.
2025-05-19 23:07:16 +00:00
gpt-engineer-app[bot]
2eba5aa7b1 Refactor: Split WhatsApp service into modules
Split `whatsAppService.ts` into smaller files for API calls, local storage, and types to improve maintainability.
2025-05-19 23:05:13 +00:00
gpt-engineer-app[bot]
90b3030ebb Reverted to commit b8d0db98bb 2025-05-19 18:42:59 +00:00
gpt-engineer-app[bot]
ba5d3c92a3 Refactor: Split useWhatsAppActions into smaller files
Refactor useWhatsAppActions.ts into smaller, more manageable files.
2025-05-19 18:41:01 +00:00
gpt-engineer-app[bot]
88150d84e4 Refactor: Split useWhatsAppInstances hook
Split the large useWhatsAppInstances hook into smaller, more manageable files to improve code organization and readability.
2025-05-19 18:39:02 +00:00
gpt-engineer-app[bot]
8922c07e41 Fix: Incorrect type for onViewQrCode prop
The `onViewQrCode` prop in `InstanceList` was expecting a function with two arguments, but the `handleViewQrCode` function only provided one. This commit fixes the type mismatch.
2025-05-19 18:32:11 +00:00
gpt-engineer-app[bot]
b06373115b Fix: Resolve import error in Sidebar.tsx
The commit fixes an import error in `Sidebar.tsx` related to the `@/config/site` module. The error message indicates that the module cannot be resolved. The fix likely involves ensuring the correct path to the module or creating the missing file.
2025-05-19 18:30:40 +00:00
gpt-engineer-app[bot]
119a8af96a Run SQL migration
Apply the provided SQL to create the `rodrigo_audio_messages` table.
2025-05-19 18:29:45 +00:00
gpt-engineer-app[bot]
e208e7e373 Fix: Resolve import path error
The commit addresses a "Failed to resolve import" error in `src/pages/WhatsApp.tsx`. The error message indicates that the module `@/components/whatsapp` could not be found. This likely means the import path is incorrect, or the file does not exist at the specified location.
2025-05-19 18:24:30 +00:00
gpt-engineer-app[bot]
6100374e56 Add user filtering to database queries
Implement user-based filtering in database queries to retrieve data associated with specific users. Determine the users registered today.
2025-05-19 18:22:18 +00:00
gpt-engineer-app[bot]
b8d0db98bb Fix: Type mismatch in useWhatsAppInstances
The commit fixes a TypeScript error in `useWhatsAppInstances.ts` where the `setInstances` function was receiving an array with incorrect types. The error occurred because the `connectionState` property was sometimes a string instead of the expected union type. The fix ensures that the `connectionState` is always of the correct type.
2025-05-19 18:10:59 +00:00
gpt-engineer-app[bot]
dec494083c Fix: Address instance deletion, disappearing instances, and update errors
- Fixed instance deletion failures.
- Resolved the issue of instances appearing and disappearing in a loop.
- Addressed errors during instance updates.
- Check for missing information.
2025-05-19 18:07:25 +00:00