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

Add barcodes generation #4512

Merged
merged 26 commits into from
Nov 4, 2024
Merged

Add barcodes generation #4512

merged 26 commits into from
Nov 4, 2024

Conversation

r0xsh
Copy link
Member

@r0xsh r0xsh commented Jul 16, 2024

@r0xsh r0xsh force-pushed the feature/barcode branch from 86977ef to 4661bea Compare July 16, 2024 13:51
r0xsh added 2 commits July 16, 2024 16:13
- Add a barcode library to composer
- Add "smart" getters to Task entity
- Add endpoint to generate labels in pdf
- Label twig template
@r0xsh r0xsh force-pushed the feature/barcode branch from 0d01948 to 2094c6d Compare July 18, 2024 12:05

if (is_null($task)) {
return $this->json(['error' => 'No data found.'], 404);
}
Copy link
Member

Choose a reason for hiding this comment

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

Antoine : expected behavior is:

  • if task not assigned -> assign directly to you (and other (unassigned) tasks from the delivery)
  • if task is assigned to you -> ask in app if you want to unassign it
  • if task is assigned to somebody else -> ask in app if you want to get it

-> maybe add this as comment?

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.

To be checked the following points :

  • getBarcodeFromEntity seems not to be called
  • maybe we could display the barcode stuff in the dispatch somewhere?
  • the logic in assign/unassign endpoint after scanning
  • hide the barcode feature from shop owners, see how it behaves when you are logged in as a store

}
}

$this->taskManager->scan($task);
Copy link
Member

Choose a reason for hiding this comment

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

this will send the "TASK SCANNED" message through EDIFACT to the transporter? (see command handler)
in this case I am not 100% sure it is good to have such side effect here (because the endpoint is mostly about assign/unassign) so maybe move it to a different endpoint for separation of concern

tell me if i a misunderstood things


$edi = $task->getImportMessage();
if (!is_null($edi)) {
//TODO: Send edifact message when scanned
Copy link
Member

Choose a reason for hiding this comment

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

TODO before merging I think?

@see https://github.com/ScientaNL/DoctrineJsonFunctions
*/
$conn = $this->getEntityManager()->getConnection();
$sql = "SELECT id FROM task WHERE metadata->>'barcode' = :barcode";
Copy link
Member

Choose a reason for hiding this comment

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

)
}

export default function ({ items }) {
Copy link
Member

Choose a reason for hiding this comment

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

maybe show it in the dispatch panel somewhere?

@r0xsh r0xsh merged commit dd2d571 into master Nov 4, 2024
6 checks passed


/**
* @Route("/api/barcode", name="barcode_api")
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be mapped to a web controller

$this->eventRecorder->record(new Event\TaskBarcodeScanned($task));


// $edi = $task->getImportMessage();
Copy link
Member

Choose a reason for hiding this comment

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

we should create an issue to track this otherwise we will forget?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants