Brekz Logistics¶
The brekz-logistics service is part of the Brekz platform.
This document describes its purpose, responsibilities, and key information for developers working on or with this service.
Purpose¶
The purpose of brekz-logistics is to handle the logistics part of the organisation. With this software we can automaticly create certain batches to ship towards the customers. The order data from prestashop with PDF's and labels from DPD.
Technical Flows¶
Order Characteristics - Build up
The `OrderCharacteristic` is a structured summary of relevant data derived from an order. It is used to determine whether an order is eligible to be included in an order batch. This summary is constructed using the following criteria: * **Warehouse Zone Mapping** The system determines which warehouse zone applies to the order based on the store location associated with the order. * **Delivery Date Set by Customer** It checks whether the customer has specified a preferred delivery date during checkout. * **Single Order Line Validation** Some batch types only allow orders that contain a single product line. The system verifies whether this condition is met. * **Customer Comments Presence** If a customer has left any messages or comments, this is recorded for consideration during batching. * **Warehouse Product Matching** The system identifies whether the order contains product types that are managed by specific warehouse zones, such as food or pharmaceutical items. * **Order Processing Status** It checks the order’s history to determine whether it has already been processed or is still eligible for batching. * **Delivery Country ISO Code** The country associated with the delivery address is extracted and stored, ensuring correct handling and shipping logic. * **DPD Region Assignment** Based on the delivery country, the order is mapped to a corresponding DPD shipping region (e.g., Netherlands, France, or Switzerland) for logistical purposes. This information is collected at the time the `OrderCharacteristic` is created. It ensures that downstream logic can efficiently determine whether an order meets the business requirements for batch processing—without rechecking the original order data.Order batch - Creation criteria
The order batch can be created in the nova control panel at the order batch index. This is the place where you give the criteria of the order batch.flowchart TD
Start[OrderCharacteristic] --> C1[Created At Least 1h Ago]
C1 -->|Yes| C2[Is Valid]
C2 -->|Yes| C3[No Customer Thread]
C3 -->|Yes| C4[Not Processed and Not Batched]
C4 -->|Yes| Result[Include in Batch]
C1 -->|No| Skip1[Skip Order]
C2 -->|No| Skip2[Skip Order]
C3 -->|No| Skip3[Skip Order]
C4 -->|No| Skip4[Skip Order]
Bundle and Normal Product Handling in Brekz Logistics
Brekz Logistics processes two types of products: normal products (individual items) and bundles (products composed of multiple items). The system ensures that both types are handled efficiently during batch creation and PDF generation, optimizing the order fulfillment process. ### How It Works 1. Normal Products Definition: Standalone items sold individually. Batch Creation: Grouped into batches based on volume and warehouse location. PDF Generation: The PDF lists each product with its EAN, name, quantity, and location, sorted by location for efficient picking. 2. Bundles Definition: Products composed of multiple items (e.g., a gift set). Batch Creation: The system detects bundles and retrieves all items within them. It calculates the total quantity of each item in the bundle. The batch is updated to include all items with their correct quantities. PDF Generation: The PDF lists all items in the bundle with their EAN, name, quantity, and location, sorted by location for efficient picking. ### Key difference | Aspect | Normal Products | Bundled Products | | ------------ | ----------------------- |-----------------------------------------------------------------------| | Product Type | Single, standalone products. | Composed of multiple individual products. | | Batch Creation | Based on volume and location. | Requires additional processing to extract and calculate bundle items. | | Quantity Calculation | Directly uses the product quantity. | Sums quantities of all items in the bundle. | | PDF Generation | Lists individual products. | Lists all items in the bundle with their quantities. | ### Why It Matters *Accuracy*: Ensures that the correct quantities of products and bundles are reflected in batches. *Efficiency*: Optimizes the picking process by sorting products and bundles by location. *Scalability*: Handles both normal and bundled products seamlessly, making the system adaptable to various product types. ### Example Workflow **Normal Product** 1. A customer orders 1x Product A. 2. The system creates a batch for Product A. 3. The PDF lists Product A with its details. **Bundle Product** 1. A customer orders 1x Gift Set (composed of 1x Product A, 2x Product B, and 1x Product C). 2. The system identifies the Gift Set as a bundle. 3. The system extracts the items in the bundle and calculates their quantities. 4. The batch is created for the Gift Set, including all items with their quantities. 5. The PDF lists all items in the Gift Set with their details. ### flowchart flowchart TD
A[Start: Order Received]
B{Is the Product a Bundle?}
A --> B
%% Normal Product Flow
B -->|No| C[Extract Order Details: EAN, Name, Quantity, Location]
C --> D[Create Batch for Normal Product]
D --> E[Generate PDF: List Product Details, Sort by Location]
E --> F[End: Batch Ready for Picking]
%% Bundle Flow
B -->|Yes| G[Detect Bundle: Identify Bundle Items]
G --> H[Extract Bundle Items: Retrieve All Items in Bundle]
H --> I[Calculate Quantities: Sum Quantities of All Items]
I --> J[Update Batch with Bundle Items]
J --> K[Generate PDF: List All Bundle Items, Sort by Location]
K --> F
Single order lines - Different types
The order batch is created with some specific criteria based on the Order Characteristics, which can also be found in the technical flows. The order batch Can have a maximum of x products per batch. This way they can scale a lot easier and have more people at work for smaller batches with bigger load of products. We currently have 3 types of batches. - Original - Medium - High This amount of the numbers could be changed very often, but this was the original plan.Technical Overview¶
| Type | Technology |
|---|---|
| Language | PHP 8.3 |
| Framework | Laravel |
| Database | MySQL |
| Queue System | Beanstalkd |
| API Type | RESTful API |
Main Responsibilities¶
[TO BE IMPLEMENTED]
Monitoring & Alerts¶
This service is monitored through: - Laravel logs → [central logging service link or documentation] - Health checks exposed at /health or in the nova dashboard. - Health Monitoring via Sensu/Uptime robot of the DPD Endpoint
Changelog¶
The changelog for this service is managed via GitHub Releases:
- View releases
Feature Dependencies¶
Downstream: brekz-prestashop (receives updated order information).
flowchart LR
brekz-prestashop --> brekz-logistics