Domain: Fulfilment¶
The Fulfilment domain manages shipment options, carrier integrations and the logic for determining which fulfilment methods are available for a given cart or order.
Responsibilities¶
- Defining and maintaining available fulfilment methods (e.g. PostNL shipment options).
- Evaluating which fulfilment methods are applicable to a specific cart based on rules (weight, dimensions, product type, delivery address).
- Integrating with PostNL to create shipments and retrieve track & trace codes and labels.
- Storing fulfilment configuration per method (product codes, service options, constraints).
Entities¶
| Entity | Description |
|---|---|
FulfilmentMethod |
A configured delivery option (e.g. "PostNL Standard", "PostNL Evening Delivery"). Holds carrier settings, constraints and display metadata. |
FulfilmentRule |
A rule that determines whether a FulfilmentMethod is applicable (e.g. max weight, allowed regions, product restrictions). |
Shipment |
A shipment created with the carrier (PostNL). Contains the track & trace code and a reference to the generated label. |
Integrations¶
PostNL API
Shipments are created via the PostNL API. The following shipment options are currently supported:
| Option | PostNL Product | Product Code |
|---|---|---|
| Standard Shipment | PostNL Standaard | 3085 |
| Delivery with Signature | Handtekening voor ontvangst | 3089 |
| Evening Delivery | Avondlevering | 3096 |
The API returns a track & trace code and a shipment label (PDF) upon successful creation.
Business Rules¶
- A fulfilment method is only shown during checkout if all its associated
FulfilmentRuleconstraints are satisfied. - Constraints may include: maximum total cart weight, maximum parcel dimensions, product type restrictions, and delivery region eligibility.
- When a cart change causes a previously selected fulfilment method to become invalid, the selection is cleared and the customer is notified.
- Each PostNL shipment is linked to exactly one order; a single order may not currently be split across multiple shipments in the initial release.