How anjalimadhavi98/approvetransactions works
This is a React/TypeScript transaction-management interview challenge. The main workflow loads employees and paginated transactions, lets a user filter transactions by employee, and displays transaction approval controls. A separate simulated request layer serves employee and transaction data from local mock data, including pagination and approval operations. The README documents the user-facing capabilities and expected behaviors; some component and request wiring is not shown in the excerpts, so those relationships are omitted rather than inferred.
Main entry points: App.tsx App orchestration · useCustomFetch.ts Cached fetch · index.tsx Transactions list · TransactionPane.tsx Transaction pane
Components 17
User interface
- Challenge instructions
src/components/Instructions.tsx - Employee filter
src/components/InputSelect/index.tsx - Transactions list
src/components/Transactions/index.tsx - Transaction pane
src/components/Transactions/TransactionPane.tsx - Approval checkbox
src/components/InputCheckbox/index.tsx
Transaction workflow
- App orchestration
src/App.tsx - Employee loading
src/hooks/useEmployees.ts - Paginated transactions
src/hooks/usePaginatedTransactions.ts - Employee transactions
src/hooks/useTransactionsByEmployee.ts
Request and data layer
- Cached fetch
src/hooks/useCustomFetch.ts - Request status wrapper
src/hooks/useWrappedRequest.ts - Simulated API dispatcher
src/utils/fetch.ts - Data operations
src/utils/requests.ts - Mock records
src/mock-data.json
Shared state
- App context
src/components/AppContextProvider/index.tsx - Context and cache type
src/utils/context.ts
Other components
- User
Connections 18
- User → App orchestration: opens app
README.md - App orchestration → Challenge instructions: renders
src/App.tsx - App orchestration → Employee filter: renders and filters
src/App.tsx - App orchestration → Transactions list: renders results
src/App.tsx - App orchestration → Employee loading: loads employees
src/App.tsx - App orchestration → Paginated transactions: loads pages
src/App.tsx - App orchestration → Employee transactions: loads filtered results
src/App.tsx - Transactions list → Transaction pane: renders panes
src/components/Transactions/index.tsx - Transaction pane → Approval checkbox: renders control
src/components/Transactions/TransactionPane.tsx - Employee loading → Cached fetch: fetches employees
src/hooks/useEmployees.ts - Paginated transactions → Cached fetch: fetches pages
src/hooks/usePaginatedTransactions.ts - Employee transactions → Cached fetch: fetches by employee
src/hooks/useTransactionsByEmployee.ts - Cached fetch → Request status wrapper: wraps requests
src/hooks/useCustomFetch.ts - Cached fetch → Simulated API dispatcher: dispatches fetch
src/hooks/useCustomFetch.ts - Simulated API dispatcher → Data operations: dispatches operations
src/utils/fetch.ts - Data operations → Mock records: reads records
src/utils/requests.ts - App context → Context and cache type: uses context
src/components/AppContextProvider/index.tsx - Cached fetch → Context and cache type: reads cache context
src/hooks/useCustomFetch.ts