Skip to content
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

invoices: add category to InvoiceItem #357

Merged
Merged
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
invoices: add category to InvoiceItem
  • Loading branch information
rbutler committed Jul 21, 2020
commit b3f28e46380330fc0b487664879a10bef90ca764
1 change: 1 addition & 0 deletions invoices.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type InvoiceItem struct {
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
ProjectName string `json:"project_name"`
Category string `json:"category"`
}

// InvoiceList contains a paginated list of all of a customer's invoices.
Expand Down
8 changes: 6 additions & 2 deletions invoices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func TestInvoices_GetInvoices(t *testing.T) {
"duration_unit": "Hours",
"start_time": "2018-06-20T08:44:38Z",
"end_time": "2018-06-21T08:44:38Z",
"project_name": "My project"
"project_name": "My project",
"category": "iaas"
},
{
"product": "Load Balancers",
Expand All @@ -41,7 +42,8 @@ func TestInvoices_GetInvoices(t *testing.T) {
"duration_unit": "Hours",
"start_time": "2018-06-20T08:44:38Z",
"end_time": "2018-06-21T08:44:38Z",
"project_name": "My Second Project"
"project_name": "My Second Project",
"category": "paas"
}
],
"meta": {
Expand All @@ -68,6 +70,7 @@ func TestInvoices_GetInvoices(t *testing.T) {
StartTime: time.Date(2018, 6, 20, 8, 44, 38, 0, time.UTC),
EndTime: time.Date(2018, 6, 21, 8, 44, 38, 0, time.UTC),
ProjectName: "My project",
Category: "iaas",
},
{
Product: "Load Balancers",
Expand All @@ -81,6 +84,7 @@ func TestInvoices_GetInvoices(t *testing.T) {
StartTime: time.Date(2018, 6, 20, 8, 44, 38, 0, time.UTC),
EndTime: time.Date(2018, 6, 21, 8, 44, 38, 0, time.UTC),
ProjectName: "My Second Project",
Category: "paas",
},
}
actualItems := invoice.InvoiceItems
Expand Down