Skip to content

feat(#999): add date range filter to transaction history - #845

Closed
guimroque wants to merge 1 commit into
stagingfrom
feat/999-filtro-transacoes-por-data
Closed

guimroque wants to merge 1 commit into
stagingfrom
feat/999-filtro-transacoes-por-data

Conversation

@guimroque

Copy link
Copy Markdown
Member

Summary

Adicionar filtro de transações por intervalo de data na tela de histórico do Bako Safe.

Closes #999

Implementation Steps

  1. Adicionar campos dateFrom/dateTo no estado de filtros do useTransactionList

    • Added DateRangeFilter interface and date filter state management to useTransactionList hook, updated query keys to include date filters for proper caching.
    • Files: src/modules/transactions/hooks/list/useTransactionList.ts (edit), src/modules/transactions/hooks/list/useTransactionListPaginationRequest.ts (edit), src/modules/core/hooks/bakosafe/transaction.ts (edit), src/modules/core/hooks/workspaces.ts (edit)
  2. Criar componente DateRangeFilter na interface de filtros existente

    • Created DateRangeFilter component with two date pickers and clear functionality, updated transaction services to handle date filtering by created_at field.
    • Files: src/modules/transactions/components/DateRangeFilter.tsx (create), src/modules/transactions/services/methods.ts (edit), packages/api/src/modules/transaction/services/TransactionService.ts (edit)
  3. Modificar useTransactionListPaginationRequest para incluir filtros de data na query

    • Modified useTransactionListPaginationRequest to include date range validation, error messages for invalid date ranges and empty results, and updated service types to support date filtering parameters.
    • Files: src/modules/transactions/hooks/list/useTransactionListPaginationRequest.ts (edit), src/modules/transactions/services/types.ts (edit)
  4. Atualizar validações e tratamento de erros para regras de negócio das datas

    • Enhanced date range validation with proper date format checking, improved toast message management to prevent duplicates, and better handling of empty results for date filters.
    • Files: src/modules/transactions/hooks/list/useTransactionListPaginationRequest.ts (edit)
Files changed
File Action Reason
src/modules/transactions/hooks/list/useTransactionList.ts edit Added DateRangeFilter interface, date filter state, and handlers for date changes and clearing filters
src/modules/transactions/hooks/list/useTransactionListPaginationRequest.ts edit Enhanced validation and error handling with proper date format validation, toast management to prevent duplicate messages, and improved logic for showing empty results message
src/modules/core/hooks/bakosafe/transaction.ts edit Updated TRANSACTION_QUERY_KEYS.VAULT to include dateFrom and dateTo parameters for proper cache key management
src/modules/core/hooks/workspaces.ts edit Updated WorkspacesQueryKey to include dateFrom and dateTo parameters in the query key for proper cache invalidation
src/modules/transactions/components/DateRangeFilter.tsx create Create DateRangeFilter component with two date pickers and clear functionality
src/modules/transactions/services/methods.ts edit Update TransactionService to handle dateFrom/dateTo parameters by converting to ISO strings
packages/api/src/modules/transaction/services/TransactionService.ts edit Update API TransactionService to filter by dateFrom/dateTo using created_at field
src/modules/transactions/services/types.ts edit Added dateFrom and dateTo parameters to GetTransactionParams interface to support date filtering

Auto-generated implementation from spec

@guimroque guimroque closed this Mar 8, 2026
@guimroque
guimroque deleted the feat/999-filtro-transacoes-por-data branch March 8, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant