fastruby / harvesting

Ruby wrapper for the Harvest API v2
MIT License
28 stars 30 forks source link

Project Task & User Assignments #13

Closed benphelps closed 5 years ago

benphelps commented 6 years ago

This adds the /project/:id/:[task|user]_assignments(/:id) and /[task|user]_assignments endpoints.

This endpoint is a bit different than others but I managed to get it working quite well. Since it has 2 different endpoints to fetch records, one for all projects and one for specific projects, I added project as an optional variable to the Client methods.

There very well could be a better way to do this, but it's working for my needs currently.

benphelps commented 6 years ago

ProjectTaskAssignment and ProjectUserAssignment both assume they have a ref_project passed to them in their path methods. This is because updating and creating new assignments does in fact require a project reference, however when fetching the list of all project assignments, we don't have a project to pass to them. I felt it would be wrong to include separate models for these two cases, maybe there is a better way to do this, I'm not sure.

etagwerker commented 5 years ago

@benphelps Hey, I just merged the last PR by @gap777. Please let me know if you need help with VCR.

gap777 commented 5 years ago

@benphelps we're needing this change, too. Let me know if I can assist.

mscottford commented 5 years ago

I've gotten started on addressing the code review comments and switching to using the HarvestRecord and HarvestRecordCollection base classes. I'm also going to consolidate the ProjectTaskAssignment introduced in this pull request with the TaskAssignment class which already exists and is used as part of the VCR data setup.

etagwerker commented 5 years ago

@benphelps Thanks for getting this started! I'm closing this PR in favor of #25. We can continue talking about it over there. 👍

mscottford commented 5 years ago

@benphelps If you'd like to collaborate on my fork, let me know, I'm happy to give you commit privileges.