-
Notifications
You must be signed in to change notification settings - Fork 4
feat: payment history view #924
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
Conversation
dmortal
commented
Jan 7, 2026
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.
Pull request overview
This PR implements a payment history view feature for contractor payments, refactoring the PaymentHistory component to display actual payment data from the API and improving the UI with proper formatting and actions.
Key changes:
- Refactored PaymentHistory component to fetch and display real contractor payment group data
- Enhanced UI with improved date formatting, currency display, and conditional menu actions
- Removed unused Modal styles and simplified component props by deriving companyId from payment data
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/Contractor/Payments/PaymentHistory/PaymentHistory.tsx | Added API data fetching for payment groups and contractors, removed companyId prop |
| src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.tsx | Refactored to use real payment data with proper formatting and conditional cancel actions |
| src/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss | Added icon styling for menu items |
| src/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.tsx | Removed companyId prop from PaymentHistoryContextual component |
| src/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.tsx | Moved action column to itemMenu prop in DataView |
| src/i18n/en/Contractor.Payments.PaymentHistory.json | Updated translation strings with improved formatting and new error message |
| src/shared/constants.ts | Added new payment event constants for view details and cancel actions |
| src/types/i18next.d.ts | Updated type definitions to match translation changes |
| src/styles/sdk.scss | Removed unused Modal import |
| src/styles/_Modal.scss | Deleted unused Modal styles file |
| src/assets/icons/slash-circle.svg | Added new cancel icon SVG |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| render: ({ wageTotal, reimbursement, bonus }) => ( | ||
| <Text> | ||
| {wageTotal | ||
| ? currencyFormatter( | ||
| Number(wageTotal) + Number(reimbursement) + Number(bonus), | ||
| ) | ||
| : '–'} | ||
| </Text> | ||
| ), |
Copilot
AI
Jan 7, 2026
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.
The total calculation assumes reimbursement and bonus are always defined. If either is undefined or null, Number() will convert them to NaN, resulting in an incorrect total. These values should be coerced to 0 when falsy before addition.