-
Notifications
You must be signed in to change notification settings - Fork 3
Tax estimates - preliminary API, shape, and hooks integration #1002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: darren/tax-estimates
Are you sure you want to change the base?
Conversation
| const { data: taxOverviewData } = useTaxOverview({ useMockData: true }) | ||
| const { data: taxChecklistData } = useTaxChecklist({ useMockData: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we are UI testing and developing, we'll useMockData: true temporarily.
| const yearOptions: YearOption[] = [ | ||
| { label: '2025', value: '2025' }, | ||
| { label: '2024', value: '2024' }, | ||
| { label: '2023', value: '2023' }, | ||
| { label: currentYear.toString(), value: currentYear.toString() }, | ||
| { label: (currentYear - 1).toString(), value: (currentYear - 1).toString() }, | ||
| { label: (currentYear - 2).toString(), value: (currentYear - 2).toString() }, | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently assumes that we show current year up to 3 years prior- this needs to be changed later to: all years where the customer's bookkeeping subscription is/was active.
|
@greptileai Give this a first pass review. |
Greptile Summary
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant TaxEstimateView
participant useTaxEstimates
participant getTaxEstimates
participant API
participant Schema
User->>TaxEstimateView: "Views tax estimates page"
TaxEstimateView->>useTaxEstimates: "Call hook with year and useMockData flag"
useTaxEstimates->>useTaxEstimates: "Build SWR key with auth and businessId"
alt Mock Data Enabled
useTaxEstimates->>useTaxEstimates: "Return mock data from taxEstimateDefaults"
useTaxEstimates->>Schema: "Decode mock data with TaxEstimateResponseSchema"
Schema-->>useTaxEstimates: "Validated data"
else Real API Call
useTaxEstimates->>getTaxEstimates: "Call API with businessId and year"
getTaxEstimates->>API: "GET /v1/businesses/{businessId}/taxes/estimates"
API-->>getTaxEstimates: "Raw API response"
getTaxEstimates->>Schema: "Decode with TaxEstimateResponseSchema"
Schema-->>getTaxEstimates: "Validated data"
getTaxEstimates-->>useTaxEstimates: "Validated data"
end
useTaxEstimates-->>TaxEstimateView: "Tax estimates data"
TaxEstimateView->>TaxEstimateView: "Render UI with data"
TaxEstimateView-->>User: "Display tax estimates"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19 files reviewed, 1 comment
Edit Code Review Agent Settings | Greptile
React with 👍 or 👎 to share your feedback on this new summary format
Description
WIP for hooks for the tax estimates API.
APIs are not final and payloads may change; current estimate is that these are already 90% of the way there. The current goal is to have
layer-reactlibrary have the plumbing (read: hooks) to retrieve dataChanges
Blockers
None.
How this has been tested?
See Loom for interactive demo:
https://www.loom.com/share/3e19c6665b7845758fa2d4b88c5e1462
Acceptance criteria: