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.
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.
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.
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.
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.
- 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.
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.
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.
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.
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.
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.
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()`.
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.
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.
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.
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.