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

Feat/barcode v2 #4732

Merged
merged 24 commits into from
Nov 26, 2024
Merged

Feat/barcode v2 #4732

merged 24 commits into from
Nov 26, 2024

Conversation

r0xsh
Copy link
Member

@r0xsh r0xsh commented Nov 8, 2024

This PR Includes

  • New Methods: Added assignTo(User) and unassign() methods to the Delivery entity.
  • Updated Behavior for /api/tasks/:id/{un}assign Endpoints:
    • ⚠️ The {un}assign endpoints now apply to the entire delivery if the task is linked to one. Initially, I considered adding separate methods on the Delivery entity endpoint, but decided against it to maintain data integrity directly via a single endpoint.
  • Barcodes Added to the Following Screens:
    • Dispatch Task Modal
    • Dispatch & Local Commerce Deliveries Lists
    • Dispatch & Local Commerce Delivery Details Screen
  • Improvements to /api/barcode Endpoint:
    • To enhance UI responsiveness, I adopted a more RPC-oriented approach in designing this endpoint.

To Be Completed

  • Add authentication to BarcodeController methods (consider using a Voter)
  • UI/UX adjustments
  • Documentation updates for users
  • Testing

@r0xsh r0xsh marked this pull request as draft November 12, 2024 17:30
This changes the behavior of the endpoint if the task is linked to a delivery.
Instead of only assigning the task in question, the entire delivery is assigned.
This may be less compliant with REST principles, but leaving it as it was without
any validation would have allowed clients to assign a delivery to different riders.
This change is related to the previous commit.
@r0xsh r0xsh marked this pull request as ready for review November 26, 2024 11:06
Copy link
Member

@Atala Atala left a comment

Choose a reason for hiding this comment

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

hello it seems good to me

can you check this bug and if it happens when you assign a delivery with a barcode? (drop is before pickup in the list) because I use the same functions as you
#4725

also there may be a UI/UX problem from:

  • assign delivery1 with barcode
  • assign delivery2 with barcode

then I think the rider will have the following assignments

  1. delivery1.pickup
  2. delivery1.dropoff
  3. delivery2.pickup
  4. delivery2.dropoff

but you may want to have all the pickups assigned first in the tasklist then the drops to be done afterwards

features/tasks.feature Show resolved Hide resolved
@@ -76,25 +79,45 @@ public function barcodeAction(
* Possible actions: ask_to_assign, ask_to_unassign
* ask_to_assign: Will prompt the user to self-assign
Copy link
Member

Choose a reason for hiding this comment

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

shall we have ask_to_start in the workflow? or maybe assign the task + start the task?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah good idea ! But i'm expecting changes here. I'm pretty sure the auto-assign on scan can fire back on multi points delivery

@r0xsh r0xsh merged commit 3e40ad5 into master Nov 26, 2024
6 checks passed
@r0xsh r0xsh deleted the feat/barcode-v2 branch November 26, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The barcodes URL should be non-guessable, insert HashId or something like this in the URL
2 participants