Skip to content

Commit

Permalink
invoices: add category to InvoiceItem (digitalocean#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbutler authored Jul 21, 2020
1 parent 845ee2c commit 738f7b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit 738f7b0

Please sign in to comment.