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

feature: cash deliveries should have amount of money in the task info for the messenger (API) #4672

Merged
merged 40 commits into from
Oct 28, 2024

Conversation

vladimir-8
Copy link
Contributor

No description provided.

Copy link
Member

@alexsegura alexsegura left a comment

Choose a reason for hiding this comment

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

As this is intended to be used via the API, the logic to load data should be moved to a data provider (or a state provider in more recent versions of API Platform). The logic returning a custom DTO shouldn't live in the TaskListRepository, but in the data provider.

Copy link
Member

@alexsegura alexsegura left a comment

Choose a reason for hiding this comment

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

The idea is OK, but it shouldn't be linked to #4337, which can be fixed by a few lines of code in TaskNormalizer. Instead, it should be linked to another issue about fixing performance issues on the dispatch endpoints.

@Atala
Copy link
Member

Atala commented Oct 9, 2024

Related issues
coopcycle/coopcycle-app#1803
#4401

$task->getPrevious()?->getId(),
$task->getNext()?->getId(),
$task->getTags(),
$task->isDoorstep(),
Copy link
Member

Choose a reason for hiding this comment

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

for your information isDoorstep is soon to be deprecated (i removed it in an other branch)


$tasksInTheSameDelivery = $deliveryId ? $tasksByDeliveryId[$deliveryId] : [];

if ($task->isPickup()) {
Copy link
Member

Choose a reason for hiding this comment

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

cool!
I think i had the reflex to write it in SQL as to go faster but I think it is cool if we move it in a utility function we can test it better and it will act as a spec 👍

@Atala
Copy link
Member

Atala commented Oct 11, 2024

i just add a note here not to forget to use the DTO on TaskListUpdated event (live update for riders)

@vladimir-8 vladimir-8 changed the title Feature/4337 task extra info feature: cash deliveries should have amount of money in the dropoff task info for the messenger (API) Oct 18, 2024
@vladimir-8 vladimir-8 changed the title feature: cash deliveries should have amount of money in the dropoff task info for the messenger (API) feature: cash deliveries should have amount of money in the task info for the messenger (API) Oct 18, 2024
@vladimir-8 vladimir-8 marked this pull request as ready for review October 18, 2024 21:48
@@ -295,20 +219,14 @@ Feature: Tasks
"doneBefore":"@[email protected]().startsWith('2018-03-02T12:00:00')",
"comments":"#bob",
"updatedAt":"@[email protected]()",
"isAssigned":true,
"assignedTo":"bob",
Copy link
Member

Choose a reason for hiding this comment

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

we don't need these in-app ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not find any usages of them in the Courier part, only the Dispatch

{
$this->short_code = $shortCode;
$this->name = $name;
//FIXME; why do we have name and type with the same value?
Copy link
Member

Choose a reason for hiding this comment

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

it is legacy, i don't think it is used in the rider app anymore?

i spotted one usage here coopcycle-app/src/navigation/store/NewDeliveryForm.js in the source

{
use NormalizerAwareTrait;

private const ALREADY_CALLED = 'MyTaskMetadataDtoNormalizer_ALREADY_CALLED';
Copy link
Member

Choose a reason for hiding this comment

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

what is the reason for these ALREADY_CALLED?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Atala
Copy link
Member

Atala commented Oct 23, 2024

all deliveries appeared as payed by credit card, but i guess it is an app-side problem, like a fallback that is not good

image

@vladimir-8
Copy link
Contributor Author

I checked in the database, and on my local instance all non-foodtech orders have payment method type CARD. Maybe we should introduce a payment method type INVOICE when we work on coopcycle/coopcycle#41 ?

For now, it will be fixed by displaying only cash payments in the app: coopcycle/coopcycle-app#1904

Copy link
Member

@alexsegura alexsegura left a comment

Choose a reason for hiding this comment

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

Can we remove the My prefix please?

@Atala
Copy link
Member

Atala commented Oct 28, 2024

in this case what should be the name?

@vladimir-8
Copy link
Contributor Author

Can we remove the My prefix please?

I used it to match MyTasks action

final class MyTasks

I'll merge it as it is to start beta-testing, but let's discuss the name. I can rename all of them.

How about CourierTaskDto? It's a Task representation for the courier role, and for the dispatch it could be DispatchTaskDto

@vladimir-8 vladimir-8 merged commit d123686 into master Oct 28, 2024
5 of 6 checks passed
@vladimir-8 vladimir-8 deleted the feature/4337-task-extra-info branch October 28, 2024 22:16
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.

cash deliveries should have amount of money in the task info for the messenger
3 participants