{% extends 'Layouts/Doc/default.html.twig' %}
{% block title %}
{{ 'app.documentation.menu.architecture.drivers'|trans }}
{% endblock %}
{% block headerPageTitle %}
{{ 'app.documentation.menu.workflow.order_workflow'|trans|upper }}
{% endblock %}
{% block body %}
<div class="card mb-12">
<div class="card-body flex-column p-5">
<div class="d-flex align-items-center h-lg-100px p-5 p-lg-15">
<div class="row">
<div class="col-md-12 pt-5 scroll-y">
<div class="position-relative w-100 text-gray-800">
<p><strong>POPINA ORDER</strong> allows customers to place orders online and pick them up from a physical shop or have them delivered. The workflow of an order in a click and collect system typically involves several steps.</p>
</div>
</div>
</div>
</div>
<div class="d-flex flex-column">
<div class="row table-responsive">
<div class="col-md-12 offset-2">
{% include 'Doc/Diagram/orders-workflow.html.twig' %}
</div>
</div>
</div>
<div class="d-flex align-items-center p-lg-15">
<div class="row">
<div class="col-md-12 pt-5">
<ul>
<p>Once the customer places an order:</p>
<li>
<strong><a>New order</a></strong>
<p>
<ul>
<li>After the customer completes the checkout process and confirms the order, the system generates a unique order number and creates it in the system.</li>
<li>The order can be associated with the customer's account or remain anonymous. It includes details such as the items, quantities, total cost, and pickup location.</li>
<li>At this stage, the system may perform validation checks to ensure the order is valid and meets any specific requirements.</li>
</ul>
</p>
</li>
<li>
<strong><a>Pending</a></strong>
<p>
<ul>
<li>Once the order is created and paid for, it enters the <strong>Pending</strong> state.</li>
<li>If the shop has a <strong>webhook</strong> enabled and valid, the <strong>POS</strong> will receive a <strong>notification</strong> depending on the configured <strong>events</strong>.</li>
<li>Both the customer and shop staff members are notified via <strong>Email</strong> about the new order and start preparing it for pickup.</li>
<li>If the shop has a <strong>printer</strong> configured, the system sends a request to the <strong>Starcloud printer</strong> to print the receipt.</li>
</ul>
</p>
</li>
<li>
<strong><a>Accepted | Rejected</a></strong>
{% include 'Doc/States/Status/rejected.html.twig' %}
</li>
<li>
<strong><a>Delayed</a></strong>
<p>
<ul>
<li>There may be instances where the order <strong>cannot be fulfilled in the requested time</strong> due to multiple reasons, such as inventory issues or too many orders.</li>
<li>In such cases, the shop can delay the order witch will be marked as <strong>Delayed</strong>. The shop must precise the exact minutes of the delay.</li>
<li>The order can be <strong>delayed multiple times</strong> If further delays occur, and each time the order will be updated with the newest delivery time.</li>
<li>On each delay, the customer will receive an <strong>SMS</strong> message so that he can be informed instantly.</li>
</ul>
</p>
</li>
<li>
<strong><a>Ready</a></strong>
<p>
<ul>
<li>When the accepted order's preparation is completed, the shop may mark the order as <strong>Ready</strong>, so that the customer may collect it.</li>
<li>Once again, the customer will receive an <strong>SMS</strong> message so that he can be informed instantly.</li>
</ul>
</p>
</li>
<li>
<strong><a>Cancelled</a></strong>
{% include 'Doc/States/Status/cancelled.html.twig' %}
</li>
<li>
<strong><a>Refunded</a></strong>
<p>
<ul>
<li>Orders are refunded if they have been <strong>Cancelled</strong> or <strong>Rejected</strong>.</li>
</ul>
</p>
</li>
<li>
<strong><a>Expired</a></strong>
{% include 'Doc/States/Status/expired.html.twig' %}
</li>
<li>
<strong><a>Delivered</a></strong>
<p>
<ul>
<li>Once the customer <strong>collects</strong> his order, the shop may mark the order as <strong>Delivered</strong>.</li>
<li>The customer receives the ordered items, and the transaction is considered <strong>successful</strong>.</li>
</ul>
</p>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
{% endblock %}