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

Order creation for stores #4778

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open

Conversation

vladimir-8
Copy link
Contributor

@vladimir-8 vladimir-8 commented Nov 29, 2024

@vladimir-8 vladimir-8 marked this pull request as ready for review December 16, 2024 22:18
@vladimir-8 vladimir-8 changed the title Default pricing rules Order creation for stores Dec 16, 2024
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.

I tested it and I am quite sure it didnt create incident for the following case: API call to reate a single delivery (through OAUTH) -> I guess it should?

It doesn't create incident for delivery CSV import, juste create 0€ deliveries but I think it is normal we agreed on this?

there is also a small remark for the EmbedController, as it doesnt not create an Incident but maybe it is a corner case. actually the biggest problem i forgot is that Embed form is not linked to as store, so maybe we can create an issue for this

src/Action/Delivery/Create.php Show resolved Hide resolved
src/Controller/EmbedController.php Show resolved Hide resolved
src/Controller/Utils/DeliveryTrait.php Show resolved Hide resolved
@@ -38,6 +39,7 @@
*/
class EmbedController extends AbstractController
{
use AccessControlTrait;
use DeliveryTrait;

public function __construct(
Copy link
Member

Choose a reason for hiding this comment

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

on L. 188 of this file you still want to return a form error when NoRuleMatchedException is thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a customer ordering via a form has to pay immediately, I guess it still makes sense to have an error for now

src/Controller/Utils/DeliveryTrait.php Outdated Show resolved Hide resolved
@@ -149,8 +165,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]);
}

$isDeliveryOrder = null !== $store && $store->getCreateOrders();

$isDeliveryOrder = null !== $store;
Copy link
Member

Choose a reason for hiding this comment

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

why the check is different than $order->isFoodtech() ?
actually i am not very sure this check is useful anymore?
this form is used only for lastmile/localcommerce + we are always creating an order now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the check. There is a way to reach this form for food tech orders too, so I removed Save button for food tech orders in the last commit, so that nobody edits it by mistake

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I see it, we have three types of orders:

  • food tech ("shop"/restaurant)
  • local commerce and last mile ("store")
  • B2C via Order form

The difference is that only for "stores" does it make sense to edit a delivery, set arbitrary price, recurrence rules etc. For both food tech and B2C deliveries, it's a one-off order that is already paid so the page is read-only for now

Copy link
Member

Choose a reason for hiding this comment

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

yes indeed I agree - maybe add this message as a comment ?

ah yes actually you could access past foodtech deliveries from the "deliveries" panel and then access this form?

templates/delivery/form.html.twig Show resolved Hide resolved
@vladimir-8 vladimir-8 requested a review from Atala December 23, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment