Repository navigation
Conversation
…nd KYC onboarding flow - hooks/useAdminRefunds: infinite-query refund list with status, date range and search filters, cursor pagination, bulkMarkReviewed and CSV export - components/admin: refund List, Grid and virtualized Table views and a reusable RefundTimelineDetail panel with click-to-copy identifiers and print styles; adds /admin/refunds page - services: refundService, CSV export in exportDataService (with formula injection protection), kycService.submitForApproval - components/onboarding: four-step KycOnboardingFlow with step indicator, react-hook-form and zod validation; used by the driver KYC page - tests for views, hook, services, timeline panel and onboarding flow
… table The installed virtual-core reads offsetHeight/offsetWidth to size the scroll container, while earlier versions read clientHeight/clientWidth. Mock both so the table renders its row window in jsdom regardless of the version.
|
@AdaBliss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves the four Stellar Wave issues assigned to AdaBliss:
Layering follows Component -> Hook -> Service throughout. No inline mock data is used; every response comes from the backend API.
closes #809
closes #810
closes #811
closes #812
Implementation
#809 useAdminRefunds hook
hooks/useAdminRefunds.ts: TanStack infinite query overGET /admin/refunds, with status, date range and search filters, cursor pagination,refetch,fetchNextPagefor infinite scroll, andbulkMarkReviewedthat resolves with{ successCount, errorCount }and invalidates the list.hooks/useRefundViewState.ts: shared filter and selection state for the three views.services/adminRefundService.ts: Axios calls for list, bulk review and timeline. Filters are sent as query params and empty values are omitted.services/exportDataService.ts: newtoCsvandexportToCsv. CSV output is RFC 4180 and cells that begin with=,+,-,@or a tab are quoted to block spreadsheet formula injection.#810 RefundTimelineDetail panel
components/admin/RefundTimelineDetail.tsxrenders events in chronological order with description, action badge, timestamp, actor, optional transaction hash and event ID.print:utility classes provide a print-friendly layout.viewprop (list|grid|table) lets the panel sit alongside any admin view.hooks/useRefundTimeline.tsloads the timeline throughadminRefundServiceand sorts it by timestamp.#811 Admin refund view tests
components/admin/refunds/, with/admin/refundsas the page that hosts them.@tanstack/react-virtualso only the visible rows are rendered.components/admin/__tests__/AdminRefundViews.test.tsxruns 40 cases across the three views (metadata, column toggle, virtualized rows, filters, empty and error states, bulk selection, CSV export). The hook is mocked, as the issue asks.#812 KYC onboarding flow
components/onboarding/KycOnboardingFlow.tsxis a four-step flow: driver's license front and back, vehicle registration, profile photo, review and submit. It replacesKycUploadon/driver/kyc.hooks/useKycOnboarding.tsuses react-hook-form with a zod schema. Each file must be a PDF, JPG or PNG and no larger than 5 MB.kycService.submitForApprovalwith the returned document IDs.Tests and results
Commands run from the repository root with Node and the lockfile dependencies:
npx jest components/admin hooks/__tests__/useAdminRefunds.test.tsx services/__tests__/adminRefundService.test.ts components/onboardingnpx jest(full suite)mainand on this branch. This branch adds no new failures.npx tsc --noEmitcomponents/escrow/__tests__/HighValueCargoMultiSigModal.test.tsx.npx eslinton changed filesuseVirtualizer)npx next buildapp/figma/ERROR_BOUNDARY_EXAMPLES.tsx(childrenmissing inGlobalErrorBoundaryprops). That file is unchanged frommainand is unrelated to this PR.Coverage for the new code measured with
--coverage:RefundListView,RefundTableViewanduseAdminRefundsare at 100% statements and lines.RefundGridViewis at 96% statements. The lowest branch figure is 64.5% foruseKycOnboarding.Compatibility and security
services/refundService.tsalready exists onmainfor the customer cancellation and refund-tracking flow. It is left unchanged. The admin service lives inservices/adminRefundService.tsto avoid a collision.exportDataServicegains two methods;kycServicegainssubmitForApproval. The/driver/kycroute keeps its path and default export.false.Known limitations and open items
/admin/refunds,/admin/refunds/bulk-review,/admin/refunds/:id/timelineand/api/kyc/submitwere chosen from the issue text and must be checked against the API.main. They are unrelated to this PR.maininapp/figma/ERROR_BOUNDARY_EXAMPLES.tsx, so the build check cannot pass until that is fixed upstream.