Resolve errors related to missing properties and type inconsistencies in cartoesService.ts, despesasService.ts, and cartaoTypes.ts. Address the infinite type instantiation error.
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.
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.
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.
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.
- 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.
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.
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.
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.
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.
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.
- 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.
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.
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.
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.
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.
Refactors WhatsApp.tsx into smaller, more manageable components and hooks to improve readability and maintainability. This reduces the overall complexity of the file.
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.
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.
Improve the visual appearance of the pie chart and the "Receitas vs Despesas" chart, aiming for a more modern look, without affecting other functionalities.
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.
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.
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.
Split `gruposWhatsAppService.ts` into smaller, more maintainable service files: `n8nWorkflowService.ts` and `whatsAppGroupsService.ts`. This improves code organization and readability.
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.
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.
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.
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.
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.
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.
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.
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.
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.