Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

[INT-510] n8n: Address additional problems from n8n code review #5

Merged
merged 3 commits into from
Feb 14, 2022

Conversation

YokySantiago
Copy link

@YokySantiago YokySantiago commented Feb 11, 2022

Onfleet review

Admin resource

Admin:getAll

  • Missing pagination

Admin:delete

  • Return { success: true } when the operation is successfull

Task resource

  • Do only task:create and do the batching behind the scenes. Batching if available should be the implementation to use.

Task:create

  • Every field that is not required should be under a collection. I was able to create a task only with the destination address, which means, that recipients it’s not required
  • When setting the address you have a collection called “additional fields” that is not necessary. Add them at the same level of the destination address and make them not required. Do the same with Recipient
  • Rename additional task fields to Additional Fields

Task:clone

  • If the operation does not return anything when it ran successfully return { success: true }
  • Rename collection options to additional fields
  • Move what is inside the collection override to the same level the options parameters are

Task:complete

  • If this operation completes the task why would I make the success parameter false?
  • Return { success: true } when the operation is successful

Task:delete

  • Return { success: true } when the operation is successfull

Task:getAll

  • Missing pagination
  • From does not seem to be a required parameter. Add It under the collection filter fields
  • Rename filter fields collection to filters
  • Remove Last ID parameter.
  • It does not seem to return the task I created

Task:get

  • Is the short id parameter really needed? Can just detect that behind the scenes and make the corresponding call?

Container resource

  • I would probably only leave the get operation for this resource. Then, move insert and update to another resource called containerTask.

Container:insertTasks

  • I would create different operations depending on the insert type. for example: containerTask:append, containerTask:Prepend.
  • Rename tasks to Task IDs

Hub resource

Hub:getAll

  • Missing pagination

Hub:update

  • Destination should be under update fields

Team resource

Team:auto-dispatch

  • What is road end exactly? an address?
  • Return { success: true } when the operation is successfull

Team:create

  • All the fields marked as required, are not actually required. Everything that is not required should not be at the main level but instead should be moved underneath a collection. In this case, the additional fields collection

Team:delete

  • Return { success: true } when the operation is successfull

Team:getAll

  • Missing pagination

Team:getTimeStimates

  • Dropoff and pickup do not seem to be required parameters. Both need to be under additional fields if this is the case

Webhook resource

  • Is it the webhook resource usufull in the node? I would not say so, since we are already using those endpoints in the trigger. Do you have a use case in mind where you need to create Webhooks dynamically?

Worker resource

Worker:create

  • It does not seem to be working. No matter the input I provide.

worker:getAll

  • Missing pagination

Copy link

@jamesliupenn jamesliupenn left a comment

Choose a reason for hiding this comment

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

LGTM

@jamesliupenn jamesliupenn merged commit 007ed0b into onfleet:master Feb 14, 2022
jamesliupenn added a commit that referenced this pull request May 3, 2022
* feat: added Onfleet nodes

Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.

* style: fixed typos, arrays uniformity, unnecesary files

* refactor: changed add to create in comments and labels

* feat: added name field to onfleet trigger node

* feat: added team endpoints to onfleet node

Added team auto-dispatch and driver time estimate endpoints to Onfleet
node

* style: remove dots in descriptions and fixed some typos

* feat: added fixes according to comments made on the n8n PR

added new fixed collections, refactored the code according to comments
made on the n8n pr

* fix: fixed recipient and destination cretion

* docs: added docstrings for format some functions

added docstrings for new functions addded for formatting the destination
and recipient objects

* style: formatting the code according to n8n nodelinter

* fix: typos and better descriptions

* [INT-510] n8n: Address additional problems from n8n code review (#5)

* Fixed some error creating a worker, moving some fields under additional fields collection

* Fixed returned values for delete operations, making some changes for style code

* Added operational error since required property is not working for dateTime fields

* ⚡ Improvements to n8n-io#2593

* ⚡ Improvements

* 🐛 Fix issue with wrong interface

* ⚡ Improvements

* ⚡ Improvements

* ⚡ Minor improvement

Co-authored-by: Santiago Botero Ruiz <[email protected]>
Co-authored-by: ilsemaj <[email protected]>
Co-authored-by: Santiago Botero Ruiz <[email protected]>
Co-authored-by: Jan Oberhauser <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants