Skip to content

Commit

Permalink
Merge pull request #58 from Ioka-Technologies/ioka-technologies/fix-u…
Browse files Browse the repository at this point in the history
…ser-not-being-populated

Fix #57: User.Name not being populated on timeentry list
  • Loading branch information
becoded committed Apr 19, 2024
2 parents ebfada9 + b0dde42 commit aff6413
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
9 changes: 6 additions & 3 deletions harvest/estimate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ func TestEstimateService_List(t *testing.T) {
},
LineItems: &lineItemsOne,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("13dc088aa7d51ec687f186b146730c3c75dc7423"),
Number: harvest.String("1001"),
Expand Down Expand Up @@ -112,7 +113,8 @@ func TestEstimateService_List(t *testing.T) {
},
LineItems: &lineItemsTwo,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("a5ffaeb30c55776270fcd3992b70332d769f97e7"),
Number: harvest.String("1000"),
Expand Down Expand Up @@ -200,7 +202,8 @@ func TestEstimateService_Get(t *testing.T) {
},
LineItems: &lineItemsOne,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("13dc088aa7d51ec687f186b146730c3c75dc7423"),
Number: harvest.String("1001"),
Expand Down
18 changes: 12 additions & 6 deletions harvest/invoice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ func TestInvoiceService_CreateInvoice(t *testing.T) {
},
LineItems: &lineItems,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("8b86437630b6c260c1bfa289f0154960f83b606d"),
Number: harvest.String("1002"),
Expand Down Expand Up @@ -218,7 +219,8 @@ func TestInvoiceService_CreateInvoice(t *testing.T) {
},
LineItems: &lineItems,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("16173155e0a01542b8c7f689888cb3eaeda0dc94"),
Number: harvest.String("1002"),
Expand Down Expand Up @@ -422,7 +424,8 @@ func TestInvoiceService_GetInvoice(t *testing.T) {
},
LineItems: &lineItems,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("9e97f4a65c5b83b1fc02f54e5a41c9dc7d458542"),
Number: harvest.String("1000"),
Expand Down Expand Up @@ -613,7 +616,8 @@ func TestInvoiceService_ListInvoices(t *testing.T) {
},
LineItems: &lineItemsOne,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("21312da13d457947a217da6775477afee8c2eba8"),
Number: harvest.String("1001"),
Expand Down Expand Up @@ -656,7 +660,8 @@ func TestInvoiceService_ListInvoices(t *testing.T) {
},
LineItems: &lineItemsTwo,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("9e97f4a65c5b83b1fc02f54e5a41c9dc7d458542"),
Number: harvest.String("1000"),
Expand Down Expand Up @@ -810,7 +815,8 @@ func TestInvoiceService_UpdateInvoice(t *testing.T) {
PurchaseOrder: harvest.String("2345"),
LineItems: &lineItems,
Creator: &harvest.User{
ID: harvest.Int64(1782884),
ID: harvest.Int64(1782884),
Name: harvest.String("Bob Powell"),
},
ClientKey: harvest.String("8b86437630b6c260c1bfa289f0154960f83b606d"),
Number: harvest.String("1002"),
Expand Down
21 changes: 14 additions & 7 deletions harvest/time_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ func TestTimesheetService_ListTimeEntries(t *testing.T) {
SpentDate: harvest.DateP(harvest.Date{time.Date(
2017, 3, 2, 0, 0, 0, 0, time.Local)}),
User: &harvest.User{
ID: harvest.Int64(1782959),
ID: harvest.Int64(1782959),
Name: harvest.String("Kim Allen"),
},
Client: &harvest.Client{
ID: harvest.Int64(5735774),
Expand Down Expand Up @@ -261,7 +262,8 @@ func TestTimesheetService_ListTimeEntries(t *testing.T) {
SpentDate: harvest.DateP(harvest.Date{time.Date(
2017, 3, 1, 0, 0, 0, 0, time.Local)}),
User: &harvest.User{
ID: harvest.Int64(1782959),
ID: harvest.Int64(1782959),
Name: harvest.String("Kim Allen"),
},
Client: &harvest.Client{
ID: harvest.Int64(5735776),
Expand Down Expand Up @@ -317,7 +319,8 @@ func TestTimesheetService_ListTimeEntries(t *testing.T) {
SpentDate: harvest.DateP(harvest.Date{time.Date(
2017, 3, 1, 0, 0, 0, 0, time.Local)}),
User: &harvest.User{
ID: harvest.Int64(1782959),
ID: harvest.Int64(1782959),
Name: harvest.String("Kim Allen"),
},
Client: &harvest.Client{
ID: harvest.Int64(5735776),
Expand Down Expand Up @@ -371,7 +374,8 @@ func TestTimesheetService_ListTimeEntries(t *testing.T) {
SpentDate: harvest.DateP(harvest.Date{time.Date(
2017, 3, 1, 0, 0, 0, 0, time.Local)}),
User: &harvest.User{
ID: harvest.Int64(1782959),
ID: harvest.Int64(1782959),
Name: harvest.String("Kim Allen"),
},
Client: &harvest.Client{
ID: harvest.Int64(5735776),
Expand Down Expand Up @@ -479,7 +483,8 @@ func TestTimesheetService_RestartTimeEntry(t *testing.T) {
ID: harvest.Int64(662202797),
SpentDate: harvest.DateP(harvest.Date{spentDate}),
User: &harvest.User{
ID: harvest.Int64(1795925),
ID: harvest.Int64(1795925),
Name: harvest.String("Jane Smith"),
},
Client: &harvest.Client{
ID: harvest.Int64(5735776),
Expand Down Expand Up @@ -565,7 +570,8 @@ func TestTimesheetService_StopTimeEntry(t *testing.T) {
ID: harvest.Int64(662202797),
SpentDate: harvest.DateP(harvest.Date{spentDate}),
User: &harvest.User{
ID: harvest.Int64(1795925),
ID: harvest.Int64(1795925),
Name: harvest.String("Jane Smith"),
},
Client: &harvest.Client{
ID: harvest.Int64(5735776),
Expand Down Expand Up @@ -668,7 +674,8 @@ func TestTimesheetService_UpdateTimeEntry(t *testing.T) {
UpdatedAt: &updatedTimeEntry,
SpentDate: harvest.DateP(harvest.Date{spentDate}),
User: &harvest.User{
ID: harvest.Int64(1782959),
ID: harvest.Int64(1782959),
Name: harvest.String("Kim Allen"),
},
Client: &harvest.Client{
ID: harvest.Int64(5735774),
Expand Down
2 changes: 2 additions & 0 deletions harvest/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type User struct {
FirstName *string `json:"first_name,omitempty"`
// The last name of the user.
LastName *string `json:"last_name,omitempty"`
// The full name of the user - this is populated when listing time entries
Name *string `json:"name,omitempty"`
// The email address of the user.
Email *string `json:"email,omitempty"`
// The telephone number for the user.
Expand Down

0 comments on commit aff6413

Please sign in to comment.