Skip to content

Conversation

@dmortal
Copy link
Contributor

@dmortal dmortal commented Jan 7, 2026

image

Copilot AI review requested due to automatic review settings January 7, 2026 21:42
Copy link
Contributor

Copilot AI left a 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.

Comment on lines +109 to 117
render: ({ wageTotal, reimbursement, bonus }) => (
<Text>
{wageTotal
? currencyFormatter(
Number(wageTotal) + Number(reimbursement) + Number(bonus),
)
: '–'}
</Text>
),
Copy link

Copilot AI Jan 7, 2026

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.

Copilot uses AI. Check for mistakes.
@dmortal dmortal enabled auto-merge (squash) January 8, 2026 13:25
@dmortal dmortal merged commit b1e2f68 into main Jan 8, 2026
6 checks passed
@dmortal dmortal deleted the da/sdk-133 branch January 8, 2026 13:28
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.

3 participants