Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion account_invoices.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type InvoiceTaxSummary struct {
type InvoiceItem struct {
Label string `json:"label"`
Type string `json:"type"`
UnitPrice float32 `json:"unit_price"`
UnitPrice string `json:"unit_price"`
Quantity int `json:"quantity"`
Amount float32 `json:"amount"`
Tax float32 `json:"tax"`
Comment on lines +32 to 35
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The InvoiceItem struct has inconsistent numeric types. While UnitPrice is now correctly a string to match the API response, other monetary fields (Amount, Tax, Total) remain as float32. Consider whether these fields also return as strings from the API. If they do, they should be changed to string for consistency. If they're actually returned as numbers, the inconsistency should be documented to explain why UnitPrice is treated differently.

Copilot uses AI. Check for mistakes.
Expand Down
2 changes: 1 addition & 1 deletion test/unit/account_invoices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ func TestAccountInvoiceItems_List(t *testing.T) {
assert.Equal(t, float32(1.25), invoiceItem.Tax)
assert.Equal(t, float32(21.45), invoiceItem.Total)
assert.Equal(t, "hourly", invoiceItem.Type)
assert.Equal(t, float32(5.05), invoiceItem.UnitPrice)
assert.Equal(t, "5.05", invoiceItem.UnitPrice)
}
2 changes: 1 addition & 1 deletion test/unit/fixtures/account_invoice_items_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"to": "2018-01-31T11:59:59",
"total": 21.45,
"type": "hourly",
"unit_price": 5.05
"unit_price": "5.05"
}
],
"page": 1,
Expand Down
Loading